PUBLIC oMain oMain = CREATEOBJECT('main') oMain.Show() READ EVENTS DEFINE CLASS main AS form Name = "Main" Desktop = .T. ShowWindow = 2 DoCreate = .T. ADD OBJECT oTcpIp AS tcpip_server WITH ; Visible = .F. : : ENDDEFINE DEFINE CLASS TCPIP_Server AS olecontrol Name = "TCPIP_Server" OleClass = 'Server.MyServer' : : ENDDEFINEThis works fine but priodically the OLE hangs and I need to be able to destroy the object and recreate it. (it's a little temperamental).
oMain.RemoveObject('oTcpIp') oMain.AddObject('oTcpIp', 'tcpip_server')I get an Object Name is invalid error. The same happens when I use an empty container as my class. When I look in the debugger after the 'RemoveObject' I see that the object has not been destroyed (i.e. not removed).