WinPack DDE connect/connectList function - or alternative way to find this information

27 views
Skip to first unread message

adrayb

unread,
Jun 17, 2013, 1:14:55 PM6/17/13
to jniwrapp...@teamdev.com
Hello there - We are a purchased customer running jniwrapper-3.8.4.
 
I have been tasked with migrating a legacy application over to use JNIWrapper specifically (in this case) with respect to the DDE Client functionality. Everything has been going well but I've hit on one remaining function that I cannot find an easy answer to.
 
I can see where the DdeClient.connect method can be used with an instance specific service name. The problem is how to determine what instance specific service names are available. If I just use the basic name, I get one instance of the application (Excel for example) but if the user is running 2 workbooks I cant find a way to determine the second instance name.
 
The older DDE system I'm converting from used the "DdeConnectList" function but WinPack does not seem to support that. Am I going to have to do the primitive function handling like I see in "DdeClientHelper" ?
 
Any pointers or assistance would be much appreciated,
 
Sincerely,
 
Adrian

Anna Dolbina

unread,
Jun 19, 2013, 7:31:17 AM6/19/13
to adrayb, jniwrapp...@teamdev.com
Hi Adrian,

The current implementation of DDE wrapping functionality from WinPack doesn't contain the wrapper for DdeConnectList function. If you need to use the DdeConnectList Windows API function, you can add a wrapper for this native function to the DdeClientHelper class by yourself, and use it in the DdeClient class.

To see an example of a wrapper, you can take a look at the wrapper for the DdeConnect function in DdeClientHelper class. These two functions, DdeConnect and DdeConnectList, have similar signatures, and their wrappers will also be similar.

After the function call, a return value will contain a handle to the conversation list. To iterate the list and retrieve the information about the DDE conversation, you also need to create a wrapper for the DdeQueryNextServer function, DdeQueryConvInfo function and CONVINFO structure. The details of creating wrappers for structures can be found in JNIWrapper Tutorial and JNIWrapper Programmer's Guide.

Please let us know if you have any further questions.

Sincerely,
Anna




--
You received this message because you are subscribed to the Google Groups "JNIWrapper Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jniwrapper-for...@teamdev.com.
To post to this group, send email to jniwrapp...@teamdev.com.
Visit this group at http://groups.google.com/a/teamdev.com/group/jniwrapper-forum/.
For more options, visit https://groups.google.com/a/teamdev.com/groups/opt_out.
 
 

adrayb

unread,
Jun 19, 2013, 1:47:05 PM6/19/13
to jniwrapp...@teamdev.com, adrayb
Anna,
 
Thanks for that, yes, that is what I am currently working through.
 
One thing that is proving to be a pain is that all your helper classes (DdeClientHelper, DdeFunctions and DdeCallback for example) are all package-private. This means that it is not easy for me to extend these classes with my own class (MyDdeClientHelperExtension extends DdeClientHelper for example).
 
I'll post some more when I have some success or if I hit any more problems. Wrapping and handling the CONVLIST and CONV handles seems like it is going to be interesting. We shall see.
 
Thanks,
 
Adrian

adrayb

unread,
Jun 20, 2013, 9:07:44 AM6/20/13
to jniwrapp...@teamdev.com, adrayb
Ok, got it working finally.
 
Was a pain but used introspection to gain access to ddeInitialize, createStringHandle, freeStringHandle, freeDataHandle and getData. Then I had to write the DdeConnectList, DdeQueryNextServer, (I wrote DdeGetFromConnection) and then DdeDisconnectList.
 
Attached partial source code as an example for anyone else that might have to do this in the future (or you might want to just include the functionality in the next JNI-Wrapper release).
 
Cheers.
ddeConnectListExampleJava.txt
Reply all
Reply to author
Forward
0 new messages