Jump to content


Check out our Community Blogs

g-man122

Member Since 28 Dec 2009
Offline Last Active Apr 16 2010 03:59 AM
-----

Topics I've Started

[Help] Using/calling a function from a C++.DLL in C#.

14 April 2010 - 12:34 PM

Hi people,

Recently, I've been trying--and failing-- to call a function from a C++ dynamic link library from a C# console application.. All is good, the compiling goes well on both ends, however! When I try call the function from the C++ DLL, I get this error :
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
coming from the C# console application. It'll break at the function calling part and give me that.

Here's the C# console application code.
And here's the C++ DLL code

I've googled the error many times, nobody seems to have a working solution. I'm running Windows XP Pro 64-bit.

Any help would be immensely appreciated.

Thanks for reading.

[Sorry if it's the wrong section]

Building an application extension ?

06 January 2010 - 03:22 PM

I've got the whole idea and concept of how to build a .DLL to extend an executable file, but, I've never read any tutorials.

I know the idea of it is, to set up a pointer to the function/class, set the parameters and then call it. But that's all - and I'm not even sure that's correct.

Does anyone have any good tutorials on how to do so ? If so, please post them :).

Thanks
Regards,
GMAN.

Hey.

28 December 2009 - 08:01 AM

Hey,
I'm at a "basic" level of C++/C#/Assembly, I've never really joined any programming forums before, but yeah, that's about it.

Regards,
G-man.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download