sandhya sharma
asked on
Not able to launch Remote app
I had this question after viewing Remote App failed to launch using MSTSCLib API.
I have to launch an application remotely. with the below lines of code able to connect remote desktop. but not able to launch remote application
m_RemoteAppobj = m_RDPClient.get_RemoteProg ram2();
m_RemoteAppobj.put_RemoteP rogramMode (true);
m_RemoteAppobj.put_RemoteA pplication Name(L"Not epad");
m_RemoteAppobj.put_RemoteA pplication Program(L" C:\\Window s\\System3 2\\notepad .exe");
void CTestRdpNECTIDlg::OnConnec tedMstscax 1()
{
try
{
LPCTSTR lpExecutablePath = L"C:\\Windows\\System32\\n otepad.exe ";
LPCTSTR lpworkingdirectory = L"c:\\";
int n=m_RDPClient.get_Connecte d();
m_RemoteAppobj.ServerStart Program(lp Executable Path,L"",l pworkingdi rectory,fa lse ,L"ARGS",false );
}
catch(...)
{
wchar_t buf[256];
memset(buf,0,sizeof(buf)/s izeof(wcha r_t));
FormatMessage(FORMAT_MESSA GE_FROM_SY STEM | FORMAT_MESSAGE_IGNORE_INSE RTS,
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf, (sizeof(buf) / sizeof(wchar_t)), NULL);
AfxMessageBox(buf);
}
}
I have to launch an application remotely. with the below lines of code able to connect remote desktop. but not able to launch remote application
m_RemoteAppobj = m_RDPClient.get_RemoteProg
m_RemoteAppobj.put_RemoteP
m_RemoteAppobj.put_RemoteA
m_RemoteAppobj.put_RemoteA
void CTestRdpNECTIDlg::OnConnec
{
try
{
LPCTSTR lpExecutablePath = L"C:\\Windows\\System32\\n
LPCTSTR lpworkingdirectory = L"c:\\";
int n=m_RDPClient.get_Connecte
m_RemoteAppobj.ServerStart
}
catch(...)
{
wchar_t buf[256];
memset(buf,0,sizeof(buf)/s
FormatMessage(FORMAT_MESSA
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf, (sizeof(buf) / sizeof(wchar_t)), NULL);
AfxMessageBox(buf);
}
}
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.