Groups | Blog | Home
all groups > visual c > october 2007 >

visual c : DllRegisterServer


David Lowndes
10/29/2007 12:00:00 AM
[quoted text, click to view]

Whenever something calls it!

[quoted text, click to view]

Does you build process have a step to call regsvr32 to register (i.e.
call that function)?

[quoted text, click to view]

It may only be getting called in the debug configuration of your
project.

David Lowndes
10/29/2007 12:00:00 AM
[quoted text, click to view]

Yes, that's what that option does:

"Register Output
Run regsvr32.exe /s $(TargetPath), which is valid only on .dll
projects.
"

David Lowndes
10/29/2007 12:00:00 AM
[quoted text, click to view]

Yes, it's in MSDN help - I just clicked the ? help icon in the caption
bar of that property page.

George
10/29/2007 1:07:00 AM
Hello everyone,


I am wondering when function DllRegisterServer will be invoked? I am using
Visual Studio 2005 to develop an in-process native (unmanaged) C++ COM. I am
wondering when it will be invoked?

1. During the build process or during the DLL initialization process?
2. I find this function only works for debug mode, not release mode. Is that
correct?

In MSDN,

http://msdn2.microsoft.com/en-us/library/ms682162.aspx

there are not too much information about when this method will be invoked
and whether it works for both debug mode code and release mode code.


thanks in advance,
George
10/29/2007 2:29:00 AM
Thanks Dave,


I do not explicitly call regsvr32 in build process. For the build process, I
simply use Visual Studio 2005 IDE to build. :-)

I suspect regsvr32 invokes DllRegisterServer since I set the following
option to yes in debug configuration,

Linker --> General --> Register Output to yes

But I am not sure. Any comments?


regards,
George

[quoted text, click to view]
George
10/29/2007 3:17:01 AM
Thanks Dave,


Where do you find the statements?

[quoted text, click to view]

from MSDN or? I want to take a formal look. Thanks.


regards,
George

[quoted text, click to view]
George
10/29/2007 7:12:00 AM
Thanks Dave,


I have found it. I think DllRegisterServer and Register output option should
work for both debug version and release version, right?


regards,
George

[quoted text, click to view]
George
10/29/2007 7:33:01 AM
Thanks for all the help, Dave!


regards,
George

[quoted text, click to view]
Frank Hickman
10/29/2007 12:30:23 PM
[quoted text, click to view]

Actually, the reason is because the installation software is supposed to
register the DLL during installation. The debug version is setup to
register the DLL for debugging.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.

David Lowndes
10/29/2007 2:18:01 PM
[quoted text, click to view]

There's no reason I can think of why they shouldn't! :)

Frank Hickman
10/29/2007 3:29:10 PM
[quoted text, click to view]

Very true.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.

David Lowndes
10/29/2007 6:27:39 PM
[quoted text, click to view]

Yes, that's the reason the default's are the way they are, but there's
nothing to prevent anyone changing it if they want to.

George
10/29/2007 10:30:00 PM
Thanks Frank,


I think you mean there are some difference configurations for debug build
and release build in Visual Studio 2005, which causes the different behavior,
right? Could you point out what do you mean the different setting in Visual
Studio 2005 which is the root cause please?


regards,
George

[quoted text, click to view]
George
10/30/2007 1:45:01 AM
Thanks Frank,


I think if we set Linker->General->Register Output to true in release mode,
it should also work, right?


regards,
George

[quoted text, click to view]
Frank Hickman
10/30/2007 2:40:54 AM
[quoted text, click to view]

Just as you mentioned and David confirmed, the configuration setting
"Linker->General->Register Output" is set for the debug config and not the
release. This is by default the way it is set when the project is created
because of the previously mentioned reason.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.

Frank Hickman
10/30/2007 1:25:03 PM
[quoted text, click to view]

Yes.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.

Frank Hickman
10/30/2007 1:34:01 PM
[quoted text, click to view]


I should mention that in a batch build, the debug version usually builds
last by default, just the order the project settings are created when the
project is created, so your debug version would be the one registered last.

--
============
Frank Hickman
NobŸ/ft, Inc.
============
Replace the _nosp@m_ with @ to reply.

AddThis Social Bookmark Button