Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM objects????
Message
From
16/08/2000 11:51:31
 
 
To
16/08/2000 11:36:32
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00405553
Message ID:
00405566
Views:
17
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform