Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DDE Commands with FoxPro as the client
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00390283
Message ID:
00390993
Vues:
8
OK, it has been a while since I used (very little) dde. Here is some old code that may help. In this code, the DDErequest results in a ddepoke on the server.
DDE Client
Like:
if AppHand<>0
iChannel = DDEinitiate("YOURAPP","DO")
result='UNABLE TO COMMUNICATE WITH APP!'
IF iChannel > -1

IF DDEexecute(iChannel,Comm_Msg)
Result = DDErequest(iChannel,"Return_Str")
ELSE
Result = 'ERROR: '+ DDELEText(DDELastError())
ENDIF
= DDEterminate(iChannel)
ENDIF
if empty(result)
result = "YOURAPP DID NOT RESPOND!"
endif
return result
else
wait "YOURAPP not responding." window nowait
return 'F'
endif


DDE Server
Like:
*** Set Visual FoxPro up as a DDE server ***
= DDESetService('YOURAPP', 'DEFINE')
= DDESetService('YOURAPP', 'EXECUTE', .T.)
= DDESetService('YOURAPP', 'REQUEST', .T.)
= DDESetTopic('YOURAPP', 'DO', 'DOTOPIC')
mDDE_Response = ""
mTestData = "Hello"
Then create a procedure named (in this case) DOTOPIC
There are some class properties here I won't get into since I think you are more concerned with the client part. I just put this here to show where the ddepoke is.
Like:
*************************************
PROCEDURE dotopic
*************************************
PARAMETERS gnChannel, gcAction, gcItem, gData, gcFormat, gnAdvise
glResult = .F.
*** It's necessary to return .T. from an ***
*** INITIATE action or no connection is made ***
IF gcAction = 'INITIATE'
glResult = .T.
ENDIF
IF gcAction = 'EXECUTE'
YOURAPP.DDE_Result=""
&gData
glResult = .T.
ENDIF
if gcAction = 'REQUEST'
do case
case type('YOURAPP.DDE_Result') = "L"
YOURAPP.DDE_Result = iif( YOURAPP.DDE_Result,"T","F")
endcase
=ddePoke(gnChannel, gcItem, YOURAPP.DDE_Result)
glResult = .t.
endif
IF gcAction = 'TERMINATE'
glResult = .T.
ENDIF
RETURN glResult


>I am communicating between a 4jes application and Visual Foxpro application using DDE commands. Visual Foxpro is the client and I need to send data from the 4jes application to Visual Foxpro using DDEPOKE() function in 4jes. I am having problems in pasting the data to Visual Foxpro because I am missing a specific format that Foxpro needs to receive the data as a client.
>
>Please help...
>
>Thanks,
>
>Ruby
Bill Mittenzwey
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform