Re: convert string to byte array
From: Patrick Cohan (patrickc_at_poly-tex.com.NO_SPAM)
Date: 02/05/04
- Next message: Karl E. Peterson: "Re: convert string to byte array"
- Previous message: Karl E. Peterson: "Re: ULONG to Visual Basic 6"
- In reply to: Logan McKinley: "convert string to byte array"
- Next in thread: Karl E. Peterson: "Re: convert string to byte array"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 5 Feb 2004 11:35:27 -0600
Compare:
> CaptureString = StrConv(code, vbFromUnicode)
VS.
CaptureString(index) = StrConv(code, vbFromUnicode)
That jumped out at me at first glimpse...see if that helps.
"Logan McKinley" <logan@globalweb.net> wrote in message
news:OCRap0A7DHA.452@TK2MSFTNGP11.phx.gbl...
> I have found two methods that should work but both return errors.
> First method:
> Const MaxCaptureData = 2000
> Dim CaptureString(MaxCaptureData) As Byte
> Dim code As String
> code = "���?�" 'this is just part of what the real
> code would be
> CaptureString = StrConv(code, vbFromUnicode)
> '-------------------
> this returns Compile error: Can't assign to array
>
> Second method:
>
> Const MaxCaptureData = 2000
> Dim CaptureString(MaxCaptureData) As Byte
> Private Declare Sub CopyMemory Lib "kernel32" Alias _
> "RtlMoveMemory" ( _
> hpvDest As Any, _
> hpvSource As Any, _
> ByVal cbCopy As Long)
>
> Dim code As String
> code = "���?�" 'this is just part of what the real
> code would be
> CopyMemory CaptureString, ByVal code, Len(code)
> '----------------------
> this returns Compile error: Type mismatch
>
> I assume i am doing something stupid in both cases,
> Thanks in advance,
> ~Logan
>
>
>
>
- Next message: Karl E. Peterson: "Re: convert string to byte array"
- Previous message: Karl E. Peterson: "Re: ULONG to Visual Basic 6"
- In reply to: Logan McKinley: "convert string to byte array"
- Next in thread: Karl E. Peterson: "Re: convert string to byte array"
- Messages sorted by: [ date ] [ thread ]