Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serial Printer
Message
De
17/08/2005 11:22:55
 
 
À
17/08/2005 11:15:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
01040844
Message ID:
01041663
Vues:
20
>I added mscomm32.ocx to the class, and I copied the code to cmdbutton.click:
>
> PUBLIC ComForm
> ComForm = CREATEOBJECT('Form')
> ComForm.AddObject("Testcom","Olecontrol","MSCOMMLib.MSComm")
> ComForm.Testcom.CommPort = 2 && Use Comm2, The second Serial Port.
> ComForm.Testcom.Settings = "14400,N,8,1" && 14.4 Kbaud, No Parity,
> && 8 data Bits, 1 Stop Bit
> ComForm.Testcom.PortOpen = .T.
> ComForm.Testcom.Output = "ATDT555-1234" + chr(13) && Dialing the number
> * The chr(13) is needed to complete the modem command sequence
> ComForm.Testcom.PortOpen = .F.
> ***** End Code *****
>
>when I compiled, I got error:
>
>ERROR#: 15
>Not a table
>ComForm.Testcom.PortOpen = .F.
>
>am I missing something?


Not that I can see from your sample.
ComForm is an instance of your Form (shouldn't be Public except for testing from the Command Box BTW).
The you add MSCOMM as an object to the form.
Does it crash in the last line you showed but works when doing the settings until then? IOW, is ComForm.Testcom instantiated succesfully as an object?
For debugging purposes ad lines to show the result of VARTYPE(ComForm.Testcom) as "O" or better yet run it line by line in the debugger.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform