CreateProcessWithLogonW
-
I am trying to create a program using the CreateProcessWithLogonW. I am working on a Windows 2000 Professional. The program compiles fine but when it tries to link it, it gives the following errors: Linking... CreateProcess.obj : error LNK2001: unresolved external symbol __imp__CreateProcessWithLogonW@44 Debug/CreateProcess.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Creating browse info file... CreateProcess.exe - 2 error(s), 0 warning(s) The code that I am trying to compile is as follows: #define UNICODE #define _WIN32_WINNT 0x0500 #define WINVER 0x0500 #include #pragma comment(lib, "Advapi32") int main(int argc, char* argv[]) { STARTUPINFO si; si.cb = sizeof(STARTUPINFO); PROCESS_INFORMATION pi; if (CreateProcessWithLogonW(L"UserName", L"Domain", L"password", LOGON_WITH_PROFILE, NULL, L"\"full file path\"", CREATE_DEFAULT_ERROR_MODE, NULL, L"\"current directory\"", (LPSTARTUPINFO)&si, (LPPROCESS_INFORMATION)&pi)) { CloseHandle(pi.hThread); CloseHandle(pi.hProcess); } return 0; }
-
I am trying to create a program using the CreateProcessWithLogonW. I am working on a Windows 2000 Professional. The program compiles fine but when it tries to link it, it gives the following errors: Linking... CreateProcess.obj : error LNK2001: unresolved external symbol __imp__CreateProcessWithLogonW@44 Debug/CreateProcess.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Creating browse info file... CreateProcess.exe - 2 error(s), 0 warning(s) The code that I am trying to compile is as follows: #define UNICODE #define _WIN32_WINNT 0x0500 #define WINVER 0x0500 #include #pragma comment(lib, "Advapi32") int main(int argc, char* argv[]) { STARTUPINFO si; si.cb = sizeof(STARTUPINFO); PROCESS_INFORMATION pi; if (CreateProcessWithLogonW(L"UserName", L"Domain", L"password", LOGON_WITH_PROFILE, NULL, L"\"full file path\"", CREATE_DEFAULT_ERROR_MODE, NULL, L"\"current directory\"", (LPSTARTUPINFO)&si, (LPPROCESS_INFORMATION)&pi)) { CloseHandle(pi.hThread); CloseHandle(pi.hProcess); } return 0; }
smbecker wrote: #pragma comment(lib, "Advapi32") change to #pragma comment(lib, "Advapi32.lib") Rob Manderson I'm working on a version for Visual Lisp++
-
smbecker wrote: #pragma comment(lib, "Advapi32") change to #pragma comment(lib, "Advapi32.lib") Rob Manderson I'm working on a version for Visual Lisp++