- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a project that has a VB GUI and a FORTRAN DLL. I want to use SendMessage with SB_SETTEXT message to send some text to a status block in the VB GUI. I have tried all sorts of combinations of %REF, %VAL, etc without success. The following is an excerpt. Can anyone suggest what I may be missing. By the way the INTERFACE block declares all four arguments as INTEGER and invokes STDCALL. I have been successful using a SB_SIMPLE message that passes a logical*4 flag--so the VB is passing the correct HWND. The issue appears how to get the string passed as the specified INTEGER variable.
Integer*4 Function MYMESSAGE(myHWND)
CDEC$ ATTRIBUTES DLLEXPORT :: MYMESSAGE
CDEC$ ATTRIBUTES ALIAS: 'MYMESSAGEA' :: MYMESSAGE
USE DFWIN
INTEGER*4 myHWND, MSG, LPARAM, WPARAM,lreturn
Character*15 lstring
DATA lstring/'This is a test'C/
MSG=WM_USER+1
LPARAM=LOC(lstring)
WPARAM=0
lreturn = SendMessage(myHWND,MSG,WPARAM,LPARAM)
lreturn = UpdateWindow(myHWND)
mymessage = lreturn
RETURN
END FUNCTION MYMESSAGE
Thank you
Integer*4 Function MYMESSAGE(myHWND)
CDEC$ ATTRIBUTES DLLEXPORT :: MYMESSAGE
CDEC$ ATTRIBUTES ALIAS: 'MYMESSAGEA' :: MYMESSAGE
USE DFWIN
INTEGER*4 myHWND, MSG, LPARAM, WPARAM,lreturn
Character*15 lstring
DATA lstring/'This is a test'C/
MSG=WM_USER+1
LPARAM=LOC(lstring)
WPARAM=0
lreturn = SendMessage(myHWND,MSG,WPARAM,LPARAM)
lreturn = UpdateWindow(myHWND)
mymessage = lreturn
RETURN
END FUNCTION MYMESSAGE
Thank you
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This is what you need:
For more info see http://msdn.microsoft.com/library/psdk/shellcc/commctls/Status/Messages/SB_SETTEXT.htm.
Oh, and since I had trouble finding it, SB_SIMPLEID is
hth,
John
This is what you need:
lreturn = SendMessage(myHWND, SB_SETTEXT, SB_SIMPLEID, LPARAM)
For more info see http://msdn.microsoft.com/library/psdk/shellcc/commctls/Status/Messages/SB_SETTEXT.htm.
Oh, and since I had trouble finding it, SB_SIMPLEID is
integer, parameter :: SB_SIMPLEID = z'FF'
hth,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Thank you for your response. I was still unsuccessful. Since I have been able to do actions that happen immediately (e.g., SB_SIMPLE, PBM_SETBKCOLOR) but text and the progress bar doesn't appear, I've come to the realization that the problem has to do with the controls not repainting.
I've been able to accomplish what I needed through the use of callbacks passed to the DLL.
Thanks again for your help
Thank you for your response. I was still unsuccessful. Since I have been able to do actions that happen immediately (e.g., SB_SIMPLE, PBM_SETBKCOLOR) but text and the progress bar doesn't appear, I've come to the realization that the problem has to do with the controls not repainting.
I've been able to accomplish what I needed through the use of callbacks passed to the DLL.
Thanks again for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It worked for me in a test. Oh well, glad you have what you needed to get done. :-)
-John
It worked for me in a test. Oh well, glad you have what you needed to get done. :-)
-John

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