Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CreateProcessWithLogonW

CreateProcessWithLogonW

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cobyjone
    wrote on last edited by
    #1

    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; }

    R 1 Reply Last reply
    0
    • C cobyjone

      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; }

      R Offline
      R Offline
      Rob Manderson
      wrote on last edited by
      #2

      smbecker wrote: #pragma comment(lib, "Advapi32") change to #pragma comment(lib, "Advapi32.lib") Rob Manderson I'm working on a version for Visual Lisp++

      C 1 Reply Last reply
      0
      • R Rob Manderson

        smbecker wrote: #pragma comment(lib, "Advapi32") change to #pragma comment(lib, "Advapi32.lib") Rob Manderson I'm working on a version for Visual Lisp++

        C Offline
        C Offline
        cobyjone
        wrote on last edited by
        #3

        I made the change and I am still getting the same linking error as before. Any other suggestions? Thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups