Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does COM allow parameters?
Message
From
31/07/2000 12:09:41
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00398803
Message ID:
00398858
Views:
15
Hi Larry,

>Jon,
>This may be trivial but is the name of the function in your COM server actually MyForm_Init? If so, that is your problem. The function must be named Init.

No, the name of the procedure is Init. I just included the MyForm to indicate the name of the class. Good eye though.

Here's the actual procedure:
PROCEDURE Init
  LPARAMETERS tnInit

  LOCAL llAbort

  tnInit=IIF(TYPE('tnInit')<>'N',0,tnInit) && convert parm to numeric
  IF tnInit > 0
    llAbort = .T.
    IF THIS.QueryDevices()>0 && Query available devices
      IF THIS.SetDevice(1)=APP_TRUE && Set Initial Device
        llAbort = .F.
      ENDIF
    ENDIF
  ENDIF
  RETURN IIF(llAbort,APP_FALSE,APP_TRUE)
ENDPROC
FWIW, the QueryDevices method takes about 6 seconds to perform, on average. I was trying to make this optional upon instantiating the object. So my first thought was the parameter.

Thanks again for the reply.
Previous
Reply
Map
View

Click here to load this message in the networking platform