|
-
Jul 9th, 2013, 07:59 PM
#10
Re: VB6 - Convert Variant to Node
 Originally Posted by fstephane
It just says empty. Aren't For Each elements always Variant?
Yeah - sure ... IEnumVariant::Next returns a Variant and choosing a VB-Variant as the Loop-Variable is a decent and fast way to go about For-Next-stuff,
especially when one is not yet sure, what "final casts" will be applied to the LoopVar.
But when it just says "Empty" - then ndArray obviously just contains empty variants (an empty Variant is a Variant, which has all 16 Bytes, all 128Bits at Zero).
Code:
Dim LoopVar As Variant, VArr(0 To 2) As Variant
'since nobody filled anything into the 3 Index-Slots of VArr, the
'SafeArray-DataAllocation (all of the 3*16Bytes) remain still initialized to Zero
For Each LoopVar In VArr
Debug.Print TypeName(LoopVar)
Next
So in your shoes, I'd start investigating, what happened to your ndArray "along the way", since in this place
and "at this time" (the time of the enumeration) I cannot really imagine, that your debugger will tell you something,
which is not identically reflected also in the Debug.Print TypeName(...) call.
Olaf
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|