Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM objects????
Message
De
16/08/2000 11:51:31
 
 
À
16/08/2000 11:36:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00405553
Message ID:
00405566
Vues:
20
>Would someone be ever so kind and point me to a resource for creating COM objects? I have never dealt with these things and would like to know how to start

Create a project called "MyFirstCom." Create a PRG and call it whatever you want, then add this to it:
define class testclass as custom olepublic
	name = "testclass"
	function testmethod
	return "It works!?"
enddefine
Now, build the project and choose "Single THreaded DLL"

You've got a COM object. You can use this from VFP or other COM lanaguages (an ASP web page for example). To test it in VFP, do:

oCom = createobject('myfirstcom.testclass')
?oCom.TestMethod()


Here's a free artlce at FoxTalk: http://www.foxtalknewsletter.com/FT/FTMag.nsf/Index/4D3FE0B594827120852568CF00760F18?opendocument

For more reading, WestWInd.com has some articles for using VFP COMs with the Internet, http://www.microsoft.com/com/

Also, CoDe magazine is a good VFP resource for Windows DNA stuff, for example, loosely coupled COM+ events were covered int he first issue.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform