- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I nave created a handle for the WM_COPYDATA message.
wParam and lPatam have type of integer in message handler process.
But actually lPatam is a pointer to a
COPYDATASTRUCT {
ULONG_PTR dwData;
DWORD cbData;
PVOID lpData;
}
lpData is a pointer to a data I need. So, how can I get access to it? Thow to read passed data? The passed data is an array of real*4.
Thanks.
I nave created a handle for the WM_COPYDATA message.
wParam and lPatam have type of integer in message handler process.
But actually lPatam is a pointer to a
COPYDATASTRUCT {
ULONG_PTR dwData;
DWORD cbData;
PVOID lpData;
}
lpData is a pointer to a data I need. So, how can I get access to it? Thow to read passed data? The passed data is an array of real*4.
Thanks.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Until Intel implements Fortran 2003-standard ISO_C_BINDING module, which is supposed to provide portable cross-language bindings, you have to resort to "integer" pointers (aka "Cray pointers"). They're described in documentation as "Integer pointers".
Briefly, a Cray pointer has two components: a pointer (which corresponds to C void*/LPVOID) and a pointee (which can be of any type). When the pointer is assigned a value (an address), the pointee is "automagically" "equivalenced" with the pointed-to address.
In your case (I prefer to declare both pointee and the pointer in one-line separated by semicolon):
Briefly, a Cray pointer has two components: a pointer (which corresponds to C void*/LPVOID) and a pointee (which can be of any type). When the pointer is assigned a value (an address), the pointee is "automagically" "equivalenced" with the pointed-to address.
In your case (I prefer to declare both pointee and the pointer in one-line separated by semicolon):
type(T_COPYDATASTRUCT):: CDS; pointer(pCDS, CDS) real:: MyData(*); pointer(pMyData, MyData) ... case(WM_COPYDATA) pCDS = lParam !CDS now points to (COPYDATASTRUCT*)lParam pMyData = CDS%lpData DO i=1,n foo = MyData(i) END DO
Message Edited by JugoslavDujic on 03-15-2006 05:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank You!

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page