Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I tell if a COM object is running?
Message
 
 
To
05/06/2001 11:28:44
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00515028
Message ID:
00515154
Views:
19
Rex,
The COM server doesn't run until you instantiate it. It does not run if it is only compiled.

CreateObject() on a COM server needs to have a Project.ClassName structure if using the PrgID. If your project was MyProject and your class was ImpactCOM then try:

goApp=CREATEOBJECT("MyProject.ImpactCOM")

You can tell the actual project.classname if you go to Project - Project Info - Servers.

HTH.

>Vlad,
>
>Ok, back to basics.
>
>I thought that when you compiled the COM application into a DLL it automatically runs.
>
>Am I wrong?
>
>If so, how to you create the COM object? I tried:
>
> goApp=CREATEOBJECT("ImpactCOM")
>
>It didn't work
>
>TIA
>
>Rex
>
>>Hi!
>>
>>How do you run the COM object? Do VFP tells any error when you use 'CreateObject' command to create the COM object? It seems I do not understand what do you want to do.
>>
>>>Vlad,
>>>
>>>My COM object instantiates fine in VFP. FOPEN for my DLL return a file handle, so the DLL is NOT running.
>>>
>>>Any other ideas?
>>>
>>>TIA
>>>
>>>Rex
>>>
>>>>Hi!
>>>>
>>>>Yes, if that STRTOFILE calls work ok in design-tme mode from command window.
>>>>Try to create the object from design-time mode:
>>>>SET CLASSLIB (or SET PROCEDURE if your class in the PRG)
>>>>oo=createobject('MyComObject')
>>>>
>>>>Than test if it works as usual VFP object. In moset cases you will find a problem that way.
>>>>
>>>>HTH,
>>>>
>>>>>Vlad,
>>>>>
>>>>>I tried adding STRTOFILE commands in the COM's Init method. No files were created after compilation. Does this mean the COM object was not instantiated?
>>>>>
>>>>>TIA
>>>>>
>>>>>Rex
>>>>>
>>>>>>Hi!
>>>>>>
>>>>>>Try to open its DLL or EXE exclusively, something like FOPEN('...MyCOMObjectModule.DLL',12). This wa
>>>>>>If successful, you can be sure it is not used.
>>>>>>
>>>>>>As about running its code (working by taking the processir time) - cannot tell anything. Probably you can do that using API functions, but better to maintain some sort of flag in each function of the COM object. If flag is set, the object is running. Stroer also the time when flag is created to avoid situation with power off or crashes.
>>>>>>
>>>>>>HTH.
>>>>>>
>>>>>>>All,
>>>>>>>
>>>>>>>I have a COM object that should be running on my machine. How can I tell if this is the case?
>>>>>>>
>>>>>>>TIA
>>>>>>>
>>>>>>>Rex
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform