A
Adam
This is my first attempt at using the Terminal Services API, and I'm
stumped. I can't get WTSOpenServer to work for the life of me (this is
in VS2005, by the way). Specifically, the argument has me baffled.
It's my understanding that it wants a LPWSTR (at least on this machine,
where UNICODE is defined). My first attempt was:
HANDLE hnd = WTSOpenServer("asdf");
Which yielded:
error C2664: 'WTSOpenServerW' : cannot convert parameter 1 from 'const
char [5]' to 'LPWSTR'
Fine. So I tried:
HANDLE hnd = WTSOpenServer(A2T("asdf"));
Which pukes up:
error LNK2028: unresolved token (0A000415) "extern "C" void * __stdcall
WTSOpenServerW(wchar_t *)" (?WTSOpenServerW@@$$J14YGPAXPA_W@Z)
referenced in function "private: void __clrcall
test::Form1::Form1_Load(class System::Object ^,class System::EventArgs
^)"
(?Form1_Load@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
test.obj
error LNK2019: unresolved external symbol "extern "C" void * __stdcall
WTSOpenServerW(wchar_t *)" (?WTSOpenServerW@@$$J14YGPAXPA_W@Z)
referenced in function "private: void __clrcall
test::Form1::Form1_Load(class System::Object ^,class System::EventArgs
^)"
(?Form1_Load@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
test.obj
HANDLE hnd = WTSOpenServer(A2W("asdf")); gave the same results.
Can anyone tell me what on earth I'm doing wrong? I've been googling
for days, and I'm sure it can't be this difficult. Any help is
appreciated. And if I'm in the wrong group, please accept my
apologies.
Adam
stumped. I can't get WTSOpenServer to work for the life of me (this is
in VS2005, by the way). Specifically, the argument has me baffled.
It's my understanding that it wants a LPWSTR (at least on this machine,
where UNICODE is defined). My first attempt was:
HANDLE hnd = WTSOpenServer("asdf");
Which yielded:
error C2664: 'WTSOpenServerW' : cannot convert parameter 1 from 'const
char [5]' to 'LPWSTR'
Fine. So I tried:
HANDLE hnd = WTSOpenServer(A2T("asdf"));
Which pukes up:
error LNK2028: unresolved token (0A000415) "extern "C" void * __stdcall
WTSOpenServerW(wchar_t *)" (?WTSOpenServerW@@$$J14YGPAXPA_W@Z)
referenced in function "private: void __clrcall
test::Form1::Form1_Load(class System::Object ^,class System::EventArgs
^)"
(?Form1_Load@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
test.obj
error LNK2019: unresolved external symbol "extern "C" void * __stdcall
WTSOpenServerW(wchar_t *)" (?WTSOpenServerW@@$$J14YGPAXPA_W@Z)
referenced in function "private: void __clrcall
test::Form1::Form1_Load(class System::Object ^,class System::EventArgs
^)"
(?Form1_Load@Form1@test@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
test.obj
HANDLE hnd = WTSOpenServer(A2W("asdf")); gave the same results.
Can anyone tell me what on earth I'm doing wrong? I've been googling
for days, and I'm sure it can't be this difficult. Any help is
appreciated. And if I'm in the wrong group, please accept my
apologies.
Adam