DllRegisterServer

G

Guest

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
 
D

David Lowndes

I am wondering when function DllRegisterServer will be invoked?

Whenever something calls it!
1. During the build process or during the DLL initialization process?

Does you build process have a step to call regsvr32 to register (i.e.
call that function)?
2. I find this function only works for debug mode, not release mode. Is that
correct?

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

Dave
 
G

Guest

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
 
D

David Lowndes

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?

Yes, that's what that option does:

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

Dave
 
G

Guest

Thanks Dave,


Where do you find the statements?
"Register Output
Run regsvr32.exe /s $(TargetPath), which is valid only on .dll
projects.
"

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


regards,
George
 
D

David Lowndes

Where do you find the statements?
from MSDN or? I want to take a formal look. Thanks.

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

Dave
 
G

Guest

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
 
D

David Lowndes

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

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

Dave
 
F

Frank Hickman

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

Dave

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.
 
D

David Lowndes

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.

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.

Dave
 
F

Frank Hickman

David Lowndes said:
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.

Dave

Very true.

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

Guest

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
 
F

Frank Hickman

George said:
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

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.
 
G

Guest

Thanks Frank,


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


regards,
George
 
F

Frank Hickman

George said:
Thanks Frank,


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


regards,
George

Yes.

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

Frank Hickman

Frank Hickman said:


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top