Jump to content

DDE command too short ?


Recommended Posts

hi,

I tried using SampleDDEserver.au3 UDF. although I am able to connect to it, when sending commands to it, it only shows the first letter of the command but

not the rest. where can I modify it to be able to recieve a string ? I tried to look into DDEMLSERVER and DDEML but I didn't understand the corollation done

there to the main script. I really appritiate a Moderator help here, or the person who wrote DDE UDF.

Look at the attached JPEG. it shows the problem. I tries to send "99999" and only one 9 is recived.

Link to comment
Share on other sites

hi,

I tried using SampleDDEserver.au3 UDF. although I am able to connect to it, when sending commands to it, it only shows the first letter of the command but

not the rest. where can I modify it to be able to recieve a string ? I tried to look into DDEMLSERVER and DDEML but I didn't understand the corollation done

there to the main script. I really appritiate a Moderator help here, or the person who wrote DDE UDF.

Look at the attached JPEG. it shows the problem. I tries to send "99999" and only one 9 is recived.

The problem you encounter here is that your DDE client sends UNICODE strings but the server expects ASCII, thus command is truncated by the first 0 character. In order to simplify the API DDEML UDF was built with an automatic UNICODE detection: if @Unicode macro returns true it assumes command strings in _DdeCallback($XTYP_EXECUTE) to be of $CF_UNICODETEXT otherwise $CF_TEXT, which works for most client-server couples.

Just ensure your server script is executed by Au3Info.exe (not Au3InfoA.exe) or in case of compiled scripts that the appropriate UNICODE stub is included in your EXE.

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

The problem you encounter here is that your DDE client sends UNICODE strings but the server expects ASCII, thus command is truncated by the first 0 character. In order to simplify the API DDEML UDF was built with an automatic UNICODE detection: if @Unicode macro returns true it assumes command strings in _DdeCallback($XTYP_EXECUTE) to be of $CF_UNICODETEXT otherwise $CF_TEXT, which works for most client-server couples.

Just ensure your server script is executed by Au3Info.exe (not Au3InfoA.exe) or in case of compiled scripts that the appropriate UNICODE stub is included in your EXE.

Hi, the client I am using is a program developed by Avaya. I don't think it sends unicode but it is a good assumption, how can I solve it via the DDEML udf ?

where in the script I can insert a msgbox showing what the server is getting in the first place?

Link to comment
Share on other sites

Hi, the client I am using is a program developed by Avaya. I don't think it sends unicode but it is a good assumption, how can I solve it via the DDEML udf ?

Please, read my first answer carefully, it contains the solution.

where in the script I can insert a msgbox showing what the server is getting in the first place?

If you want to see (or handle) raw data from a DDE conversation you will have to implement your own UDF lib or at least reimplement _DdeCallback(). The goal of DDEML UDF is in first line to spare the developer fiddling with just those details.

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

Please, read my first answer carefully, it contains the solution.

If you want to see (or handle) raw data from a DDE conversation you will have to implement your own UDF lib or at least reimplement _DdeCallback(). The goal of DDEML UDF is in first line to spare the developer fiddling with just those details.

I'v tried changing all

If @Unicode Then $wFmt = $CF_UNICODETEXT to $CF_TEXT it solved half of it. I now get to see the Topic... but the command itself is still truncated.

I am not a developer, so this is how I tried changing the Unicode stuff, I'v attached another screen shot of what I see now instead of before...

I really apritiate your help with this one.

Thanks,

Link to comment
Share on other sites

If @Unicode Then $wFmt = $CF_UNICODETEXT to $CF_TEXT it solved half of it. I now get to see the Topic... but the command itself is still truncated.

Well, this is because it is NOT the solution: if you do that you just break the UNICODE handling all together.

As said: you have to ensure both - client and server - run with the same character encoding either UNICODE or ASCII. As long as the @Unicode macro is false in your server it will never understand the client sending UNICODE to it, so execute the script in the right AutoIt interpreter.

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

Well, this is because it is NOT the solution: if you do that you just break the UNICODE handling all together.

As said: you have to ensure both - client and server - run with the same character encoding either UNICODE or ASCII. As long as the @Unicode macro is false in your server it will never understand the client sending UNICODE to it, so execute the script in the right AutoIt interpreter.

so execute the script in the right AutoIt interpreter

[/qoute]

where do I change that?

Link to comment
Share on other sites

where do I change that?

S. AutoIt online help Using AutoIt/Unicode Support and Using AutoIt/Compiling Scripts

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

where do I change that?

S. AutoIt online help Using AutoIt/Unicode Support and Using AutoIt/Compiling Scripts

OK solved using AutoIt3A.exe instead of AutoIt3.exe...

ThankyouVeryMuch......

works works works works works!~!!!!!!!!!!!!!!!!!!!!!!!!!!!! it was ANSI....

attached screen shot.

Edited by erezlevi
Link to comment
Share on other sites

ThankyouVeryMuch......

works works works works works!~!!!!!!!!!!!!!!!!!!!!!!!!!!!! it was ANSI....

It's a pleasure :)

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...