Τρίτη 2 Μαΐου 2023

Revision 26 - Version 12

 A last correction for VBCollection module on info.gsb

Was a problem when we extract the _NewEnum object (which for vbCollection is of type IUnknown, which M2000 can't handle as is). Some older versions works fine but later a missing set of an object cause the return of a long variable and not Nothing, which is ok, because the actual object isn't of type IDispatch , so it's saved in a separete variable of type Variant, which can hold IUnkown objects, and all of that goes to a hidden mHandler object. So the fault revisions return long (and not the mHandler object).

So the revision 26 has only one new line of code: Set robj = usehandler in line 538, on mdllDispatch module.

Here is a simple program which we use the enum object Item (fault programs return Item as long with value 0 so the While Item not execute the following block of code.

declare c collection
Method c, "Add", 100
Method c, "Add", "Hello"
Method c, "Add", 300
Method c, "count" as count
Print count
Method C, "_NewEnum" as Item
List
Print type$(Item)="Nothing"
k=0
While Item {
      k++
      print k, eval(item)
}
Method C, "_NewEnum" as Item
Print type$(Item)="Nothing"
k=0
While Item {
      k++
      print k, eval$(item)
}


Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου

You can feel free to write any suggestion, or idea on the subject.