Phix: c-struct

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

Hallo

I've been experimenting with phix again. I wanted to take a look at this c-struct.

So I copied the example from the documentation, but unfortunately didn't get very far.

struct rect """ 

typedef struct _RECT { 
  LONG left; 
  LONG top; 
  LONG right; 
  LONG bottom; 
} RECT, *PRECT; 
""" 

end struct 
rect q = new({10,10,350,200}), 
     r = new() 
r.left = 10     --\   equivalent to using the 
r.top = 10      -- }   {10,10,350,200} above 
r.right = 350   -- }  and/or m = allocate(16) 
r.bottom = 200  --/    & poke4(m+0/4/8/12,..). 
 
-- then eg c_proc(xFillRect,{hDC,struct_mem(r|q)|m,hBrush}) 

ended like this

D:\testpool\ray_test\struct_test.ex:10 
type check failure, q is {"struct","rect",2,10910404.0} 
 
Global & Local Variables 
 
--> see D:\testpool\ray_test\ex.err 
Press Enter... 
Am I doing something wrong, or have I simply misunderstood?(Phix 1.05 32/64bit)

Thank you.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu