Ryan Turcotte

Ryan Turcotte

  • NA
  • 9
  • 14.5k

DLL registration issue

Feb 3 2011 12:51 PM
I'm not 100% sure this should be under COM interop but it seems appropriate enough.

I have designed a C# program in VS2008 (.NET 3.5).  the purpose of the program is to use my brokerage's COM dll components to connect to them and pull quote history automatically every so often for analysis in my other program which emails me updates and possible trade decisions.

my program works just fine but the issue is knowing when to register the DLL's or not.  What I mean is that if the user has the brokerage's software already installed on the machine then there is no need to register them.  in fact, doing so will work temporarily but if my program is uninstalled them the brokerage software doesn't work.  i had to uninstall, reinstall, and reboot before the brokerage software would work after registering "my" DLL's.

i am  using a batch file script to execute regsvr32 commands on the DLL's in my program's installation directory and what i believe what is happening is that there is only one entry in the registry for a given CLSID and therefor, when my program is installed and runs for the first time it registers the ones in my directory.  then if i uninstall mine, the entries are gone or invalid and the brokerage software cannot load the objects because the CLSID entry in the registry is either missing or points to a file that no longer exists.

how would i go about ensuring that my program does not screw up the brokerage software while still working on machines that don't have it installed?  is there a way to use the COM DLL's in my directory WITHOUT having them registered with the system?  that would solve the problem.  if not, how would i go about this?  would i have to write code to check the registry for valid entries for each CLSID and if it does not exist, then register that DLL?


Thanks in advance,

-Ryan

Answers (9)