define class Application as Session OLEPublic protected ROTServer as Object function Initialize() as Boolean this.ROTServer = RotServer() && To copy what you have in MAIN.PRG, I would use newobject instead && ROTServer is the PRG and should be accessible this.ROTServer.Register(this, 'Test.Application') endfunc procedure Destroy() as VOID this.ROTServer.Revoke('Test.Application') this.ROTServer = null endproc enddefineYou should remember to call Initialize() inmediately after the creation of the object
loTest = createobject('Test.Application') loTest.Initialize()I think that is all you need, I can't be 100% sure for I changed some things that were in the original to adapt it to my base COM class, and, as I said, I have some code scattered around, but, I am quite sure that if this is not correct it should give you a starting point. Also do not trust in the code I put, I just wrote it in here, not much checking <g>