Re: C Struct Support
- Posted by petelomax Dec 30, 2010
- 1838 views
I was thinking more of something like:
cstruct:structure("APPBARDATA",""" DWORD cbSize; // sizeof(APPBARDATA) HWND hWnd; // handle of appbar UINT uCallbackMessage; // see below UINT uEdge; // see below RECT rc; // see below LPARAM lParam; """) ABD = cstruct:new("APPBARDATA") cstruct:set(ABD,"uEdge",ABE_LEFT) ? cstruct:get(ABD,"uEdge")
I assume there is little need for "static" c-structs; them all being allocated on the heap is plenty good enough. (I expect ABD to be an {index,ptr}, btw.) The obvious benefit is you don't have to do the line-by-line translation, just cut and paste the C code.
Regards, Pete