Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #2181

Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail
From Deanna Earley <dee.earley@icode.co.uk>
Newsgroups microsoft.public.vb.general.discussion, comp.lang.basic.visual.misc
Subject Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error
Date Mon, 27 Oct 2014 16:26:01 +0000
Organization Aioe.org NNTP Server
Lines 34
Message-ID <m2lrnn$f8p$1@speranza.aioe.org> (permalink)
References <m2aelp$t5s$1@speranza.aioe.org> <m2dlas$a3h$1@speranza.aioe.org> <m2lqr8$dcb$1@speranza.aioe.org>
NNTP-Posting-Host rjApkXnSOjrT83QpZ8fKqg.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Thunderbird/35.0a2
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.basic.visual.misc:2181

Cross-posted to 2 groups.

Show key headers only | View raw


On 27/10/2014 16:11, Blue Planet wrote:
> "Deanna Earley" <dee.earley@icode.co.uk> wrote in message
> news:m2dlas$a3h$1@speranza.aioe.org...
>> On 23/10/2014 09:35, Deanna Earley wrote:
>>
>> It turns out I'd accidentally introduced a Data = "" in the source
>> function that triggered the error as opposed to the original
>> undimensioned array which correctly returns an empty string.
>> It must have been pure luck that I've not noticed it breaks with an
>> explicitly empty array until now...
>> Thanks for everyone's comments.
>
> Glad you found it.
>
> This is one of the downsides of the "empty" vs. "unallocated" dynamic
> Byte array.  It would be nice if this didn't occur, however the
> "assignment of an empty String" trick itself was probably an unintended
> (those otherwise quite handy) side-effect.

True.
I settled for replacing all StrConv(..., vb(From)Unicode) with two 
custom functions that range check the input(both for undimensioned and 
zero length) that call MultiByteToWidechar() and WideCharToMultiByte().
This also allows me to force them to latin1, UTF-8, etc where required.

-- 
Deanna Earley (dee.earley@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be printed, shredded then fed 
to the rats. Please reply to the group.)

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Deanna Earley <dee.earley@icode.co.uk> - 2014-10-23 09:35 +0100
  Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Arne Saknussemm <motz001.20.wannabet@spamgourmet.com> - 2014-10-23 10:39 +0200
    Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Deanna Earley <dee.earley@icode.co.uk> - 2014-10-23 11:46 +0100
      Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Arne Saknussemm <es215.10.wannabet@spamgourmet.com> - 2014-10-23 15:09 +0200
        Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Deanna Earley <dee.earley@icode.co.uk> - 2014-10-23 14:28 +0100
  Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error "Farnsworth" <nospam@nospam.com> - 2014-10-23 08:04 -0400
    Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error "Farnsworth" <nospam@nospam.com> - 2014-10-23 08:35 -0400
  Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error "Farnsworth" <nospam@nospam.com> - 2014-10-23 11:48 -0400
    Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Deanna Earley <dee.earley@icode.co.uk> - 2014-10-24 09:47 +0100
  Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Deanna Earley <dee.earley@icode.co.uk> - 2014-10-24 14:47 +0100
    Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Arne Saknussemm <es215.10.wannabet@spamgourmet.com> - 2014-10-27 12:32 +0100
      Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Deanna Earley <dee.earley@icode.co.uk> - 2014-10-27 12:14 +0000
        Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Arne Saknussemm <motz001.20.wannabet@spamgourmet.com> - 2014-10-28 11:22 +0100
    Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error "Blue Planet" <sorry@nospamme.org> - 2014-10-27 12:11 -0400
      Re: StrConv(ByteArray, vbUnicode) raising an "Out of memory" error Deanna Earley <dee.earley@icode.co.uk> - 2014-10-27 16:26 +0000

csiph-web