Recent

Author Topic: 32-bit DLL Causing Run-Time Error 0xc000007b  (Read 8723 times)

spitofland

  • New Member
  • *
  • Posts: 26
32-bit DLL Causing Run-Time Error 0xc000007b
« on: May 17, 2010, 04:05:55 pm »
I am creating a 64-bit program that relies on a function in a 32-bit dll. I am Using Lazarus-0.9.29-25159 and fpc-2.4.1-20100504 for Windows 64-bit. I am running Windows 7 64-bit.

The program compiles with no errors and runs if I comment out the call to the external function. This is true even when the unit with the interface is used.

When the call to the interface is not commented-out I get an error when starting the program as shown in the image. I did not find any useful information when I searched for this error code. Most of the information pointed to Viruses and Worms, but a scan of my system revealed nothing.

The call in my code to the interface in the other unit seems to cause the problem, but the call is in a function that does not run at start-up. Commenting out the call prevents the error.

Is the problem that the dll is 32-bit? Why would including (using) the unit with the interface not trigger the error, while including the function call in my code without running that call triggers the error?

spitofland

  • New Member
  • *
  • Posts: 26
Re: 32-bit DLL Causing Run-Time Error 0xc000007b
« Reply #1 on: May 17, 2010, 05:19:21 pm »
I just found the answer. 32-bit dll's cannot be loaded from 64-bit programs. Does anyone know how to use IPC to call a function in one program and have the results passed to a second program?

eny

  • Hero Member
  • *****
  • Posts: 1587
Re: 32-bit DLL Causing Run-Time Error 0xc000007b
« Reply #2 on: May 17, 2010, 06:16:54 pm »
Maybe you can use a simple ipc client/server.
An example can be found here (have a look a the UniqueInstance.pas file).
It uses IPC to check if a program is already running.
But the mechanism can of course be used for many other purposes.

This only works if you have full (source) control over both/all programs.
All posts based on: Win10 (Win64); Lazarus 1.8.0 'stable' (#56594 win64) unless specified otherwise...