Wayne Si wrote: > I need to pass the pointer of an initialized 1D array of U8 type to my > Dll file. At first, I set the length of the 1D array and initialized > it. Then I configured the Call Lib Node and made the input parameter > as 1D Array Pointer of U8 type. The prototype of the called function > in my Dll file is: > > EXPORT void Grab(unsigned char *LVPict) > > Also, I had a goble pointer of 1D buffer in my Dll file, defined as > LPBYTE pImage, and I wrote the data in the goble buffer to the 1D > array, using > > for (DWORD i=0; i<dwSize; i++) LVPict[i]=pImage[i];
I would hope you define your global pointer rather as a global buffer such as #define SIZE xx // some number which is for sure big enough uInt8 pImage[SIZE]; What you have shown: LPBYTE pImage; only defines a pointer to nothing, so your loop references invalid memory. Rolf K