Originally Posted by
BobMcGee123
Hi Andrew,
I did recompile to 64 bit, but was unaware of that bug so thanks for the info. I'll have to research that.
It's not a "bug" it's a rule... a 64bit executable cannot load a 32 bit dll... a 32 bit executable cannot load a 64 bit dll. This is because of difference in the size of pointers and addresses also note that a number of commonly used data types need to be adjusted as well... for example when using unsigned ints to store pointers you need to change all UINT references to UINT_PTR... Programming Guide for 64-bit Windows (Windows)
If your dll is 32 bits... you have two choices... either recompile it to 64bits or rebuild your executable as 32 bits.
Also note that you must adjust manifests in both executable and dll accordingly...
32 bit manifest...
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32"
name="AutoLogon"
version="1.0.0.0"
processorArchitecture="X86" />
<description>
Auto logon tool
</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker"
uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
64 bit manifest...
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32"
name="AutoLogon"
version="1.0.0.0"
processorArchitecture="amd64" />
<description>
Auto logon tool
</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="amd64"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker"
uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>