All:
I have developed an ActiveX control using MFC. The control has a simple
method defined in the ODL:
[id(101)] void Apple([in] BSTR x, [in] BSTR y, [out, retval] long* ok);
The implementation of Apple sets *ok = 0.
In my C# (Windows Forms) project, I create a reference to the control
and view the wrapper signature:
System.Int32 Apple ( System.String x , System.String y )
This looks correct. Now, I call the function from one of my C# methods:
private void button1_Click(object sender, System.EventArgs e) {
int retval = 0;
retval = ax1.Apple("hello", "world");
}
CLR reports the following error:
An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Parameter not optional.
Any ideas? Many thanks...
John