[comp.windows.ms.programmer] Task/Window Dispatch question: a technical challange

kend@data.UUCP (Ken Dickey) (05/04/91)

Greetings.  I have an interesting problem.  I am designing a fairly
large Windows application which will consist of a number of tasks
("applications").  I have written a DDE library which implements an
asynchronous protocol {standard Windows dispatch-loop stuff}.  

My problem is that my "clients" (er, the guys I work with--same company)
want a *synchronous* protocol.  They want to have the request-reply
totally hidden within a single procedure call.

Now my model of Windows has all windows within an "application" (task)
sharing the same stack.  If I "block" by doing a GetMessage() within
the library (and throwing out interesting messages not to me), then
either I lock up the entire task (all its windows), or I take only
messages for 'my' hidden DDE Port window and run the risk of violating
the LIFO stack requirement  (window 1 blocks, then window 2 blocks,
then window 1 wakes up then ...Ka BOOM!).

The Windows testing I have done and the (poor) SDK documentation lead
me to believe that I can't reasonably "follow the synchronous model".

My question is "Is there someone out there with an idea on how to
present a synchronous model to a Windows application which really uses
DDEs?".


Thanks,
-Ken Dickey					kend@data.uucp

curt@cctb.wa.com (Curt Johnson) (05/08/91)

In article <487@data.UUCP> kend@data.UUCP (Ken Dickey) writes:
| Greetings.  I have an interesting problem.  I am designing a fairly
| large Windows application which will consist of a number of tasks
| ("applications").  I have written a DDE library which implements an
| asynchronous protocol {standard Windows dispatch-loop stuff}.  
| 
| My problem is that my "clients" (er, the guys I work with--same company)
| want a *synchronous* protocol.  They want to have the request-reply
| totally hidden within a single procedure call.
| 
| Now my model of Windows has all windows within an "application" (task)
| sharing the same stack.  If I "block" by doing a GetMessage() within
| the library (and throwing out interesting messages not to me), then
| either I lock up the entire task (all its windows), or I take only
| messages for 'my' hidden DDE Port window and run the risk of violating
| the LIFO stack requirement  (window 1 blocks, then window 2 blocks,
| then window 1 wakes up then ...Ka BOOM!).
| 
| The Windows testing I have done and the (poor) SDK documentation lead
| me to believe that I can't reasonably "follow the synchronous model".
| 
| My question is "Is there someone out there with an idea on how to
| present a synchronous model to a Windows application which really uses
| DDEs?".

As DDE is defined, I don't think you can do it.

However, you can define you own data exchange mechanism using SendMessage,
which directly calls the destination hWnd's WndProc, the value returned
from the WndProc becomes the return value from SendMessage.

Send me mail if you have questions (I can't guarantee that I'll be able
to answer them...).


Curt Johnson == curt@cctb.wa.com