Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IMPLEMENTS Question
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01156711
Message ID:
01156746
Views:
20
I don't see how the PROGID would be consistant as the controls could each be
in a different OCX file.

Also, the VFP class that is bound to it would have to have methods with the class
names in them, as in the code below. The OCX class name is part of the method names.

Therefore, I don't see how VFP could use a single class that would bind to any of the
CV classes, even if they had the same interface.

I'm open to suggesstion.
DEFINE CLASS myclass AS session OLEPUBLIC

	IMPLEMENTS _rptAccountStatus IN "NSAcctStatus.rptAccountStatus"

	PROCEDURE __rptAccountStatus_PassArray(aHeaders AS VARIANT @, aValues AS VARIANT @) AS VOID
	* add user code here
	ENDPROC

	PROCEDURE __rptAccountStatus_RunReport() AS VOID
	* add user code here
	ENDPROC

	PROCEDURE __rptAccountStatus_ReportCancelled() AS VOID
	* add user code here
	ENDPROC

ENDDEFINE
<pre>





>A better way to do this is to use a PROGID instead of a path. The PROGID should be consistent.
>
>But... I also seem to remember that if you use a filename that filename is not really required at runtime. This is a compile time setting that VFP uses to internally implement the interface. Once the interface has been created and compiled the file name is not used for anything.
>
>I ran into something similar here the other day when I tried to compile Help Builder which has an Implements for the HTML Help 2.0 compiler. I hadn't yet installed the Help 2.0 compiler on this particular install and Help Builder would simply not compile. Similar issue. Once compiled the class runs just fine on another system if the Help 2.0 compiler doesn't exist. I used a PROGID but I think the same is true for the physical filename.
>
>+++ Rick ---
>
>
>
>>I have a VFP class that will implement VB ActiveX control interfaces to handle their events.
>>The VB ActiveX control being used could be different each time the class is run Each of the
>>ActiveX controls will have the same public interaface.
>>
>>Is there any way to dynamically fill in the control name and control library in the
>>IMPLEMENTS statement:
>>
>>
>><pre>
>>
>>PUBLIC &gcControlName, gcControlLibrary
>>gcControlName 		= "__rptAccountStatus"
>>gcControlLibrary 	= "d:\demo\nsacctstatus.ocx"
>>
>>
>>DEFINE CLASS RPTControlEvents AS session OLEPUBLIC
>>
>>	** Inherit the interface of the VB ActiveX report control
>>**	IMPLEMENTS __rptAccountStatus IN "d:\demo\nsacctstatus.ocx"
>>	IMPLEMENTS (&gcControlName) IN (gcControlLibrary) && This fails
>>
>>ENDDEFINE
>>
>>Thanks
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform