We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@TooTallNate I have a problem with pointer to pointer of struct. well, I have the code in c/c++
typedef struct _wfs_ptr_status { WORD fwDevice; WORD fwMedia; WORD fwPaper[WFS_PTR_SUPPLYSIZE]; WORD fwToner; WORD fwInk; WORD fwLamp; LPWFSPTRRETRACTBINS * lppRetractBins; USHORT usMediaOnStacker; LPSTR lpszExtra; } WFSPTRSTATUS, * LPWFSPTRSTATUS; typedef struct _wfs_result { REQUESTID RequestID; HSERVICE hService; SYSTEMTIME tsTimestamp; HRESULT hResult; union { DWORD dwCommandCode; DWORD dwEventID; } u; LPVOID lpBuffer; } WFSRESULT, * LPWFSRESULT; WFSRESULT *pResult = 0; WFSGetInfo (&pResult); LPWFSPTRSTATUS lpStatus = (LPWFSPTRSTATUS)pResult->lpBuffer;
in node-ffi, I've the code:
var WFSRESULT = Struct({ 'RequestID': 'ulong', 'hService': 'ushort', 'tsTimestamp': SYSTEMTIME, 'hResult': 'long', 'u': union, 'lpBuffer': 'pointer' }) var LPWFSRESULT = ref.refType(WFSRESULT) ... ... ... var pResult = ref.alloc(LPWFSRESULT,0) lib.WFSGetInfo (pResult); var result = pResult.deref().deref() //c++ code - LPWFSPTRSTATUS lpStatus = (LPWFSPTRSTATUS)pResult->lpBuffer; result.lpBuffer.type = ref.refType(LPWFSPTRSTATUS) //is this working?
but I don't know this code is correct. How to access the fields of the WFSPTRSTATUS struct as c++ code?
The text was updated successfully, but these errors were encountered:
Did you mean to open this over at https://github.com/node-ffi/node-ffi?
Sorry, something went wrong.
Yes. @TooTallNate my problem is how to convert the code below to node-ffi. And how to access the fields of LPWFSPTRSTATUS struct.
//c++ code - LPWFSPTRSTATUS lpStatus = (LPWFSPTRSTATUS)pResult->lpBuffer;
Sorry. Now that I saw that I opened the issue in the wrong place.
No branches or pull requests
@TooTallNate I have a problem with pointer to pointer of struct.
well, I have the code in c/c++
in node-ffi, I've the code:
but I don't know this code is correct. How to access the fields of the WFSPTRSTATUS struct as c++ code?
The text was updated successfully, but these errors were encountered: