Problem isolating COM reference, Registry key is missing value Default

  • Thread starter Thread starter jal2
  • Start date Start date
J

jal2

Guest
I am using an ActiveX control (.OCX file) called GdTwainPro on a winForm. I had set Isolated property to True to enable RegFree COM. The full text of the error message was this


Problem isolating COM reference 'GdTwainPro2': Registry key 'HKEY_CLASSES_ROOT\CLSID\{17daeecc-41e0-4bea-b940-dc2b7d54fbf9}\InProcServer32' is missing value Default


When I googled, it seems like everyone got this message as a warning rather than an error. Is there a way to reduce the status of an error to that of a warning? Because I was unable to compile my project. The weird thing is that the problem only occurred for me in C#. I have a VB.Net project that uses the same OCX in RegFree-COM mode without issue.

Moreover all the suggestions I read about this error were far too confusing for me to understand (I'm not very advanced). After many hours of googling, the "dummy approach" suddenly occurred to me - why not just take the error message at face value? This worked for me and I hope it will help someone else.

So here's what I did. The error suggests that there is a registry key missing, or perhaps the key is present but is missing a value named Default. So I typed Regedit on the command line to open the GUI (only on the development machine) and used the Find option to search for the GUID mentioned in the error message: 17daeecc-41e0-4bea-b940-dc2b7d54fbf9. The Find option found that string and highlighted it, and in the righthand pane I could see the word Default, oddly the value was a weird string "GdTwainPro2.dummy". So doesn't this mean that the Default value was already present? Not exactly. Looking more closely at the error message, the desired value was in a subkey called InProcServer32. As I understand it, a "key" shows up as a little yellow folder in the Registry GUI. The GUID had several yellow subkeys/folders directly underneath it,but none of them were named InProcServer32. So I right-clicked the GUID (the string 17daeecc-41e0-4bea-b940-dc2b7d54fbf9) and chose Add Key to create a new yellow folder, and named it InProcServer32. Putting my cursor on this new folder, I could see, in the right hand pane a value named Default. I probably should have stopped there and tried to recompile my project but I was thinking I needed to put a value there. Had no idea what value, so I decided to type the same value attached to the GUID, as mentioned earlier, "GdTwainPro2.dummy". (I right-clicked the word Default > Modify > typed those words). Then I want back and compiled my C# project. Bingo!!! Afterwards I deployed it to a user machine with success. (The initial version of the project was getting a DLL-not-Registered error on the user machine, the new RegFree COM version worked fine). I guess this goes to show that even a blind man can hit the broad side of a barn once in a while...

Since I clearly don't know what the heck I'm doing, I'll be happy to hear any comments as to what is the "right" way to solve this problem. For the moment, I'm just glad it's solved...

I wonder why the problem only occurred in Csharp? VB.Net did not give me this headache.

Continue reading...
 
Back
Top