Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-09

Problem linking a Windows DLL

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anton Shepelev

Hello all,

I have a plain Windows DLL made in Visual Studio C++ and working with other C applications. When I try to statically import it into an FPC program I get the following error:

An unexpected error occurred while initializ-
ing an application 0xc0000034

When using it dynamically, the LoadLibrary() func- tion returns NilHandle, indicating failure.

I have checked that my code works with other DLLs -- kernel32.dll for example.

Could you please help me fix make this DLL work with FPC? I can provide both the source and the binary of the DLL and of my program.

Thank you in advnace,
Anton

Reply by email

Ludo Brands
to Anton Shepelev
Show quoted text 7 lines
An unexpected error occurred while initializ- ing an application 0xc0000034 When using it dynamically, the LoadLibrary() func- tion returns NilHandle, indicating failure.

Both errors indicate that the dll couldn't be loaded. Or the dll itself isn't found, or the dll has dependencies (probably c libraries) that aren't found.

Ludo

Reply by email

Anton Shepelev
to Elmar Haneke

Ludo Brands:

Both errors indicate that the dll couldn't be loaded. Or the dll itself isn't found, or the dll has dependencies (probably c libraries) that aren't found.

The DLL does work on another PC, so the problem must be with some dependencies. Many thanks. But how can determine what is missing?

Elmar Haneke:

Show quoted text 5 lines
Is there in addition an messagebox shown indicat- ing an problem with C runtime? If so you probably need an Manifest file for your FPC application

No, there are no other messages.

Anton

Reply by email