Re: [Haskell-cafe] C structures

2009-11-13 Thread Vasiliy G. Stavenko

  
  I need anyones experience. 
 
 Possibly this old post of mine can help: 
 http://therning.org/magnus/archives/315
 

Oh...
WHile i was trying to repeat after you, it's become clear to me that
this is not actually what I want.

I want to create some structure, say
data WM = WM {some_info :: Ptr CChar}

create pointer for it
type LPWM = Ptr WM

and, when i need to convert it to something Int (or UINT)
I found in Graphics.Win32 function 
castPtrToUINT :: Ptr a - UINT

So my question now is:
would the structure defined in haskell as written in
http://therning.org/magnus/archives/315, which pointer i will send to
another C-function? be restored properly?

Or maybe there's another function? which allows to do so?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] C structures

2009-11-12 Thread Vasiliy G. Stavenko
Hello everyone.

What about passing complex c-types (structures) to c-functions.

More detailed: I have an application in production which was written in
Delphi. IT has ability to create pluggable modules to it. Interface
realized by sending Win32Api messages to application. 

function in haskell Win32  
Graphics.Win32.sendMessage :: HWND - WyidowMessage- WPARAM - LPARAM
- IO RESULT

Application wants to get different data in WPARAM and LPARAM. Such as
window descriptor (HWND), string pointers and datastructer pointers.
The latter i don't know how to create. 

I need anyones experience. 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe