Jepp drm,
You nailed it. If any is facing the same issue here it is:
Code:// read a page INT32 nBytesToRead = 4; // Create the SAFEARRAY USES_CONVERSION; SAFEARRAY *pSA; SAFEARRAYBOUND dimensions[1]; dimensions[0].lLbound = 0; dimensions[0].cElements = nBytesToRead; pSA = SafeArrayCreate(VT_VARIANT, 1, dimensions); if (pSA == NULL) { return 0; // unable to create the safearray } VARIANT_BOOL bvarIsCodePage = true; INT32 nAddress = 0; pIOCDLPPtr->ReadCodePage(bvarIsCodePage, nAddress, nBytesToRead, &pSA); BYTE item = 0; for(long i = 0; i < nBytesToRead; i++) SafeArrayGetElement(pSA, &i, &item);
and the c# dll
Go Cylones (and Vikings)! Happy fridayCode:public Byte [] ReadCodePage(bool IsCode, UInt32 Address, Int32 NumberOfBytes) { Byte[] bTest= new Byte[4]; bTest[0] = 0x55; bTest[1] = 0x56; bTest[2] = 0x57; bTest[3] = 0x58; return bTest; }
roar





Reply With Quote