cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Binary of libcurl on Win64

From: Lars Nilsson <chamaeleon_at_gmail.com>
Date: Tue, 20 Jan 2009 11:04:53 -0500

On Tue, Jan 20, 2009 at 10:42 AM, your ishiro <your_ishiro2_at_yahoo.com> wrote:
> 9. I copyed a libcurl.dll into c:\WINDOWS\system32 folder.
> 10. I called a libcurl.dll from my custom C# application on Win64.
>
> But next error occured...
>
> System.BadImageFormatException: An attempt was made to load a program with an incorrect
> format. (Exception from HRESULT: 0x8007000B)
>
> I'm not sure if my libcurl.dll is compiled as 64bit application or not. I am glad if I could get some help.

A quick google query (or even using the help in Visual Studio) for
BadImageFormatException would have told you that you'll get this error
if you try to load non-managed code[1] in a managed code application.
There's nothing wrong (presumably) with the dll itself, only your
attempt to load it in an incorrect manner, solutions to which you're
better off searching for in Microsoft .NET forums.

Lars Nilsson

[1] http://msdn.microsoft.com/en-us/library/system.badimageformatexception.aspx
"This exception is thrown when the file image of an executable program
is invalid. For example, this exception is thrown when unmanaged code
is passed to Load for loading."
Received on 2009-01-20