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. COM
  4. Can't use a handle to object

Can't use a handle to object

Scheduled Pinned Locked Moved COM
helpgraphicssysadmin
2 Posts 2 Posters 3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    When I pass a handle of file (or bitmap) to the server ,which has been opened from the client , the server can't access the file.When the server reads from the file , the operation don't return an error code but the information that has been read is wrong(or the bitmap can't be selected in any device context).I tried lots of things , but nothing helped me.Please help me.

    J 1 Reply Last reply
    0
    • L Lost User

      When I pass a handle of file (or bitmap) to the server ,which has been opened from the client , the server can't access the file.When the server reads from the file , the operation don't return an error code but the information that has been read is wrong(or the bitmap can't be selected in any device context).I tried lots of things , but nothing helped me.Please help me.

      J Offline
      J Offline
      Julien
      wrote on last edited by
      #2

      hey Joe, You can not use HANDLE's between processes. You need to call DuplicateHandle to have your second process have its own handle to the same resource. Watch out for the first arguement to DuplicateHandle as it is a HANDLE to the process that created it, the way to get that is to call OpenProcess with the ProcessId. Jules

      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