Microsoft KB Archive/105005: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - "&" to "&")
 
(3 intermediate revisions by the same user not shown)
Line 46: Line 46:
== SYMPTOMS ==
== SYMPTOMS ==


In FoxPro for Windows the DDEInitiate() function may result in getting an undesirable &quot;? Remote data not accessible. Start application '&lt;appname&gt;.EXE'?&quot; dialog box.<br />
In FoxPro for Windows the DDEInitiate() function may result in getting an undesirable "? Remote data not accessible. Start application '<appname>.EXE'?" dialog box.<br />
<br />
<br />
Code following the DDEInitiate() function may check for the return of -1, which indicates that the channel was not established; however, the code is not yet executed.
Code following the DDEInitiate() function may check for the return of -1, which indicates that the channel was not established; however, the code is not yet executed.
Line 65: Line 65:
<br />
<br />
For example, the following code establishes a DDE channel between Microsoft FoxPro for Windows and Microsoft Excel, even if Microsoft Excel is not presently minimized in the Windows background, without receiving the dialog box message mentioned above:
For example, the following code establishes a DDE channel between Microsoft FoxPro for Windows and Microsoft Excel, even if Microsoft Excel is not presently minimized in the Windows background, without receiving the dialog box message mentioned above:
<pre class="codesample">  =DDESetOption(&quot;SAFETY&quot;,.F.)
<pre class="codesample">  =DDESetOption("SAFETY",.F.)
   DO WHILE .T.
   DO WHILE .T.
       =DDESetOption(&quot;TimeOut&quot;,10000)
       =DDESetOption("TimeOut",10000)
       iChannel=DDEInitiate(&quot;Excel&quot;,&quot;System&quot;)
       iChannel=DDEInitiate("Excel","System")
       =DDESetOption(&quot;TimeOut&quot;,2000)
       =DDESetOption("TimeOut",2000)
       IF iChannel !=-1  &amp;&amp; If Excel is started, exit loop
       IF iChannel !=-1  && If Excel is started, exit loop
         EXIT
         EXIT
       ELSE            &amp;&amp; Start Excel &amp; try to get channel
       ELSE            && Start Excel & try to get channel
         RUN /N3 d:\msoffice\excel\excel.exe  &amp;&amp; Change this line
         RUN /N3 d:\msoffice\excel\excel.exe  && Change this line
                                       &amp;&amp; according to your path to Excel.
                                       && according to your path to Excel.
       ENDIF
       ENDIF
   ENDDO
   ENDDO
Line 84: Line 84:
== REFERENCES ==
== REFERENCES ==


&quot;Language Reference,&quot; version 2.5, pages L3-366, L3-374
"Language Reference," version 2.5, pages L3-366, L3-374


</div>
</div>

Latest revision as of 11:24, 21 July 2020

Knowledge Base


PRB: DDEInitiate() Gives Remote Data Not Accessible Dialog Box

Article ID: 105005

Article Last Modified on 11/17/2003



APPLIES TO

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft FoxPro 2.5b
  • Microsoft FoxPro 2.5a



This article was previously published under Q105005

SYMPTOMS

In FoxPro for Windows the DDEInitiate() function may result in getting an undesirable "? Remote data not accessible. Start application '<appname>.EXE'?" dialog box.

Code following the DDEInitiate() function may check for the return of -1, which indicates that the channel was not established; however, the code is not yet executed.

CAUSE

The default setting for the Safety clause of the DDESetOption() function is true (.T.). This setting specifies whether a dialog box is displayed when the DDEInitiate() function is used to establish a channel to a server application and the application is not currently open.

RESOLUTION

Issue the DDESetOption() function prior to the DDEInitiate() function to change the setting for Safety to false (.F.).

For example, the following code establishes a DDE channel between Microsoft FoxPro for Windows and Microsoft Excel, even if Microsoft Excel is not presently minimized in the Windows background, without receiving the dialog box message mentioned above:

   =DDESetOption("SAFETY",.F.)
   DO WHILE .T.
      =DDESetOption("TimeOut",10000)
      iChannel=DDEInitiate("Excel","System")
      =DDESetOption("TimeOut",2000)
      IF iChannel !=-1   && If Excel is started, exit loop
         EXIT
      ELSE             && Start Excel & try to get channel
         RUN /N3 d:\msoffice\excel\excel.exe   && Change this line
                                      && according to your path to Excel.
      ENDIF
   ENDDO
                

REFERENCES

"Language Reference," version 2.5, pages L3-366, L3-374

Keywords: kbprb KB105005