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. InvokeHelper question

InvokeHelper question

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 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.
  • N Offline
    N Offline
    ns
    wrote on last edited by
    #1

    I have a VB dll, and a VC client. In this snippet of code from the client :

    BOOL _CRemoteCall::MoveProgressBarX(long hPBHWND, long iMin, long iMax)
    {
    	BOOL result;
    	static BYTE parms[] =
    		VTS_I4 VTS_I4 VTS_I4;
    	InvokeHelper(0x60030002, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms,
    		hPBHWND, iMin, iMax);
    	return result;
    }
    

    how do I get that number 0x600.....? I think what the call does is it calls a particular function from the VB dll, but I just cant figure how out to get that number. Also I hope this number isnt machine specific (just cant be because its hardcoded...) Thanks, ns

    A 1 Reply Last reply
    0
    • N ns

      I have a VB dll, and a VC client. In this snippet of code from the client :

      BOOL _CRemoteCall::MoveProgressBarX(long hPBHWND, long iMin, long iMax)
      {
      	BOOL result;
      	static BYTE parms[] =
      		VTS_I4 VTS_I4 VTS_I4;
      	InvokeHelper(0x60030002, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms,
      		hPBHWND, iMin, iMax);
      	return result;
      }
      

      how do I get that number 0x600.....? I think what the call does is it calls a particular function from the VB dll, but I just cant figure how out to get that number. Also I hope this number isnt machine specific (just cant be because its hardcoded...) Thanks, ns

      A Offline
      A Offline
      Anders Molin
      wrote on last edited by
      #2

      It's the DispID of the VB Object, it won't chang from machine to machine.. - Anders Money talks, but all mine ever says is "Goodbye!"

      N 1 Reply Last reply
      0
      • A Anders Molin

        It's the DispID of the VB Object, it won't chang from machine to machine.. - Anders Money talks, but all mine ever says is "Goodbye!"

        N Offline
        N Offline
        ns
        wrote on last edited by
        #3

        Okay. thanks. I dont know how to get this DispID. Is there a procedure outlined somewhere that you know of? Is is somethin that can be answered in a post without too much trouble ? Thanks, ns

        A L 2 Replies Last reply
        0
        • N ns

          Okay. thanks. I dont know how to get this DispID. Is there a procedure outlined somewhere that you know of? Is is somethin that can be answered in a post without too much trouble ? Thanks, ns

          A Offline
          A Offline
          Anders Molin
          wrote on last edited by
          #4

          That depends... The only way I know is using the #import statement to import the dll. Then, in the .tlb-file generated by VC, you can see some const's called IID_SomeName. That's the ones you want :) Hope it helps... - Anders Money talks, but all mine ever says is "Goodbye!"

          1 Reply Last reply
          0
          • N ns

            Okay. thanks. I dont know how to get this DispID. Is there a procedure outlined somewhere that you know of? Is is somethin that can be answered in a post without too much trouble ? Thanks, ns

            L Offline
            L Offline
            Lakitu
            wrote on last edited by
            #5

            You can use OLE View that comes with VC++ 6.0. You open a typelib, select the appropriate interface (probably an IDispatch-derived one). Browse through the methods and you'll notice ids. If a train station is where the train stops, what's a workstation...?

            N 1 Reply Last reply
            0
            • L Lakitu

              You can use OLE View that comes with VC++ 6.0. You open a typelib, select the appropriate interface (probably an IDispatch-derived one). Browse through the methods and you'll notice ids. If a train station is where the train stops, what's a workstation...?

              N Offline
              N Offline
              ns
              wrote on last edited by
              #6

              Wonderful! Thats exactly where I found it (for the sample) after you directed me. APpreciate it! Then I looked for a tlb in my VB prj folder and there wasnt one! So I have to locate a tlb file for my prj. Wonder if you have to tell VB to make it... Thanks, ns

              L 1 Reply Last reply
              0
              • N ns

                Wonderful! Thats exactly where I found it (for the sample) after you directed me. APpreciate it! Then I looked for a tlb in my VB prj folder and there wasnt one! So I have to locate a tlb file for my prj. Wonder if you have to tell VB to make it... Thanks, ns

                L Offline
                L Offline
                Lakitu
                wrote on last edited by
                #7

                DLLs usually incorporate the TLB as a resource. OLe View can read those as well. Just load the dll (or exe) instead. If a train station is where the train stops, what's a workstation...?

                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