|
bozo65 Beginner
Joined: 27 Feb 2005 Posts: 11
|
Posted: Sun Mar 13, 2005 10:25 am
Visual Basic DDE and ZMud |
Hi,
I've switched using the built in database to one using ADO and now need to send a variable from ZMud to a Visual Basic application (myapp.exe) that will display an item from the database on the form.
Ive decided to use DDE but I cant get the exchange to work.
In Zmud Ive added the following in appropriate triggers.
#NOOP %ddepoke( myapp, Mobname, @rs("Name").value)
In the VB app in the Form_Load event
Text1.LinkMode = 0
Text1.LinkTopic = "Zmud|Mobname"
Text1.LinkItem = "Mobname" ' Whats this about?.
Text1.LinkMode = 1 ' Set LinkMode to Automatic.
VB always complains no Foreign application responded to a DDE Initialize event.
Anybody actually got DDE communicating with a VB application by passing strings? |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Mon Mar 14, 2005 5:28 pm |
<opinion>DDE seems to be a great pain to implement.</opinion>
looking at what you posted you're using ddepoke to try to send some info
to your application which means your application is the DDE server.
But in the VB code it almost looks like you're setting up the Text control
to be a DDE client or destination control.
If the Text control is supposed to be a client to zmud then the LinkTopic should be "zmud|zmud" and the LinkItem should be "data" that at least is what a garner from the zmud help for #DDE
Quote: |
...zMUD also acts as its own DDE server. The server name is zmud, the topic name is also zmud, and the only defined item name is data. |
If you're trying to setup your app as a server then the Text1 item doesnt need to have anything set as far as DDE is concerned.
The Form however as to have its LinkMode set be a source, and you set the LinkTopic of the Form to the topic name you want to use.
The item for the source application is the name of the control in the form.
Anyways thats just what I got from poking around on the msdn site.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbprolinktopic.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;189498
Anyways, good luck with that, although you might consider using COM
to get Zmud and your application to communicate, I think it would probably be easier to setup
p.s in the #DDE help it shows %ddepoke using 4 arguments
%ddepoke(server,topic,item,value)
but in the help for %ddepoke it shows 3 arguments
with the first 2 being optional if a dde connection was is already opened
with %ddeopen
%ddepoke([serv],[topic],s) |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
bozo65 Beginner
Joined: 27 Feb 2005 Posts: 11
|
Posted: Mon Mar 14, 2005 8:25 pm |
Thanks for that.
I need to find out more about the VB DDE interface the MSDN documenation is'nt in depth enough.
Acuually the DDE interface has 4 main messages
WM_DDE_INITIATE
WM_DDE_ACK
WM_DDE_ADVISE
WM_DDE-DATA
WM_DDE_POKE
WM_DDE_REQUEST
WM_DDE_UNADVISE
WM_DDE_TERMINATE
The Client starts the exchange with a WM_DDE_INITIATE the server needs to respond with WM_DDE_ACK, the exchange proper can then take place unitl the Client sends a WM_DDE_TERMINATE and the server responds with a WM_DDE_TERMINATE.
How this fits in with this VB linktopic linkmode etc god only knows the documentation is pathetic!
I tested the theory out by using the clipboard and a timer and got ZMud to use %clip to styick the mobname in the VB applicaton then checks the clipboard isnt empty in a timer and if its not lookus up the mob name in the table works fine apart from the fact i need to use the clipboard to paste the Mob description and other fields from ZMud too
As you say I might attempt to write an ActiveX control to do the job. Thanks for the input anyway. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|