![]() I tried to cleanup, and came up with the below code, untested. and pass the amount allocated in byteread.probably also you need to allocate memory to memarea before you pass it to the function.declaring them as VAR eats an indirection, so probably in the declaration the types should be just DWORD. But then again you declare them var as pointers (LPdw*).You probably want But you don't need that since you declare the values VAR. First & means something different in Delphi.This is my header of dll function : function CEFReadB(lpMemArea : PAnsiChar var pdwByteRead : LPDWORD var lpdwSysError : LPDWORD) : DWORD cdecl external DLLName name 'CEFReadCustom' delayed valueBits.S9_isBonNefiscalDeschis := Arr = '1' ValueBits.S8_isBonFiscalDeschis := Arr = '1' ![]() Move(MemArea^, Arr, Integer(pdwByteRead)) LastError := CEFReadB(MemArea, &pdwByteRead, &lpdwSysError)//acess violation if i use valueBits record function TdmCustom.CheckBon(var valueBits: TStatusPrintingRecord): Boolean Here is my code if i use valueBits record return AV if i use a simple boolean variable it's working. I declared the header of function but when i call and try to assign the array value to a record value, function return access violation in MSVCR80.dll. I try to call a function to read some bytes from c++ dll.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |