Hi Geoff,
>
Why is this???When you create a COM DLL, this DLL is loaded into a separate instance of VFP. It's not in a different process, but it has itw own copy of the runtime environment.
Hence, in your sample, you are dealing with two instances of VFP that don't know anything about each other. When you call the DLL passing the form reference, VFP wraps it into a COM reference and passes it to the DLL. However, the form still resides in the main application and any action on the form are executed inside the main application, not inside the DLL. When the code gets to the AddObject line, the DLL calls the EXE and passes all parameters to the EXE. Inside the EXE, there's no Inter1.vcx, that library is inside the DLL. Therefore you get the error message. AddObject() doesn't work across COM servers. There's no way around adding Inter1.VCX to your main application, as well.
Christof
--
Christof