foreach, like the C++11 range-for, works on a container, i.e. an object of a class that provides STL-style iterators.

QAxObject does not have those.

You could use assignment-in-condition if you want to have something like
Qt Code:
  1. for (int i = 0; (MyFrame = MyFrames->querySubObject("Item(Int32)", i)) != 0; ++i) {
  2. // ....
  3. }
To copy to clipboard, switch view to plain text mode 

Cheers,
_