Re: C Struct Support

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu