PowerVB.com Home


Page 6

'Equivalent to Long12 = Long21

Page 7

Dim String1 As String
Dim String2 As String
Dim pString1 As Long
    String1 = "PowerVB"
    String2 = String$(7, 0)
    'These four operations all do the same thing

    'Try one: this requires a typelib CopyMemory declare
    CopyMemory ByVal String2, ByVal String1, 14

    'Try two: Use StrPtr to guarantee no ANSI/UNICODE munging
    CopyMemory ByVal StrPtr(String2), ByVal StrPtr(String1), 14

    'Try three: Get the string's pointer from VarPtr
    CopyMemory pString1, ByVal VarPtr(String1), 4
    CopyMemory ByVal String2, ByVal pString1, 14

    'Try four: Demonstrate VBoost.Assign instead
    VBoost.Assign pString1, ByVal VarPtr(String1)
    CopyMemory ByVal String2, ByVal pString1, 14

Page 20

'Output (Intel uses biglittle-endian integer layout)

Page 39
You can also calculate the element countsize by using the formula VBoost.UDif(VarPtr(elem(1)), VarPtr(elem(0))).

SafeArrays use a rowcolumn-major layout, unlike C++, which uses a columnrow-major layout.

Page 40
SafeArrayCreate takes an array of SafeArrayBound elements in rowcolumn-major (VB) order, but the descriptor itself stores the list in reverse order, which is really columnrow-major (C++) order.

Page 43
Second, if a reference supports an IID, the same IID must be supported by all references that the object returns.

Page 47
The QI that comes after the function call seems really bizarre because happens after the function returns. If the QI fails, then you will get a type mismatch error in the caller after the function has completed successfully. If the extra QI isn't enough to scare you away from such calls, the amount of code generated in order to handle them should be. In the case of ByVal calls, the AddRef/Release call happens in the callee, so there is no extra IUnknown work to be done by the caller. However, inIn the case of ByRef calls, the entire IUnknown burden falls on the caller, so theextra type checking code is generated everywhere the function is called with a mismatched type.

Page 98
The native interfaces supported by Class2 are not wrapped, and the _Class1 interface supported by _Class1 is wrapped with a blind delegator that makes it act like a native part of Class12.

Page 116

    Set Child = InternalChildChildInternal(Index).GetExternalChild

Page 122
most-common values hidden in VBoostTypesObjCreate.

Page 154

    If m_PrevCursor <> vbHourGlass Then

Page 157

            .pVTablem_pVTable = VarPtr(.VTable(0))

Page 158

    StringFromGUID2 pguid, StrPtr(GuidString)

Page 209

Dim strGuid As String * 38
    StringForromGUID2 _

Page 239

    QuickSort VarPtr(Strings(LBound(Strings)), _
      UBound(Strings) - LBound(Strings) + 1, _
      4, AddressOf CompareStrings

Page 244
stack pointerframe before prolog (ebp points here)

Page 252

Public Function InIDE() As Boolean
    Debug.Assert Not TestIDE(InIDE)On Error Resume Next
End Function    Debug.Assert 1 \ 0
Private Function TestIDE(Test As Boolean) As Boolean    InIDE = Err
    Test = TrueOn Error GoTo 0
End Function

Page 271
Base object is both the controlling IUnknown and the delegator fordelegatee of the wrapped object.

Page 285
ART = QS * b(QSb + 1) / 2 * Slice * PCO * b(1 + bTO / QSb)b

Page 297

        CopyMemory WD, CacheWD, LenB(CacheWD)
        CacheWDm_Workers.Remove strKey

Page 303

  ByVal ReturnDataPtr As Long) As Long

    If fDoIncrement Then

Page 304

        If Not IsEmpty(m_ReturnData) Then

T:If Not IsEmpty(m_ReturnData) Then

Page 305

T:If Not IsEmpty(m_ReturnData) Then

Page 306

Public Function DoStuff(Data As Variant, _
  Data As Variant, ByVal ProgressPtr As Long, ByVal ReturnDataPtr As Long, _
  ByVal ReturnDataPtr As Long, ByVal CritSectPtr As Long) As Long

'ThreadData class., also pass Parent.CritSect to DoStuff

        If Not IsEmpty(m_ReturnData) Then

Page 307

T:If Not IsEmpty(m_ReturnData) Then

T:If Not IsEmpty(m_ReturnData) Then

Page 313
Second, it owns a handle to the callingworker thread.

Page 374

        For iFields = 0 To _
                   .TokenizeLines(strLine, iStoppedAt, strFields) - 1

Page 394

    If cBytes > 3876 Then cBytes = 3876
    CopyMemory FLSF.TheString(0), ByVal strData, cBytes

Page 407
Although the IRecordInfo is needed only for marshaling, thereto store a record in a Variant and to marshal an array. There is no way to know if marshaling will be required an array will be marshalled when the array or Variant it is created.

Page 453

Dim pDst As Long, pSrc As Long
'(void*)pDst = (void*)pDstpSrc

Page 463
adDelayDontCacheResolved stops the aggregator from keeping the resolved reference, so IDelayCreation_Create iscan be called multiple times for multiple requests for the same IID. No request is made even if a reference for thisthe IID is currently in use.

This list contains only technical errors. For a more extensive error list, see Exhaustive Corrections.