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. Calling GlobalLock inside an DLL has problem?

Calling GlobalLock inside an DLL has problem?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
2 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.
  • S Offline
    S Offline
    Stan the man
    wrote on last edited by
    #1

    HI. I can't understand something. I have a DLL which has a class that calls a function that is the following: DWORD dwLen = GlobalSize(m_hDevMode); BYTE* lp = (BYTE*)GlobalLock(m_hDevMode); file->Write(&dwLen,sizeof(dwLen)); file->Write(lp,dwLen); file->Write(&dwLen,sizeof(dwLen)); GlobalUnlock(m_hDevMode); Now, when I put the .h and .cpp file of the class directly in my application directory and use the class, it works fine. But when I call the class and this function exporting/using it from the DLL, it gives me warnings and does not work. It will comile but when I run the function that calls this function, it does not work. Can anyone helpl shed some light on this? Or how would I "fix" this? Thanks ahead of time.

    P 1 Reply Last reply
    0
    • S Stan the man

      HI. I can't understand something. I have a DLL which has a class that calls a function that is the following: DWORD dwLen = GlobalSize(m_hDevMode); BYTE* lp = (BYTE*)GlobalLock(m_hDevMode); file->Write(&dwLen,sizeof(dwLen)); file->Write(lp,dwLen); file->Write(&dwLen,sizeof(dwLen)); GlobalUnlock(m_hDevMode); Now, when I put the .h and .cpp file of the class directly in my application directory and use the class, it works fine. But when I call the class and this function exporting/using it from the DLL, it gives me warnings and does not work. It will comile but when I run the function that calls this function, it does not work. Can anyone helpl shed some light on this? Or how would I "fix" this? Thanks ahead of time.

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      Stan the man wrote:

      But when I call the class and this function exporting/using it from the DLL, it gives me warnings

      And what are those warnings ?

      Stan the man wrote:

      and does not work.

      Can you explain this ?

      Prasad Notifier using ATL | Operator new[],delete[][^]

      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