Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using an OCX in a .prg file
Message
 
À
28/09/2007 08:37:14
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01257362
Message ID:
01257586
Vues:
27
Hi Jay. Thanks for Replying.
I meant 'unusual' in the sense that Bosislav had a comment at the bottom of the code to the effect that it wwas 'Untested'.
I am always a bit reluctant to try an 'Unteated' solution if there is soneting out there that has been actually used .
Regards,
Gerard



>Not sure what you mean by "unusual" but I just did a whole bunch of this using the MSWinsck.ocx and this is exactly the approach I used. I think Borislav gave you a good place to start.
>
>But, now that I've read Sergey's reply, I'm not sure we are talking about the same thing specifically.
>
>>Hi Borislav, Thabks for your reply.
>>
>>I'd be a bit reluctant to try an 'unusual' solution.
>>Is there some inherent problem in using Ocx in a pgr file.
>>Do they have to be used on a form.
>>If this is rhe case, I could instantiate a form in a Prg file but just never show it ??
>>
>>Regards,
>>Gerard
>>
>>
>>
>>>>hI bORISLAV
>>>>Ver 8
>>>>Regards,
>>>>Gerard
>>>>
>>>>
>>>>>>Hi.
>>>>>>I want to use an OCX in a .prg file (specifically Mscomm32.ocx)
>>>>>>All examples that I have seen use the Addobject to add it to a form.
>>>>>>Can I use this in a Prg file.... and would apprciate any pointers at to the syntax of the command
>>>>>>Tanks in advance
>>>>>>Regards,
>>>>>>Gerard
>>>>>
>>>>>What version of VFP?
>>>
>>>Try:
>>>
>>>
>>>x = NEWOBJECT("myclass")
>>>y = CREATEOBJECT([MSCommLib.MSComm])
>>>EVENTHANDLER(y,x)
>>>
>>>
>>>
>>>
>>>DEFINE CLASS myclass AS session OLEPUBLIC
>>>
>>>    IMPLEMENTS DMSCommEvents IN "c:\windows\system32\mscomm32.ocx"
>>>
>>>    PROCEDURE DMSCommEvents_OnComm() AS VOID;
>>>                 HELPSTRING "Occurs whenever the value of the CommEvent property changes."
>>>    * add user code here
>>>    ENDPROC
>>>
>>>ENDDEFINE
>>>
>>>
>>>Never tested such approach though.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform