dvoeller
Nov 28th, 2000, 11:03 AM
I have a C++ COM DLL Server and a VB client.
The VB client tries to access a method in an interface
implemented in the DLL Server but as best I can tell it
will not work because the method has more than 1 parameter.
Any ideas?
Partial VB listing
'C++ COM DLL Server
Dim WithEvents AcqMgr As HunterAcqMgrLib.HComSensorAcqMgr
Private Sub Form_Load()
Dim iResult As Integer
Set AcqMgr = New HComSensorAcqMgr
Dim s As HESamExecuteFreq
' Intellisense brings up possible selections
s = KSamExecRepeat6Hz
Dim t As HESamSeqType
' Intellisense brings up possible selections
t = KSamSeqTypeAlign
Dim u As HESamMode
' Intellisense brings up possible selections
u = KSamModeAlignSummary
' If I change AddMessageToQ in the C++ COM DLL Server so
' that it only takes 1 parameter, it will compile. Any
' method that takes more than 1 parameter does not work.
'Does not work
AcqMgr.AddMessageToQ(KSamSeqTypeAlign,KSamExecRepeat6Hz,bActive,KSamModeAlignSummary)
'Does not work
AcqMgr.AddMessageToQ(t,s,False,u)
'Does not work
AcqMgr.AddMessageToQ(0, 4, False, 1)
'Works
AcqMgr.ChangeSamMode (KSamModeIdle)
End Sub
The C++ idl looks like
[
object,
uuid(2C22FAE4-2C04-11D4-AD0E-00C04F8DD0AC),
dual,
pointer_default (Unique)
]
interface IHComSensorAcqMgr: IDispatch
{
.
.
.
HRESULT ChangeSamMode(
[in] HESamMode eMode);
HRESULT AddMessageToQ(
[in] HESamSeqType eSeqType,
[in] HESamExecuteFreq eFreq,
[in] VARIANT_BOOL vbActive,
[in] HESamMode eMode
);
.
.
.
}
The VB client tries to access a method in an interface
implemented in the DLL Server but as best I can tell it
will not work because the method has more than 1 parameter.
Any ideas?
Partial VB listing
'C++ COM DLL Server
Dim WithEvents AcqMgr As HunterAcqMgrLib.HComSensorAcqMgr
Private Sub Form_Load()
Dim iResult As Integer
Set AcqMgr = New HComSensorAcqMgr
Dim s As HESamExecuteFreq
' Intellisense brings up possible selections
s = KSamExecRepeat6Hz
Dim t As HESamSeqType
' Intellisense brings up possible selections
t = KSamSeqTypeAlign
Dim u As HESamMode
' Intellisense brings up possible selections
u = KSamModeAlignSummary
' If I change AddMessageToQ in the C++ COM DLL Server so
' that it only takes 1 parameter, it will compile. Any
' method that takes more than 1 parameter does not work.
'Does not work
AcqMgr.AddMessageToQ(KSamSeqTypeAlign,KSamExecRepeat6Hz,bActive,KSamModeAlignSummary)
'Does not work
AcqMgr.AddMessageToQ(t,s,False,u)
'Does not work
AcqMgr.AddMessageToQ(0, 4, False, 1)
'Works
AcqMgr.ChangeSamMode (KSamModeIdle)
End Sub
The C++ idl looks like
[
object,
uuid(2C22FAE4-2C04-11D4-AD0E-00C04F8DD0AC),
dual,
pointer_default (Unique)
]
interface IHComSensorAcqMgr: IDispatch
{
.
.
.
HRESULT ChangeSamMode(
[in] HESamMode eMode);
HRESULT AddMessageToQ(
[in] HESamSeqType eSeqType,
[in] HESamExecuteFreq eFreq,
[in] VARIANT_BOOL vbActive,
[in] HESamMode eMode
);
.
.
.
}