Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Assistance With ActiveX In VFP
Message
From
26/09/2006 02:45:45
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01157136
Message ID:
01157153
Views:
15
Hi,

"All the VB portion needs to do is pass arrays of parameter info to the VFP form, so that they can be passed on to the Crystal Report.
Problem is, for every VB control they create, there would have to be a VFP class that binds
to it and implements it's interface. I'm seeing that this probabaly won't work overall."

You only need to implement event interfaces!
So if the VB ActiveX controls don't raise events, you won't need to code a VFP class to catch these events.

"What would work is if there was a way for the VB ActiveX control to directly call methods on the VFP form. Then the controls could simply pass they parameter arrays directly to the VFP form."

The other way round would be simpler, say you tell them that their ActiveX control must implement a method named "GetParameters".

DEFINE CLASS yourPrintForm AS Form

FUNCTION Init(lcClass)
THIS.AddObject('loControl', ,lcClass)
ENDFUNC

FUNCTION Release()
LOCAL laParams[1]
COMARRAY(10,THIS.loActiveX) && by reference and 0 based
THIS.loControl.GetParameters(@laParams)
&& store the parameters somewhere ...
ENDFUNC
ENDDEFINE

"I'm not sure if ActiveX control can call methods on a VFP form, and if so, I don't know the syntax."

You can code a "parameter COM" object in VFP which you pass to the VB ActiveX control e.g.

DEFINE CLASS oPrintParams AS Session OLEPUBLIC
Duplex = .F.
CopyCount = 1
&& etc.
ENDDEFINE

Create an instance of this VFP COM object in your form and pass it down to a specified method the VB ActiveX has to implement, e.g. SetParameterObject(loObject). The VB ActiveX would save the object reference in SetParameterObject method into an property of its own and could later change the invidial properties directly.

You could also let them code their entire modal dialogs, the only thing you must agree on is a set of function/property names each control has to implement so that you're able to set/get the printing parameters.

Christian
Previous
Reply
Map
View

Click here to load this message in the networking platform