Sample from Windows SDK works in Debug configuration, and fails in Release. How is that possible?

StackOverflow https://stackoverflow.com/questions/23094376

  •  04-07-2023
  •  | 
  •  

Question

Sample: http://msdn.microsoft.com/en-us/library/windows/desktop/dd940359%28v=vs.85%29.aspx

When I build it in Debug configuration, everything is fine.

When I build it in Release configuration, I can't register it. When I call

regsvr32 ExplorerCommandVerb.dll

It says:

The module "ExplorerCommandVerb.dll" was loaded
but the entry-point DllRegisterServer was not found.

Make sure that "ExplorerCommandVerb.dll" is a valid
DLL or OCX file and then try it again.

My configuration: Microsoft Visual Studio 2013 on Windows 8.1 64-bit. The same happens on Windows 7 32-bit.

Was it helpful?

Solution

It's a missing setting in the Release version of the project. Not sure if its caused by the conversion process, but I can reproduce the problem as described.

The module definition file is not specified in the Release version. Select the ExplorerCommandVerb Project, one level below the Solution and choose Properties. Select Linker, then Input in the property tree on the left, then select Module Definition File on the right. In Debug mode, this is shown as Dll.def, while in Release mode it is missing. Simply copy the setting over to Release mode and it will work as expected.

OTHER TIPS

Found the problem: for some reason, it didn't use Dll.def file included to the project. I forced it to use this file with linker options, and now it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top