Re: Error-- Argument not optional

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Shishir" <cooldude.programmer@xxxxxxxxx> ha scritto nel messaggio
news:1191407867.705795.232150@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I added a new function into the OCX by adding in the header file,
However when i call the function from VB script, it gives an error
"argument not optional"... But there are no arguments in the function.

//in ctrl page
DISP_FUNCTION(CAlmWinCtrl, "Somefn", Somefn, VT_EMPTY, VTS_NONE)

Is this in BEGIN_DISPATCH_MAP/END_DISPATCH_MAP block?


dispidSomefn = 66L,

Is this in the control header file, declared as a public enum inside the
control class?


//in .odl file
[id(66)] void Somefn();

Is this in the "methods:" section of "dispinterface" ?

Is the ID 66 *uniquely* associated to the aforementioned method?

Giovanni


.