Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stand-alone Aspect Script ?????????

Status
Not open for further replies.

dmelle

Technical User
Jan 26, 2002
14
0
0
US
Is there anything out that can compile an aspect script into an executable file that can be run from a machine that does not have Procomm installed? I have built a script to send out to a bunch of my field folks, but they all do not have Procomm. Hopefully I am not just "Dreaming" hehehe......

Thanks,
David
 
You could however build a stand alone exe using the DDE interface to handle the task you want to handle.

Ati2ude
 
Do you have an Example of this Code ?? I do a lot of DDE with Excel 97 and Procomm 4.8

Hank camphm@bellsouth.net
 
Hank,

I have posted some of the code below. It is written in Visual C++. Let me know if you have any further questions.

//Loading
if(pApp->m_EmulatorVersion > 3)
{
szServer = "PW5";
}
else
{
szServer = "PW4";
}

if (!(m_DDE_PROC = MakeProcInstance ((FARPROC) ProCommDdeCallback, AfxGetInstanceHandle())))
return FALSE;

if (DdeInitialize ((LPDWORD) &m_DDE_INSTANCE, (PFNCALLBACK) m_DDE_PROC, APPCMD_CLIENTONLY, 0L))
return FALSE;
m_SERVER = DdeCreateStringHandle(m_DDE_INSTANCE, szServer, CP_WINANSI);

return TRUE;


//Connecting
sSessionName = "System";
m_TOPIC = DdeCreateStringHandle(m_DDE_INSTANCE, sSessionName, CP_WINANSI);

if (!(m_DDE_CONV = DdeConnect(m_DDE_INSTANCE, m_SERVER, m_TOPIC, NULL)))
{
m_bConnectionOpen = FALSE;
}
else
{
m_bConnectionOpen = TRUE;
}


//Reading

RequestCmd = "ASPECTCMD termreads s1 " + LongToString(Length );
pBuf = new char[RequestCmd.GetLength() + 1];
memset(pBuf, 0, sizeof(pBuf));
strcpy(pBuf, RequestCmd);
HSZ hszItem = DdeCreateStringHandle(m_DDE_INSTANCE, pBuf, CP_WINANSI);
Sleep(250);
DdeClientTransaction ((unsigned char *) pBuf, RequestCmd.GetLength() + 1, m_DDE_CONV, 0, 0, XTYP_EXECUTE, 5000, &dwResult);

HSZ hszItem2 = DdeCreateStringHandle(m_DDE_INSTANCE, "s1", CP_WINANSI);
Sleep(250);
if (!(m_hDATA = DdeClientTransaction (NULL, -1, m_DDE_CONV, hszItem2, CF_TEXT, XTYP_REQUEST, 60000, &dwResult)))
{
SetCursorPosition( lOrigRow, lOrigCol);
delete [] pBuf;
DdeFreeStringHandle (m_DDE_INSTANCE, hszItem);
DdeFreeStringHandle (m_DDE_INSTANCE, hszItem2);
pApp->SetLastError(ER_READ | ER_DDE_ERROR, HandleError(DdeGetLastError(m_DDE_INSTANCE)));
return "";
}

lpszData = DdeAccessData (m_hDATA, &cbDataLen);
// Get return code from front of data string
CString sHoldString;
sHoldString = (char *)lpszData;
DdeUnaccessData(m_hDATA);
DdeFreeStringHandle (m_DDE_INSTANCE, hszItem);
DdeFreeStringHandle (m_DDE_INSTANCE, hszItem2);
delete [] pBuf;
sReturnString = sHoldString;
//writing

if (sValue.Find ("{") >= 0)
{
sValue = MapKeys(sValue);
RequestCmd = "ASPECTCMD termvkey " + sValue;
pBuf = new char[RequestCmd.GetLength() + 1];
memset(pBuf, 0, sizeof(pBuf));
strcpy(pBuf, RequestCmd );
DdeClientTransaction ((unsigned char *) pBuf, strlen(pBuf) + 1, m_DDE_CONV, 0, 0, XTYP_EXECUTE, 5000, NULL);
delete [] pBuf;
}
else
{
if (SetCursorPosition(lLine, lStart))
{
sValue = MapKeys(sValue);
RequestCmd = "transmit " + sValue;
pBuf = new char[RequestCmd.GetLength() + 1];
memset(pBuf, 0, sizeof(pBuf));
strcpy(pBuf, RequestCmd);
DdeClientTransaction ((unsigned char *) pBuf, strlen(pBuf) + 1, m_DDE_CONV, 0, 0, XTYP_EXECUTE, 5000, NULL);
delete [] pBuf;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top