-
-
[求助]怎么vc6不能使用MSTSCLib吗
-
发表于: 2011-8-17 23:21 5030
-
#include <stdio.h>
#include <windows.h>
#import <mstscax.dll>
void ConnectRemoteDesktop()
{
//MSTSCLib
MSTSCLib::IMsRdpClient2* pInterface = NULL;
//generic method
HRESULT hrInterface = NULL;
hrInterface = CoCreateInstance(__uuidof(MSTSCLib::MsRdpClient2), NULL, CLSCTX_INPROC_SERVER,
__uuidof(MSTSCLib::IMsRdpClient2), (void**)&pInterface);
if (SUCCEEDED(hrInterface))
{
long port;
pInterface->ColorDepth = 16;
pInterface->DesktopWidth = 640;
pInterface->DesktopHeight = 480;
pInterface->AdvancedSettings2->get_RDPPort(&port);
pInterface->PutServer("192.168.1.110");
pInterface->PutUserName("Administrator");
//pInterface->PutServer(L"192.168.1.110");
pInterface->AdvancedSettings2->put_ClearTextPassword(L"pass");
pInterface->PutFullScreen(0);
HRESULT hrConnect = pInterface->Connect();
printf("%x\n", hrConnect);
} else {
printf("%d\n", GetLastError());
}
}
int main(int argc, char* argv[])
{
CoInitialize(NULL);
ConnectRemoteDesktop();
CoUninitialize();
return 0;
}
怎么tcp连接都不执行???pInterface->Connect难道是假牙??
#include <windows.h>
#import <mstscax.dll>
void ConnectRemoteDesktop()
{
//MSTSCLib
MSTSCLib::IMsRdpClient2* pInterface = NULL;
//generic method
HRESULT hrInterface = NULL;
hrInterface = CoCreateInstance(__uuidof(MSTSCLib::MsRdpClient2), NULL, CLSCTX_INPROC_SERVER,
__uuidof(MSTSCLib::IMsRdpClient2), (void**)&pInterface);
if (SUCCEEDED(hrInterface))
{
long port;
pInterface->ColorDepth = 16;
pInterface->DesktopWidth = 640;
pInterface->DesktopHeight = 480;
pInterface->AdvancedSettings2->get_RDPPort(&port);
pInterface->PutServer("192.168.1.110");
pInterface->PutUserName("Administrator");
//pInterface->PutServer(L"192.168.1.110");
pInterface->AdvancedSettings2->put_ClearTextPassword(L"pass");
pInterface->PutFullScreen(0);
HRESULT hrConnect = pInterface->Connect();
printf("%x\n", hrConnect);
} else {
printf("%d\n", GetLastError());
}
}
int main(int argc, char* argv[])
{
CoInitialize(NULL);
ConnectRemoteDesktop();
CoUninitialize();
return 0;
}
怎么tcp连接都不执行???pInterface->Connect难道是假牙??
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
他的文章
- [分享]FCN免公网IP远程接入局域网3.8版本发布 12844
- [原创]FCN远程连接局域网V3.0正式版发布 5179
- [原创]FCN一键接入工具 4658
- [原创]FCN一键接入私有网络工具 5935
- [原创]最近写的一个类C语言的解释编译器 7370
看原图
赞赏
雪币:
留言: