Issue with writing byte array to a file

前端 未结 2 1651
伪装坚强ぢ
伪装坚强ぢ 2021-01-18 10:05

Under windows, when Evernote is installed, an api is also installed, which can be accessed through vba (for example).

Each notes can show its \"Resources\" (attached

2条回答
  •  清酒与你
    2021-01-18 10:47

    In VB6, there’s a mysterious extra 12 bytes prepended to the content that is saved. Why? Because you saved the Variant structure as well as the contents of the Variant.

    You need to "copy" the Variant content to Byte array, for example:

    ReDim arrByte(0 To UBound(varBuffer) - LBound(varBuffer))
    
    For i = 0 To UBound(varBuffer) - LBound(varBuffer)
      arrByte = varBuffer(i + LBound(varBuffer))
    Next i
    

提交回复
热议问题