InvokeHelper question
-
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
-
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
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!"
-
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!"
-
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
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!"
-
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
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...?
-
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...?
-
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