Windows 2008 64 bit OS and 32 bit COM EXE's - windows

getting a COM error trying to run 32 bit OOP COM exe's on a 64 bit OS.
Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
If I have a compiled 32bit EXE that reads registry for GUID's how do I resolve this?
David D

That's probably a registration problem. The type library is used when you use the standard marshaller for the out-of-process server. Which uses the info in the type library to figure out how to properly serialize the arguments of a function call. On a 64-bit machine, the type library needs to be registered in the HKLM/Software/Wow6432Node/Classes/Typelib key. It is referenced by the TypeLib key in the registry key for the interface, a subkey of HKLM/Software/Wow6432Node/Classes/Interface.
Use SysInternals' ProcMon utility to observe where it is looking, contact the server's vendor or author for installer support.

Found the answer... The .NET solutions I had were set to "Any CPU". Once I changed it to x86... this solved the issue.

Related

Class not register while opening outlook in 64 bit system

While running our windows application on 64 bit system , we are facing some issue for opening outlook . It says "Class not registered" error . We tried to register the outlook dll and again it is showing error like entry-point DllRegisterServer was not found . Make sure that Microsoft.Office.Interop.Outlook.dll is a valid dll or OCX file and then try again .We are using below commands for registering the dlls ..
C:\Windows\System32\regsvr32.exe /i Microsoft.Office.Interop.Outlook.dll
C:\Windows\SysWOW64\regsvr32.exe /i Microsoft.Office.Interop.Outlook.dll
FYI , our windows application -> target platform is set to 'Any CPU' for Build
Appreciate the help , Thanks
What is the Outlook bitness? Is it 32 bit?
The bitness of your app must match the bitness of Outlook, not the parent OS (which is what "Any CPU" does).
Also keep in mind that your interop dll is just a binary header, it is not the real COM object (which in case of Outlook is implemented by outlookj.exe).

How to query the architecture of a plug-in DLL on Windows

My app uses LoadLibrary to load plugins at run-time and users can accidentally try to load 64 bit plugins in the 32 bit version of my application.
It looks like the error code returned from LoadLibrary is not very descriptive (says "%1 is not a valid Win32 application").
I am looking for ways to figure out if the plugin dll file is built 32 or 64 bit so that I can notify the user in a user friendly way.
Any ideas?
In order to retrieve information about an image such as the one you are looking for, just use the ImageHelp API

LoadLibrary fails with lasterror 0x43 The network name cannot be found

My program dynamically loads a number of DLL's using LoadLibrary and (on literally all machines) these load successfully, on one machine some of these DLL's do not get loaded. I added code to trace lasterror and this reports "0x43 The network name cannot be found.".
The machine in question is running Windows 7 Enterprise x64, the DLL is a 32 bit DLL, this shouldn't be an issue and (in fact) this is my development environment.
I also tried converting the name of the DLL (which includes the path) to a short filename and used that in the call to LoadLibrary, I still got the same error.
Any ideas?
//*eggbox
Download Procmon let it run and filter for you dll name. This will immediately give you the locations where the dll was searched and which access path did return 0x43.
You get even the call stacks if you have the pdbs for your code as well (C/C++ only no managed code).
Run the program through Dependency Walker in its Profile mode and let that fine tool tell you exactly what is going wrong.

using RegCreateKeyEx gives error code 5

I used RegCreateKeyEx from a win32 application(VisualStudio 2008) in 64 bit windows(Project built with target x64). It was able to create a registry entry. Now I have a dll file (Project built with target x64) which too wanna create registry entry but my dll is returning error code 5(Yeah! its a sign of access denied). My samDesired flag have KEY_ALL_Access + In linker->manifestfile->run as administrator chosen which still fails with error code 5. Whereas it works perfectly in 32bit windows(Project built with target x86). Am i missing something?
NOTE: I'm trying to create an entry at HKEY_LOCAL_MACHINE.
You can't create a registry key in HKEY_LOCAL_MACHINE because this isn't a hive. You need to put your key in HKEY_LOCAL_MACHINE\Software or (less probably) one of the other hives.
I don't know why this appeared to work when you were running 32-bit code in WOW64, perhaps this is a side-effect of the way the 32-bit view of the registry is presented.

Can't call 32bit dll under 64bit windows

I try to create a COM object from my JS script like this:
function main()
{
var MyApplication = new ActiveXObject("Base.Application");
}
main();
I am getting error: "Automation server can't create object". This error occurs on Windows 2003 64 bit. The dll is 32 bit and it works fine on 32 bit systems.
I've tried both versions of Regsvr32.exe on the 64 bit system and both versions told me that dll registered succesfully.
Unfortunatelly the error message does not tell me why it can not create object. The reason is unknown, it might be that it can't create object because it is still not registered or it might be something totally different...
I've also add full permisions to this dll.
I don't know what else I can do, do you have any ideas?
After edit
Ok, I know that this DLL is registered under system (found it at the registry), so why I can't call any COB objects from it?
Maybe because your process is 64 bits and you try to call in a 32 bit dll? (There are some tricks though, in this case like the one described here).

Resources