<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Sending files from other applications

Our software has a built-in DDE server. You can use this server to transfer files from other applications.

 

The following Windows registry entry can help you to detect a DNC Precision location:

 

SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DNC Precision_is1,

Value: Inno Setup: App Path

 

The following Windows registry entry can help you to detect configured machines:

 

SOFTWARE\AGG Software\DNC Precision\Machines

 

You can search a running instance of DNC Precision by the class name

"TfrmDNCPrecise" (w/o quotes).

 

The following code allows you to detect, that application is started, all settings were loaded and program is initialized.

 

DNCP_IsStarted_Message = WM_USER+0x313;

SendMessageTimeout(windowHandle, DNCP_IsStarted_Message, 0, 0, SMTO_NORMAL, 300, msg_res);

 

Result: msg_res>0 - if all is ok.

 

DDE interface

 

DDE server parameters:

 

Service: dncprecise

Topic: DNCPDDEServer

 

Poke the string value "%d||SEND||%d||%s" (w/o quotes) to the DDE item "Commands", where

 

1.%d - DDE client identification number

2.SEND - command name

3.%d - machine index (zero based)

4.%s - file name with full path to a NC program file

 

If you'll wait a transfer status, then sometimes sends the following Windows message:

 

DNCP_GetState_Message = WM_USER+0x314;

 

if ( !SendMessageTimeout(windowHandle, DNCP_GetState_Message, 0, 0, SMTO_NORMAL, 300, msg_res) )

{

     msg_res = 0x80000000;

}

Flag1 = msg_res & 0x80000000;

Flag2 = msg_res & 0x40000000;

tranferred_bytes = msg_res & $3FFFFFFF; // number of transferred bytes

 

if Flag1 isn't set, then transfer is completed/terminated.

if Flag2 is changing, then the DNCP is transferring a file.

 

if the transfer is completed/terminated, then you can request a status string from the "Status" item. This DDE item return a pointer to a status string:

 

%d||%s, where

 

%d - status code

%s - status message