Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

x64 C++ DLL called from x64 Managed Code Problem

$
0
0

I have a x64-bit managed project that calls into an x64 bit C++ DLL. This worked good in Visual Studio 2010. However if I upgrade the C++ project to Visual Studio 2012 I can no longer call the x64-bit DLL and I recieve the'An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)' error. This project worked great in Visual Studio 2010. If I do not allow Visual Studio to upgrade the project to Visual Studio 2012 and compile and link with the C++ DLL in Visual Studio 2010 than all works great.

My question is what has changed to break this code. I'm assuming some general type has changed that will require changes in my part. The first function signature that breaks is:

The signature in C sharp is:

internal static extern int ReverseBottomToTop(IntPtr imgptr, int nrows, int ncols)

signature in C++ is:
int ReverseBottomToTop(unsigned char *imgptr, int nrows, int ncols)

Thanks,

Dave Ryan


David Ryan


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>