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
 Cancel FindFiles
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 05/30/2006 :  08:57:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): Origin 7.5SR6
Operating System: Win2000

Hi,

I'm using FindFiles to list all files of a particular type in a folder but one problem is that when I/users click 'Cancel' it still returns all the file types.

I use eg

FindFiles(AllFiles, PathBuffer, "xls");
AllFiles.Sort();
int NumPlates=AllFiles.GetSize();
int NumFiles=NumPlates;

How can I trap when the dialog is cancelled / closed without pressing OK?

Cheers,

pete

Edited by - peter.cook on 05/30/2006 09:04:06 AM

Mike Buess

USA
3037 Posts

Posted - 05/30/2006 :  09:43:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pete,

FindFiles does not generate a dialog so you must have asked for the extension earlier in your code.

Mike Buess
Origin WebRing Member
Go to Top of Page

peter.cook

UK
356 Posts

Posted - 05/30/2006 :  11:12:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

I was of course writing nonsense. I used getfile to select a file - this crashes out if I select cancel...should I be using GetOPenBOx then?

Cheers,

Pete

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/30/2006 :  11:41:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Might be easier since it returns the path as string. Then use if( strPath.IsEmpty() ) return.

Mike Buess
Origin WebRing Member
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