Hello can sombody help in solving a problem
I am having a problem when trying to call the function of VB ActiveX dll from C# and I am getting the error show at the end.
The VB Function is
Public Function GetStatistics(ByRef varStats() As Variant, Optional ByVal stStatType As e_STAT_TYPE = e_stCLIENT_STATS) As Long
And the RCW has created the function as follows (when adding ref from Visual studio)
int GetStatistics(ref Array varStats, e_STAT_TYPE stStatType);
The problem is we cannot create the object of Array class as its abstract class and so what I am doing is creating an object array object and type casting it to the Array ref as follows.
object varstats = new object;
Array obj1 = varstats;
objAlm.GetStatistics(ref obj1, e_STAT_TYPE.e_stCLIENT_STATS)
And the RCW has created the function as follows (from TLBIMP.exe)
int GetStatistics(ref object varStats, e_STAT_TYPE stStatType);
objAlm.GetStatistics(ref varstats, e_STAT_TYPE.e_stCLIENT_STATS)
This is giving the following error.
Invalid callee. (Exception from HRESULT: 0x80020010 (DISP_E_BADCALLEE))
Have you ever seen this error? Do you have any idea?
Waiting for your reply…
Solved the problem by changing the following
object[,] varstats = new object[0,0];
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?