Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tkwindde within Ruby

Status
Not open for further replies.

frdsa

Technical User
Jan 15, 2008
3
US
Hi:

I am using Tkwindde within Ruby and having some problems.
I call a application/service called TOS.

My call to TKwindde is
tk_call("DDE", "REQUEST", "TOS", "MARK", datafield)
sometimes I get my data in, sometimes I get first N/A returned.
If I run the dde call in excel I see the N/A coming in first with is later substituted for the correct value.

It seems the way I am using tkwindde; my tk_call doesnot wait long enough for the full answer.

I have been looking for call_backs and other solutions; but so far no result.

When I run my dde command in a excel environment and use a dde trace. I see Excel making more 'async' call to my TOS application.

Any help appreciated.!

Ernst
 
It seems I am the last person using DDE.
I tried Ruby-forum for this post; no reaction for over a week.

I am stuck and have no alternative. My data vendor only allows DDE as a method to access the data.

- Who wrote the TKWinDDe; is there still a project team around?
- Is this the right forum for this question?
 
It may very well be the right forum but that doesn't mean anyone here is any more knowledgeable than you on this issue. I have never used Ruby; I've never heard of tkwindde; and, while I've used DDE, I haven't used it in Tcl.

Tcl includes a DDE utility:
Tcl help said:
NAME
dde - Execute a Dynamic Data Exchange command
SYNOPSIS
package require dde 1.2
dde servername ?topic?
dde execute ?-async? service topic ?data?
dde poke service topic item data
dde request ?-binary? service topic ?data?
dde services service topic ?data?
dde eval ?-async? service topic ?data?
DESCRIPTION
DDE COMMANDS
dde servername ?topic?
dde execute ?-async? service topic data
dde poke service topic item data
dde request ?-binary? service topic item
dde services service topic
dde eval ?-async? topic cmd ?arg arg ...?
DDE AND TCL

If you're running a script from the Tcl shell, you can use that. If you're running Ruby, I don't know.

_________________
Bob Rashkin
 
Thanks Bob; for your reply.

TkWinDDe is include in the ruby TK package.
and handles the command as you describes them.
The problem is this is a very limited subset of DDE commands possible.
As I found out on the website quote below; you can set the time which the dderequest command waits for the server to answer. I am under the impression that my 'request' is timed-out (often, but not always).
I tried to add the command 'setoption' to the TK lib; so far not successful.



DDE Functions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top