Question : COM Interfaces in .NetQuestion:

Hello and I am sure this  is a basic question and I believe I know the answer but wanted confirmation. I have a COM assembly with an interface I want to implement in my .Net Assembly. Besides the referencing the COM assebmly and making sure the DLL is registered on my computer or some other server, finally implementing the Interface and using the methods, do I need to do anything else. Do I need to worry about registering the .Net Assembly in the GUID registry? Thanks

Answer : COM Interfaces in .NetQuestion:

Unfortunately there's no way to do the enhanced variable substitution (like replacing characters, or extracting characters, etc with either parm variables (%1, %2, %3, ...) or FOR loop variables (%%A, %%B, %%C, ...).  Sad but true.

If you want to keep the mainline code a little cleaner you could do this approach using a called subroutine.  It trims any left or right spaces from the passed string, and stores the result in the named variable.

for /f "tokens=1-5 delims=," %%A in ("%String%") do (
  echo BEFORE: %%A %%B %%C %%D %%E
  call :Trim "%%A" A
  call :Trim "%%B" B
  call :Trim "%%C" C
  call :Trim "%%D" D
  call :Trim "%%E" E
)
echo AFTER : %A% %B% %C% %D% %E%
pause
exit /b

:Trim "input-string" return-variable
  set s=%~1
  for /F "tokens=* delims= " %%A in ("%s%") do set s=%%A
  for /L %%A in (1,1,50) do if "!s:~-1!"==" " set s=!s:~0,-1!
  set %~2=%s%
  exit /b

~bp
Random Solutions  
 
programming4us programming4us