- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone dust off their DDE code to help solve a problem?
I cannot seem to get a WM_DDE_ACK message from another application after successfully intitiating DDE. I have used DDE Spy and Spy++ and can see the WM_DDE_INIT messages and the ACK response from the other app. My QuickWin app sleeps during GetMessage and fails to see the WM_DDE_ACK with PeekMessage. Any suggestions? Code is listed below. Thanks alot!
program dde_qq
use DFLIB
use DFWIN
use DFWIN
implicit none
integer(2) aApp
integer(2) aTopic
integer(LRESULT) init
integer(LONG_PTR) lparam
type (T_MSG) mesg
integer(HANDLE) hwnd_ees
integer(HANDLE) hwnd
integer(USHORT) temp
integer(UINT) retval
integer(BOOL) success
hwnd=GetHWndQQ(QWIN$FRAMEWINDOW)
aApp=GlobalAddAtom('ees'C)
aTopic=GlobalAddAtom(''C)
lparam = MAKELONG(aApp,aTopic)
integer(2) aApp
integer(2) aTopic
integer(LRESULT) init
integer(LONG_PTR) lparam
type (T_MSG) mesg
integer(HANDLE) hwnd_ees
integer(HANDLE) hwnd
integer(USHORT) temp
integer(UINT) retval
integer(BOOL) success
hwnd=GetHWndQQ(QWIN$FRAMEWINDOW)
aApp=GlobalAddAtom('ees'C)
aTopic=GlobalAddAtom(''C)
lparam = MAKELONG(aApp,aTopic)
init=SendMessage (-1,WM_DDE_INITIATE,hwnd,lparam)
do while (PeekMessage
(mesg,hwnd,WM_DDE_ACK,WM_DDE_ACK,PM_REMOVE) .NE. .TRUE.)
enddo
hwnd_ees=mesg%wparam
enddo
hwnd_ees=mesg%wparam
temp=GlobalDeleteAtom(aApp)
temp=GlobalDeleteAtom(aTopic)
temp=GlobalDeleteAtom(aTopic)
end program dde_qq
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without going deeper into code, I can tell you that fundamental reason why it won't work is that it's a QuickWin program, and you're working from the wrong thread. QW has two threads,primary, which creates the windows, runs message loop and the callback, andsecondary, which runs the PROGRAM. OTOH, PeekMessage can retrieve only messagessent towindows created by the same thread.
So, if you recompile the code as console or win32 application, it should work (modulo other possible errors I didn't look into). If you have to use QuickWin for other reasons, you have to subclass the frame window and catch WM_DDE_ACK from subclassed procedure (see POKER CVF Sample or QWToolbar sample on my home page).
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear carowjp, I can see that you were trying to make a FORTRAN code comunicate with EES. Did you finally manage to do so? I am also doing that same but i am having a lot of trouble. It would be really nice if you could give some suggestions.
Thanks for your help.
Leonardo
Thanks for your help.
Leonardo

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