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. Resolving functions from character strings...any ideas?

Resolving functions from character strings...any ideas?

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
5 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.
  • J Offline
    J Offline
    Jesse Rosalia
    wrote on last edited by
    #1

    With the Microsoft Developer studio add-ins, you declare functions in a COM interface, then call a routine (a member of the Application object) AddCommand, which takes amongst other things a string that contains the names of your functions. These are not exported functions, they are standard STDMETHOD(...) functions (which expands to HRESULT virtual __stdcall ...). Any one have any ideas on how they do this? I know you can export the functions, and then use GetProcAddress to look those functions up my name, but these functions are not exported...they are normal exposed members of a COM interface. Anyone have any ideas on how they get away with this? Thanks in advance. -Jesse

    C T 2 Replies Last reply
    0
    • J Jesse Rosalia

      With the Microsoft Developer studio add-ins, you declare functions in a COM interface, then call a routine (a member of the Application object) AddCommand, which takes amongst other things a string that contains the names of your functions. These are not exported functions, they are standard STDMETHOD(...) functions (which expands to HRESULT virtual __stdcall ...). Any one have any ideas on how they do this? I know you can export the functions, and then use GetProcAddress to look those functions up my name, but these functions are not exported...they are normal exposed members of a COM interface. Anyone have any ideas on how they get away with this? Thanks in advance. -Jesse

      C Offline
      C Offline
      calebcohoon
      wrote on last edited by
      #2

      Check out this link: http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-CallFunc&forum=cotd&id=-1 That should help :) Later, Caleb

      J 1 Reply Last reply
      0
      • C calebcohoon

        Check out this link: http://www.flipcode.com/cgi-bin/msg.cgi?showThread=COTD-CallFunc&forum=cotd&id=-1 That should help :) Later, Caleb

        J Offline
        J Offline
        Jesse Rosalia
        wrote on last edited by
        #3

        Sweet! Thank a bunch :)

        1 Reply Last reply
        0
        • J Jesse Rosalia

          With the Microsoft Developer studio add-ins, you declare functions in a COM interface, then call a routine (a member of the Application object) AddCommand, which takes amongst other things a string that contains the names of your functions. These are not exported functions, they are standard STDMETHOD(...) functions (which expands to HRESULT virtual __stdcall ...). Any one have any ideas on how they do this? I know you can export the functions, and then use GetProcAddress to look those functions up my name, but these functions are not exported...they are normal exposed members of a COM interface. Anyone have any ideas on how they get away with this? Thanks in advance. -Jesse

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

          MS compiles your com interface file (.idl) and produces the function name to function pointer map. Look through the files in your directory after compile and you can find this. There's probably a macro that uses the ## syntax to create the function name as a string.

          J 1 Reply Last reply
          0
          • T Todd Smith

            MS compiles your com interface file (.idl) and produces the function name to function pointer map. Look through the files in your directory after compile and you can find this. There's probably a macro that uses the ## syntax to create the function name as a string.

            J Offline
            J Offline
            Jesse Rosalia
            wrote on last edited by
            #5

            Thanks...I couldnt find anything to resolve those functions to strings, however your suggestion of a macro gave me an idea that I made work =) -Jesse

            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