Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 20 SEP 2002 03:51:17PM John Bouley wrote:

Hello,

We are in the midst of converting a OI16 app to OI32. So far the only showstopper has been the DDE interface. On 4.1 it just locked however, on 4.11 it works!!! Maybe this is nit-picking, but my application is returning error messages when making the DDE calls.

Error 16393, 16394.

It appears to be occuring with the following code:

STATUS=SET_PROPERTY(DDE_INFO,'DDEITEM', BookMark) ;* Range to get

s_Error=Get_Property( DDE_INFO, "DDEERROR" )


At 20 SEP 2002 06:11PM Pat McNerthney wrote:

John,

1.  Did you not get these DDEERRORs in OI16?
2.  Are you able to check if 4.0 returns the DDEERRORs?
2.  Do you still get these DDEERRORs in 4.1.1 when you invoke OpenInsight with the /ANSI switch?

Pat


At 20 SEP 2002 11:43PM Richard Bright wrote:

John,

If you havnt already located them, the error codes are

* DDEERROR Equates in decimal

Equ DMLERR_BUSY$ to 16385

Equ DMLERR_DATAACKTIMEOUT$ to 16386

Equ DMLERR_DLL_NOT_INITIALIZED$ to 16387

Equ DMLERR_DLL_USAGE$ to 16388

Equ DMLERR_EXECACKTIMEOUT$ to 16389

Equ DMLERR_INVALIDPARAMETER$ to 16390

Equ DMLERR_LOW_MEMORY$ to 16391

Equ DMLERR_MEMORY_ERROR$ to 16392

Equ DMLERR_NOTPROCESSED$ to 16393

Equ DMLERR_NO_CONV_ESTABLISHED$ to 16394

Equ DMLERR_POKEACKTIMEOUT$ to 16395

Equ DMLERR_POSTMSG_FAILED$ to 16396

Equ DMLERR_REENTRANCY$ to 16397

Equ DMLERR_SERVER_DIED$ to 16398

Equ DMLERR_SYS_ERROR$ to 16399

I note that it is possible to turn off error code reporting in Excel, Word if it upsets macros viz

x =Set_Property( DDE_Parent,'DDECOMMAND', 'error(false)' )

Richard Bright


At 21 SEP 2002 12:12AM Richard Bright wrote:

Pat,

On a WinXP platform, OfficeXP, the /ANSI switch does not impact on the generation of error code.

Richard Bright


At 22 SEP 2002 08:50PM Bob Watson wrote:

Pat

without the ANSI switch I get error 16389 - DMLERR_EXECACKTIMEOUT$

with the ANSI switch I get error 16393 - DMLERR_NOTPROCESSED$

running on NT workstation

Bob Watson


At 24 SEP 2002 09:01AM John Bouley wrote:

Hi Pat,

I did not receive these errors in OI 3.7.5.

When I tried the DDE in 4.0 it simply locked my workstation.

When I try the /ANSI switch in 4.11 it seems to cause more errors??

I received 16390, 16394, 16393. Although, if I run it multiple times Word will load faster and the 16390 error goes away.

I am loading Word with "ShellExecute". I created a DLL_SHELL32 with the appropriate call to ShellExecuteA function.

My workstation is NT 4.0 SP6a.

Hope this helps,

John


At 24 SEP 2002 02:41PM John Bouley wrote:

Pat,

Here is more detailed info about what is failing.

Error Statement

16390 Call Set_Property(DDE_Info,'DDETOPIC','')

16393 Call Set_Property(DDE_Info,'DDELINK','HOT')

16393 Call Set_Property(DDE_Info,'DDELINK','OFF')

I was able to get around one problem by placing my code in a loop until the window address for Word could be found. It appears that ShellExecuteA does not wait until the task is complete.

HTH,

John


At 24 SEP 2002 03:40PM Pat McNerthney wrote:

John,

Something you need to keep in mind in this brave new world of Win32 is that executables now execute asynchronously, as opposed to the cooperative tasking of Win16.  This is why the spawning other executables behaves differently in the two environments.
I suspect this is also causing different behavior in other areas related to DDE.  For example, I noticed that when we send a DDE command via the DdeClientTransaction API, it is currently coded with a timeout value of 1 second.  I can imagine in Win16 that even with such a timeout value, that the other executable in fact completes the request before it "yields" back to OI, whereas in Win32 if the timout occurs it returns immediately.
I tried to reproduce the errors you describe but did not.  I believe I need the entire context of when those calls are being made.  If you could post an entire code fragment that reproduces the problems you are experiencing, I'll see if I can at least explain away why the errors are occuring!

Pat


At 24 SEP 2002 04:16PM G Van Niekerk wrote:

John,

We also added a delay(5) command while trying to start Word etc.

This seem to have solved the problem. (The same as your loop)

Without that we found that by the time word was loaded sometimes the first few lines we sent did not appear.

Gerry van Niekerk

Csoft


At 24 SEP 2002 04:33PM John Bouley wrote:

Pat,

Thanks for the info, I kind of thought that was the case.

Here is the code. I modified the start of Word to include a wait loop. This seems to have helped somewhat.


BeginSess:

If JK=1 and B_IsWord=0 Then

  • first time logic if Word is not loaded yet.
 If Version ] "3.7.2" Then
    x=NSS_RunWin("winword")   ;* uses shellexecutea
    WaitCnt=0
    loop
       Hwnd=FindWindow("OpusApp":\00\,0)
    Until Hwnd  0 or WaitCnt ] 10
       Call Delay(1) ; WaitCnt += 1
    Repeat
 End Else   
    X=REPOSITORY('EXECUTE', @APPID:'*WINEXE**WINWORD',"")
 End   

End

If Not(Preview) Then

 Call Set_Property( 'SYSTEM', 'FOCUS', Parent )

End

Call SET_PROPERTY( DDE_INFO, 'DDETOPIC', "" )

s_Error=Get_Property( DDE_INFO, "DDEERROR" )

If s_Error Then

debug

x=Msg(Parent,'Possible DDE Error: TOPIC: ':s_Error:@fm:'T1')

End

Call SET_PROPERTY( DDE_INFO, 'DDESERVICE','WINWORD') ;* Server Name

s_Error=Get_Property( DDE_INFO, "DDEERROR" )

If s_Error Then

  debug
  x=Msg(Parent,'Possible DDE Error: SERVICE: ':s_Error:@fm:'T1' )

End

x=Set_Property(DDE_INFO,"DDECOMMAND","FileOpen(":Quote(FileName):")")

s_Error=Get_Property( DDE_INFO, "DDEERROR" )

If S_Error Then

  debug
   x=Msg(Parent,'Possible DDE Error: DDECOMAND: ':s_Error:@FM:'T1')

End

Call SET_PROPERTY( DDE_INFO, 'DDETOPIC', filename )

s_Error=Get_Property( DDE_INFO, "DDEERROR" )

If s_Error Then

 debug
x=Msg(Parent,'Possible DDE Error: TOPIC: ':s_Error:@fm:'T1')

End

Call SET_PROPERTY( DDE_INFO, 'DDELINK','HOT') ;* Type of Link

s_Error=Get_Property( DDE_INFO, "DDEERROR" )

If s_Error Then

 debug
x=Msg(Parent,'Possible DDE Error: LINK: ':s_Error:@fm:'T1' )

End

Return


Thanks,

John Bouley


At 24 SEP 2002 06:08PM Pat McNerthney wrote:

John,

I believe some of the errors you were getting are remanent errors from prior DDE api calls and not errors related to the significant DDE call being made during the Set_Property process.
So I tweaked the code to clear the last DDE error before making the DDE call that is relavent to the call in progress.  Hopefully, now at least if an error is returned, it in fact relates to the call in progress.
Let me know how the error reporting works for you in the next version.  I suspect you will still get errors that you did not in Win16, but that now the errors will actually be meaningful.

Pat

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/9e0f44c1e211590f85256c3a006d10d5.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1