Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does COM allow parameters?
Message
De
31/07/2000 12:09:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00398803
Message ID:
00398858
Vues:
20
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform