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. Function Pointer in IDL File

Function Pointer in IDL File

Scheduled Pinned Locked Moved COM
4 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.
  • G Offline
    G Offline
    Gopal_Kanchana
    wrote on last edited by
    #1

    Is it posssible to create function pointer in IDL file

    B 1 Reply Last reply
    0
    • G Gopal_Kanchana

      Is it posssible to create function pointer in IDL file

      B Offline
      B Offline
      Baltoro
      wrote on last edited by
      #2

      You should consider how this function pointer is going to be marshaled. Function Call Attributes[^] might suggest a possibility. What are you going to do with this function pointer?

      G 1 Reply Last reply
      0
      • B Baltoro

        You should consider how this function pointer is going to be marshaled. Function Call Attributes[^] might suggest a possibility. What are you going to do with this function pointer?

        G Offline
        G Offline
        Gopal_Kanchana
        wrote on last edited by
        #3

        I working on com dll in vc++(not clr) 1st Dll consist of various methods having same signature 2nd dll need to pass the funtion pointer of 1st dll method which is going to execute in 1st dll.

        B 1 Reply Last reply
        0
        • G Gopal_Kanchana

          I working on com dll in vc++(not clr) 1st Dll consist of various methods having same signature 2nd dll need to pass the funtion pointer of 1st dll method which is going to execute in 1st dll.

          B Offline
          B Offline
          Baltoro
          wrote on last edited by
          #4

          Sorry, it took so long to get back to you, I don't visit the site every day. The reason I suggested that you consider how you want the 'function pointer' to be marshaled is that the COM Library is designed to use the RPC mechanism and a proxy/stub architecture to interact with other COM components, whether in the same process, in another thread in the same process, or even another process on a remote machine. I have no way of knowing how aware you are of COM internals,...so, I don't make any assumptions. The COM Library performs many operations that are invisible to the programmer when you make an activation request (for instance, CoCreateInstance or DllGetClassObject), depending on the server registration and how you configure your apartments. If it's an In-Process Server, you could, hypothetically, pass a 'function pointer' to another DLL in the same process, and the address would be accessible. In practice, this is a really dumb idea. The obvious question is: why not call the method directly? If the Com DLL is in another process address space, any virtual function pointer will be invalid (this will be true even if it's NOT a COM Dll). I'm assuming that you konw all this. Your question provides the very minimum of information, making it difficult to answer accurately. ...So, what's your point? If you want to define a 'function pointer', go ahead.

          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