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. question about DWORD

question about DWORD

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • R Offline
    R Offline
    Ryan McDermott
    wrote on last edited by
    #1

    Hello, i was wondering if it is possible to to convert a DWORD _stdcall to a void pointer-to-function? -Ryan M.

    T T 3 Replies Last reply
    0
    • R Ryan McDermott

      Hello, i was wondering if it is possible to to convert a DWORD _stdcall to a void pointer-to-function? -Ryan M.

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      typedef long int DWORD;

      there is no pointer in that expression, and less "pointer-to-funtion"... what do you mean ?


      TOXCCT >>> GEII power

      1 Reply Last reply
      0
      • R Ryan McDermott

        Hello, i was wondering if it is possible to to convert a DWORD _stdcall to a void pointer-to-function? -Ryan M.

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        sorry, i didn't see the _stdcall. use :

        reinterpret_cast<void>(your_expression)

        even if i don't imagine my you'd need such... could you help me ? :)


        TOXCCT >>> GEII power

        1 Reply Last reply
        0
        • R Ryan McDermott

          Hello, i was wondering if it is possible to to convert a DWORD _stdcall to a void pointer-to-function? -Ryan M.

          T Offline
          T Offline
          Tim Smith
          wrote on last edited by
          #4

          In general no. The reason is that when you cast things such as this, you run a great risk of changing the calling convention and thus trashing your stack. However, there are a few cases where this works. But in general, it is very bad idea. Why would you want to do this? (The reason I ask is because 9 times out of 10, when someone asks this question it is because they can't get their code to compile because they aren't doing something right.) Tim Smith I'm going to patent thought. I have yet to see any prior art.

          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