3
Reply

Using C++ library in C#

Peter

Peter

Jun 20 2012 9:00 AM
2.9k
Hi.

I need help with my code.
I'm trying to run unmanaged code from my C# code.


C++ Code
Result_t oemGetImage(PBYTE pImageBuffer,
                     PDWORD pdwSize, WORD nTop,
                     WORD nLeft, WORD nRight,
                     WORD nBottom, WORD nSkip,
                     WORD nBits, FileFormat_t nFormat,
                     WORD nWhiteValue,
                     WORD nExposeAttempts, WORD nGap,
                     BOOL Invert, void (*fpProgress) (WORD));


I don't know what to do with pImageBuffer, pdwSize or void (*fpProgress) (WORD)).

In C++ I execute this function like this:

BYTE *pBufor;
pBufor = new BYTE[MAX_IMAGE_SIZE];

DWORD *pSize;
    pSize = new DWORD;

oemGetImage (pBufor,pSize, 0, 0, 200, 200, 1, 8, FF_RAW_GRAY, 200, 100, 55, false, NULL);


FF_RAW_GRAY is an enum with value of 1.

How can I declare pBufor which is a pointer to byte array?
And what to do with void (*fpProgress) (WORD))??

Thank you, for all your help.

Answers (3)