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. Hardware & Devices
  4. Problem With Application Launcher for Device Driver

Problem With Application Launcher for Device Driver

Scheduled Pinned Locked Moved Hardware & Devices
helptutorial
4 Posts 3 Posters 2 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.
  • P Offline
    P Offline
    Pratheep Kenny
    wrote on last edited by
    #1

    Hi, I have created a Device Independent Driver Code. It is working perfectly. All i need is a Application Launcher program. And that is where my problem starts. I am trying to create the file using the CreateFile Command. And it is always returning false. I have attached the code snippet below. Anyone who knows how to solve the problem please help me. HANDLE OpenDeviceDriver(LPCTSTR szDriverName) { HANDLE hDevice; TCHAR szFullName[200]; wsprintf(szFullName, "\\\\.\\%s", szDriverName); hDevice = CreateFile (szFullName, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if(hDevice == INVALID_HANDLE_VALUE) { hDevice = 0; printf("%x Error %ld\n",hDevice,GetLastError()); } return hDevice; } With Warm Regards Kenny

    K 1 Reply Last reply
    0
    • P Pratheep Kenny

      Hi, I have created a Device Independent Driver Code. It is working perfectly. All i need is a Application Launcher program. And that is where my problem starts. I am trying to create the file using the CreateFile Command. And it is always returning false. I have attached the code snippet below. Anyone who knows how to solve the problem please help me. HANDLE OpenDeviceDriver(LPCTSTR szDriverName) { HANDLE hDevice; TCHAR szFullName[200]; wsprintf(szFullName, "\\\\.\\%s", szDriverName); hDevice = CreateFile (szFullName, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if(hDevice == INVALID_HANDLE_VALUE) { hDevice = 0; printf("%x Error %ld\n",hDevice,GetLastError()); } return hDevice; } With Warm Regards Kenny

      K Offline
      K Offline
      kakan
      wrote on last edited by
      #2

      What's the return value from GetLastError() ?

      Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

      P 1 Reply Last reply
      0
      • K kakan

        What's the return value from GetLastError() ?

        Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

        P Offline
        P Offline
        Pratheep Kenny
        wrote on last edited by
        #3

        The result of GetLastError() is 2

        S 1 Reply Last reply
        0
        • P Pratheep Kenny

          The result of GetLastError() is 2

          S Offline
          S Offline
          svsundar Vairavan
          wrote on last edited by
          #4

          Means The file is not there in the specified path.I want to know what u or passing to szDriverName. regards Vairavan -- modified at 0:52 Friday 1st September, 2006

          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