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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Memory problem with StringArray?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ahuemm

Germany
Posts

Posted - 11/16/2005 :  4:33:50 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

cpyang

USA
1406 Posts

Posted - 11/16/2005 :  8:52:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This must be the limitation of GetMultiOpenBox, not the limitation of StringArray.


CP


Go to Top of Page

ahuemm

Germany
Posts

Posted - 11/17/2005 :  01:14:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I don't think so. But I'll check today.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/17/2005 :  08:54:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

ahuemm

Germany
Posts

Posted - 11/17/2005 :  1:17:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000