Click here to Skip to main content
15,908,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Windows Firewall exception Pin
User 21559721-Oct-08 1:35
User 21559721-Oct-08 1:35 
QuestionCOM dll registration Pin
Krishnakumartg20-Oct-08 23:44
Krishnakumartg20-Oct-08 23:44 
AnswerRe: COM dll registration Pin
Iain Clarke, Warrior Programmer21-Oct-08 0:05
Iain Clarke, Warrior Programmer21-Oct-08 0:05 
GeneralRe: COM dll registration Pin
Krishnakumartg21-Oct-08 0:26
Krishnakumartg21-Oct-08 0:26 
AnswerRe: COM dll registration Pin
Roger Stoltz21-Oct-08 0:16
Roger Stoltz21-Oct-08 0:16 
GeneralRe: COM dll registration Pin
Krishnakumartg21-Oct-08 0:28
Krishnakumartg21-Oct-08 0:28 
GeneralRe: COM dll registration Pin
Iain Clarke, Warrior Programmer21-Oct-08 1:05
Iain Clarke, Warrior Programmer21-Oct-08 1:05 
AnswerRe: COM dll registration Pin
Roger Stoltz21-Oct-08 2:13
Roger Stoltz21-Oct-08 2:13 
Krishnakumartg wrote:
By the word "registered", I mean that whether the thing "regsvr32 mydll.dll" had been done or not.


Ok.
Let us elaborate on this for while...

Like Iain said, what "regsvr32" does is simply load the .dll-file with ::LoadLibrary(), get the entry address of the exposed function DllRegisterServer() with ::GetProcAddress() and finally call DllRegisterServer() in the library.
What that function does is entirely up to the library.
In case of COM servers in DLLs, the DllRegisterServer() function is assumed to add information about the objects and interfaces exposed from the library into the registry.

There's no guaranteed way of knowing what COM servers, interfaces and/or their GUIDs just by looking into the library. Different COM servers may be created with different tools, they may or may not have the typelibrary included as a resource in the library.

Even if you walk through the registry tree below the HKCR/CLSID key and enumerate all registered servers, you may find servers that reside in files with the same name as the one provided to the application, but you have no clue whether this might be a later version if the paths differ.

You also have to consider what to do if you come to the conclusion that the DLL provided to the application has not been registered.
Are you supposed to register it? Then you can save a lot of trouble and simply register it without checking whether it was previously registered or not.
Is the user supposed to figure out if this DLL should be registered? Based on what information? How could the user possibly know?

My point is that there's no safe way of figure out whether a certain DLL has been "registered" or not. And even if there was, it's unclear what should be done with the file.

BUT, if you have a handful of COM servers and you know their IDs and interfaces, you could try to create each one of them and if the creation fails with the error REGDB_E_CLASSNOTREG you know that it has not been registered yet.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


QuestionInterface not registered Pin
CodingLover20-Oct-08 23:36
CodingLover20-Oct-08 23:36 
AnswerRe: Interface not registered Pin
Iain Clarke, Warrior Programmer21-Oct-08 0:07
Iain Clarke, Warrior Programmer21-Oct-08 0:07 
QuestionRe: Interface not registered Pin
Roger Stoltz21-Oct-08 0:10
Roger Stoltz21-Oct-08 0:10 
NewsRe: Interface not registered Pin
CodingLover21-Oct-08 2:40
CodingLover21-Oct-08 2:40 
QuestionRe: Interface not registered Pin
Roger Stoltz21-Oct-08 2:54
Roger Stoltz21-Oct-08 2:54 
NewsRe: Interface not registered Pin
CodingLover21-Oct-08 23:11
CodingLover21-Oct-08 23:11 
AnswerRe: Interface not registered Pin
Roger Stoltz21-Oct-08 23:58
Roger Stoltz21-Oct-08 23:58 
NewsRe: Interface not registered Pin
CodingLover22-Oct-08 0:21
CodingLover22-Oct-08 0:21 
AnswerRe: Interface not registered Pin
Roger Stoltz22-Oct-08 0:26
Roger Stoltz22-Oct-08 0:26 
Questioncustom service and application - resource lock ? Pin
dharani20-Oct-08 23:34
dharani20-Oct-08 23:34 
AnswerRe: custom service and application - resource lock ? Pin
dehseth21-Oct-08 0:26
dehseth21-Oct-08 0:26 
QuestionSearching for a Manifest File Pin
si_6920-Oct-08 23:15
si_6920-Oct-08 23:15 
AnswerRe: Searching for a Manifest File Pin
_AnsHUMAN_ 20-Oct-08 23:25
_AnsHUMAN_ 20-Oct-08 23:25 
GeneralRe: Searching for a Manifest File Pin
si_6920-Oct-08 23:51
si_6920-Oct-08 23:51 
QuestionAssertion fail error when loading a DLL? Pin
bankey101020-Oct-08 23:10
bankey101020-Oct-08 23:10 
AnswerRe: Assertion fail error when loading a DLL? Pin
Roger Stoltz20-Oct-08 23:22
Roger Stoltz20-Oct-08 23:22 
AnswerRe: Assertion fail error when loading a DLL? Pin
CPallini20-Oct-08 23:25
mveCPallini20-Oct-08 23:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.