Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Visual Fox Pro v5.0 as DDE Server
Message
From
02/09/1999 01:28:52
 
 
To
01/09/1999 15:36:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00260306
Message ID:
00260476
Views:
13
>Could somebody point me in the right direction for setting up Visual Fox Pro as a DDE Server. I am trying to access a fox pro database from a third-party windows program as the client using DDE functions.


* DDE SERVER

=DDESetService('MYSRV', 'DEFINE')
=DDESetService('MYSRV', 'POKE',.T.)
=DDESetService('MYSRV', 'ADVISE',.T.)
=DDESetService('MYSRV', 'REQUEST',.T.)
=DDESetTopic('MYSRV', 'REQU','clireq') && name of function to call

DO FORM MYSRV
READ EVENTS
* mysrv is a simple form with a quit button

=DDESetService('RELAYSRV', 'RELEASE') && when form is released
CANCEL

*********************************************************
*Processes client requests

FUNCTION clireq

PARAMETER ichannel,saction,sitem,sdata,sformat,istatus

PRIVATE LIKE l_*
l_return=.T.


*Turn off DDE while processing

=DDEENABLED(ichannel,.F.)



*Decide what action to take

DO CASE

*Process a INITIATE
CASE saction='INITIATE'
l_return=.T.

*Process a TERMINATE
CASE saction='TERMINATE'
mysrv.release && release the form

*Process a POKE
CASE saction='POKE'
** put code here to poke

*Process a REQUEST
CASE saction='REQUEST'
*** code here to process a request

ENDCASE

*Turn ON DDE again
=DDEENABLED(ichannel,.T.)

RETURN

Of course there is more to DDE than setting up a server. ADVISE must be called and passed a function name that it will run in the client application when it gets updated data etc.

Hope this Helps

Bernard
Previous
Reply
Map
View

Click here to load this message in the networking platform