Ken: Well, I spent the day on this and concluded nothing worked! 1. I know the name of the VCX because they are stored in a folder and I build a combobox of their names for inclusion on the primary form. This way I can add more as needed and not send the entire EXE. The receive methods writes the VCX in the correct folder. Then when the main form is executed the combobox is built with the found VCX files. 2. Setting the default folder and other paths are set in the start.prg. In the user's box the needed form is never executed from the VCX. But on my box it does because the SCX is present in the folder. It doesn't make sense to me because the form is compiled in the EXE. And all other forms execute when selected. Perhaps this is bug in VFP6 which is the version currently in use. Eventually I will convert it all to VFP9 when I get a chance to breath... 3. I tried saving the second form that is needed as a class and included that in the project for compilation. It still did not work when I added the class to the main form. The error message that the class did not exist. The variable VCXs are not known to the exe and change on the fly from the folder where they are stored. They all work as expected. When I try to launch an SCX from that VCX the error is the form does not exist even though it is compiled in the EXE. So I stopped messing with all of this and included a container in the VCX that needs to call the SCX. The container now has all of the objects it needs to work as part of the VCX and it works as expected except for the fact that there is a duplicate set of objects as other forms in the system call the second SCX and they all work as expected. I guess I am missing something on how to make this work. But I am out of time and need to keep moving. Thanks for your help and insight. I did try what you mentioned. Best regards, Jack
Jack Skelley Senior Director, Programming/Computer Operations New Jersey Devils (973)757-6164 [email protected] ________________________________________ From: ProfoxTech [[email protected]] on behalf of Ken Dibble [[email protected]] Sent: Monday, March 03, 2014 11:11 PM To: [email protected] Subject: Re: Running a form from a VCX >I want to be able to send a VCX when needed and not have it part of the >actual program. I don't think I fully understand what you are trying to do, but I have a few thoughts: 1. You mentioned using NewObject to instanciate the vcx. Well, in order to use NewObject, you have to know the name of the vcx. So if you're going to call the NewObject() method in a form that's part of the exe, you already know the name of the vcx and it's hard-coded into the form, right? In that case, why bother excluding the actual vcx from the project? 2. You mentioned that this works in the IDE because you have the scx present. VFP pathing looks inside the exe first for things, and then outside the exe in the same folder where the exe is next, and then in places that you specify with SET PATH. If you have a form called MyForm.scx that's built into the exe, then when you instanciate MyForm VFP wants to use that built-in scx. If you also have a form class called MyForm built into a vcx that's NOT in the exe, then VFP will never use it because it will always find the built-in MyForm.scx in the exe first. Does that make sense? 3. If you have a scx form, you can save it as a class in any vcx you choose by using the Save As Class... option in the File Menu when you have the scx form open in the Form Designer. So yes, the form can be part of the vcx. Not sure how that helps you though if you can't access the vcx from within your program. I only know of three ways of using a vcx in an executable program: 1. Add the vcx to the project and include it so it gets built into the exe. Then NewObject() can find it as long as you specify the name of the vcx as part of the call. 2. Add the vcx to the project but exclude it so you can ship it (and modify it) separately from the exe. NewObject() will still work. 3. Use SET CLASSLIB ... ADDITIVE somewhere in your main program. This eliminates the need to use NewObject() and tell VFP the name of the vcx. But the library has to be included in the project (and may have to be included in the exe, though I'm not sure about that). In short, I don't think there's any way you can introduce a vcx to an application and have it work without the exe knowing about its existence in advance. And if the exe already knows it exists, you can certainly include it in the project, even if you exclude it from the exe so you can modify it separately. But I'm probably missing something. Ken Dibble www.stic-cil.org [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/7d9e7f72b813014c8fd022cf04f820edede3b...@ex08.drdad.thenewarkarena.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

