Systems Management (OpenView-OP Mgmt) Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

32-bit loadlibrary of opcapi.dll fails on win64 - error 193

Occasional Visitor

32-bit loadlibrary of opcapi.dll fails on win64 - error 193

I'm running .NET 2 in 32-bit mode (x86) trying to loadlibrary for opcapi.dll on Microsoft Server 2003 x64 SP2. I'm using HP BTO software A.8.50.51. This code runs on win32, but fails to load w/ the DLL on win64.

loadlibrary 193 seems to indicate that the 32-bit DLL is bad. Anyone have any solutions?

Tom
3 REPLIES
Honored Contributor Honored Contributor

Re: 32-bit loadlibrary of opcapi.dll fails on win64 - error 193

you can't call 32 bit dll's from 64 bit codes or vice-versa. I suspect you're running the native 64 bit agent, you'll need to load that from a 64 bit process.

The better way is to call the automation object (see the examples directory) to send a message - the entire opcapi.dll is implemented as a com object.
I do "Windows"
Occasional Visitor

Re: 32-bit loadlibrary of opcapi.dll fails on win64 - error 193

Drew,

Thanks for the thought, but my code is compiled w/ the x86 CPU option (for 32-bit), and it installs into file path "C:\Program Files (x86)\...". I'm merely trying to port to a Win64 system. The HP BTP software supports both a 32-bit & 64-bit versions of opcapi.dll on win64.

When I compile with the "AnyCpu" (64-bit on win64) option, I can link to the 64-bit opcapi.dll, but other parts of our product require that we stay in 32-bit mode.

So, the big question is "Why can't I load the 32-bit version of opcapi.dll?". The error 193 implies HP shipped a bad library. Am I missing something? The same code works on a 32-bit windows w/ BTO software. Any other ideas?

-Tom
Occasional Visitor

Re: 32-bit loadlibrary of opcapi.dll fails on win64 - error 193

Geez, I've forgotten computers 101.

The problem/solution is simple. There is no reference in the PATH variable to the 32-bit libraries... so my 32-bit app always tries to bind to the 64 bit versions. Duh. Sometimes its the simple things.

Tom