Fabio,
There is a problem here, but I'm not sure what it is. However, there is some problem with the code you present.
First,
This.MyObject = m.MyObject
never will be true. When comparing objects, always use the COMPOBJ() function. For example,
oFSO = CREATEOBJECT('Scripting.FileSystemObject')
oFSO1 = CREATEOBJECT('Scripting.FileSystemObject')
? oFSO = oFSO1 && Returns .F.
? COMPOBJ(oFSO, oFSO1) && Returns .T.
Second, you never check for NULL. If NULL is a possibility, as it is in the code you present, then you must check for that.
As a result, the line reading
IF m.THIS.myObject=m.myObject
should be changed to
IF NOT (ISNULL(this.MyObject) OR ISNULL(m.myobject)) AND COMPOBJ(This.MyObject, m.myObject)
However, while it does not generate a C5 error, the command button does disappear. As to why, I don't know.
George
My example does not use COM objects.
Please, not to create useless confusion.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only