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:
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 to detect, that application is started, all settings was 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 server parameters:
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 file
if the transfer is completed/terminated then you can request status string from the "Status" item. This DDE item return a pointer to a status string:
%d - status code
%s - status message