Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I modify an ActiveX method in code only!

Status
Not open for further replies.

JoeMajestic

Programmer
Oct 25, 2000
6
US
Our development team needs to use a FTP-client ActiveX control that requires us to modify one of its methods. The problem is that we writing this as a COM object and there will be no forms to contain the control. So how do we programmatically access one the controls methods without using a form?
 
If you mean modify as in edit code the only function I know of is COMPILE with SP3 for v6 or Randy Pearson's CodeBlock. I know of no way to change code in a COM object w/o bringing it down and recompiling. But I do know if you will need to be changing the code and dont want to bring it down you can call a compiled PRG from that method which can be can be edited and recompiled one of the above command/utiility. Check out Rick Strahls articles section like his FoxISAPI one at He has werestled with this much

John Durbin
john@johndurbin.com
MCP Visual FoxPro

ICQ VFP ActiveList #73897253
 
Hi Joe,

Because you dont want to have a form, using the OleControl isn't an option because it has to exist within a form. In this context, I would recommend you take a look at VFPCOM.DLL. If all you need is to add code to a method of the control, VFPCOM will allow you a viable solution via its BindEvents method.

You can get the DLL from here:

Personally, I don't use VFPCOM because it takes 3 objects in memory just to manage the ActiveX object: the ActiveX object(instantiated as a COM object), the VFPCOM object that binds the objects, & the sink object that houses your method code.

This is my preferential way to do it.
If you feel you need to use the OleControl or you dont want to manage VFPCOM, try this(example with MSComm ActiveX control):

DEFINE CLASS myform AS Form
ADDOBJECT oMsComm As MsComm

PROCEDURE oMsComm.OnComm() && this can go here
***Your method code here
ENDPROC
ENDDEFINE

DEFINE CLASS MsComm As OleControl
OLECLASS='MsCommLib.MsComm'

PROCEDURE OnComm() && or it can go here
***Your method code here
ENDPROC
ENDDEFINE

Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,

When All We Want Is Unity. - Creed
 
Thanks for the advise Jon. Our team will explore your suggestions and post our results to this thread.

joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top