Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can anyone explain How COM really works
Message
From
25/05/1999 23:23:15
Charlie Davies
McIntire School of Commerce
Virginia, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00222750
Message ID:
00222777
Views:
23
Hi,

One thing COM is really useful for is storing business rules in a middle tier for web development. A scenario for useful COM use is as follows:

You want to develop a web page that will allow users to enter a data interface application based on security priviledges. You have the user's name and their passwords stored in a foxpro table. On the log in form, you give the user a place to enter their user name and password. After the user enters their name and password and they hit the submit button, you make a call to a COM object you have built in VFP with the following syntax:

define class clssecurity as custom ole public

procedure securitycheck
lparameters username, password

insert appropriate code here

endproc

enddefine

When you build a COM object, the easiest way is to create a new project, create a program within the project where you will put in the define class code above.
When you build the project, make sure you check the "Build OLE DLL" option. It will ask you to name the dll, so name it whatever you want. When you have named it and said OK, the COM object gets registerd into the system. If you name it my security, you will instantiate your security COM object by using the following syntax:

myCOMobject = createobj('security.clssecurity')
and you can reference the securitycheck procedure by:
myCOMobject.securitycheck(username, password)
Depending on the web development tool your planning to use, the syntax will change. The above code is suitable for calling your COM object from within VFP. Try it in VFP just to get a sense of what's happening.

If you want to see your COM obect in the registry, choose Start -> Run and type in regedit. Go to edit -> find and type in 'security.clssecurity', hit OK and it will take you where you want to go.
Hope this is helpful.



>Hi Patrick,
>
>You may want to take a look at Microsoft's COM White Papers at: http://www.microsoft.com/com/wpaper/default.asp
>
>>I would really like to get a hand on COM, how does it really work and what are the benefits of using it.
Previous
Reply
Map
View

Click here to load this message in the networking platform