The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Memory problem with StringArray?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ahuemm Posted - 11/16/2005 : 4:33:50 PM
Origin Version (Select Help-->About Origin): 7.5G SR3
Operating System: w2k

Dear forum,
When I try to add more than 543 filenames to a StringArray, it doesn't work and the
array is just empty. With 543 it works fine, if I select one more file it doesn't work
anymore. Can anyone explain to me that strange behaviour?

Here's some code:

int iNumSelFiles;
StringArray saFiletypes, saFilePaths;

// ask user for the files to import
saFiletypes.SetSize( 2 );
saFiletypes[0]="[data (*.txt)] *.txt";
saFiletypes[1]="[all (*.*)] *.*";
iNumSelFiles = GetMultiOpenBox( saFilePaths, saFiletypes );

Cheers Armin
4   L A T E S T    R E P L I E S    (Newest First)
ahuemm Posted - 11/17/2005 : 1:17:12 PM
You were right, cpyang.

I worked around that by selecting a directory now and simply import all files in there (this was basically what I wanted to do).

Thanks for the explanation Mike.
Cheers Armin
Mike Buess Posted - 11/17/2005 : 08:54:52 AM
I use (successfully) StringArrays with thousands of elements and agree that the problem must be with GetMultiOpenBox. If all files are in C:\Temp\ you can test StringArray with this...

string strPath = "C:\\Temp\\";
StringArray saFiles;
FindFiles(saFiles,strPath,"txt");
out_int("nFiles=",saFiles.GetSize());
out_string("last file="+saFiles[saFile.GetSize()-1]);

...The Release Notes for Origin 7.5 SR5 lists the following fix:
quote:
The Origin C GetMultiOpenBox method now works correctly to open multiple files. An internal buffer size has been increased to allow more files to be selected. (ID 5957)


Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 11/17/2005 09:03:23 AM
ahuemm Posted - 11/17/2005 : 01:14:06 AM
I don't think so. But I'll check today.
cpyang Posted - 11/16/2005 : 8:52:21 PM
This must be the limitation of GetMultiOpenBox, not the limitation of StringArray.


CP



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000