>I finally found something working. I created this function in the main EXE:
>
>
>* Create an object of a sub class as this is not possible from a COM environment
>* when the main class is in the framework
>* expC1 Name of the class
>FUNCTION CreateObjectMain
>PARAMETERS tcClass
>LOCAL loClass
>loClass=CREATEOBJECT(tcClass)
>RETURN loClass
>
>
>Then from the sub EXE:
>
>
>loList=CreateObjectMain('News')
>
>
>But, in order for this to work, I had to move the class library from the sub EXE into the main EXE and issue the SET CLASSLIB for that class library in the main EXE as well. So, whenever I have to modify one of those classes, I have to recompile the main EXE. But, at least, I can preserve the actual infrastructure of all other entities that are ready to be updated from the sub EXE. I tried to avoid that but, even when being called from this function, the CREATEOBJECT() was not working if the class library was not included in the main EXE.
Michel,
A long thread so this might have already been said. Would this one work?
Function GetObjectFromExternalExe
lparameters tcClass,tcClasslib,tcAppModule
return NewObject(tcClass,tcClassLib,tcAppModule)
endfunc
ie:
* Test
loTest = GetObjectFromExternalExe('testclass','xtern.exe','')
loTest.SayHello()
xtern.exe - a single prg:
DEFINE CLASS testclass as Custom
PROCEDURE SayHello
MessageBox("Hello from external exe to "+Application.ServerName)
endproc
enddefine
Cetin