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



_______________________________________________
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/[email protected]
** 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.

Reply via email to