Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Removing *.* as an option from the OpenFileDlg()

Removing *.* as an option from the OpenFileDlg()

Discuss PocketC for CE (including Desktop Edition)

Postby FurFuznel on Fri Oct 18, 2002 5:49 pm

Hello everyone;

I am writing a program that allows the user to open a files of specific types and as such I use the following line:
file_name=OpenFileDlg("First file type (*.sp)|*.sp|Second file type (*.gp)|*.gp");
Unfortunately (from my point of view ;) ) this still provides the user with the All File (*.*) option. Is there anyway to make it so that the *.* option is not available to the user?

FurFuznel

===========================
"Mental Anguish is for those who choose to think!" - FurFuznel
===========================
"Mental Anguish is for those who choose to think!" - FurFuznel
FurFuznel
 
Posts: 16
Joined: Tue Apr 16, 2002 8:21 pm
Location: Canada

Postby guy on Sat Oct 19, 2002 8:43 am

The *.* option shouldn't be there unless you put it there!

I suggest that you bypass the PocketC OpenFileDlg() function and call the GetOpenFileName() function directly. That way you can avoid all of the odd default things that the PocketC function does before calling it.


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby FurFuznel on Tue Nov 05, 2002 2:15 pm

Well, now I must show my utter lack of knowledge about what I am doing!

How do I set up the structure that needs to be passed into the GetOpenFileName(lpofn) function call? What I am asking specifically is what is my variable definition to create lpofn?

Is it something like:

lpofn openfileoptions;

or is it something else?

{sigh} my ignorance slows me down.

FurFuznel

===========================
"Mental Anguish is for those who choose to think!" - FurFuznel
===========================
"Mental Anguish is for those who choose to think!" - FurFuznel
FurFuznel
 
Posts: 16
Joined: Tue Apr 16, 2002 8:21 pm
Location: Canada

Postby guy on Tue Nov 05, 2002 9:00 pm

There is an example program called commdlg.pc included in the CEAPI distribution. This demonstrates calling the open file, the colour and the print dialogues.

The open file portion of the code follows:

<pre id="code"><font face="courier" size="2" id="code">


#include "/pocketc/commdlg.h"


main() {


HWND hWnd ; // Window handle for main window
HINSTANCE hInstance ; // Application instance
OPENFILENAME rFile ; // Open file dialogue parameter structure


title("Commdlg") ;


// Need the main window handle to define the owner of the dialogue boxes
// Get the application hInstance for completeness


hWnd = gethwnd(1) ; // Get main window handle
hInstance = gethinstance() ; // Get application instance


confirm("Testing open file dialogue") ;


// Set up an OPENFILENAME block
// Note that filter string definition is amended for PocketC to use | as delimiter, not null


rFile.lStructSize = 0 ; // Set by CE API interface so we don't need to
rFile.hwndOwner = hWnd ;
rFile.hInstance = hInstance ;
rFile.lpstrFilter = "All files|*.*|PocketC Files|*.pc|PocketC headers|*.h|Text files|*.txt" ;
rFile.lpstrCustomFilter = "" ; // Not supported on CE
rFile.nMaxCustFilter = 0 ; // Not supported on CE
rFile.nFilterIndex = 2 ; // Initial filter option to use (from 1)
rFile.lpstrFile = "*.pc" ; // Default file name, returned file name
rFile.nMaxFile = 256 ; // Max allowed length for name (in chars)
rFile.lpstrFileTitle = "" ;
rFile.nMaxFileTitle = 256 ;
rFile.lpstrInitialDir = "\\PocketC" ; // Initial directory to display
rFile.lpstrTitle = "Choose a file" ; // Prompt to display
rFile.Flags = OFN_FILEMUSTEXIST; // Options flags
rFile.nFileOffset = 0 ; // Returned offset to start of name
rFile.nFileExtension = 0 ; // Returned offset to .ext
rFile.lpstrDefExt = "tst" ; // Default extension to add if none entered
rFile.lCustData = 0 ; // Parameter to hook proc
rFile.lpfnHook = NULL ; // Hook proc not supported
rFile.lpTemplateName = "" ;


if (GetOpenFileName(&rFile)) {
confirm("Result was " + rFile.lpstrFile) ;
} else {
confirm("No file was selected") ;
}
}


</font id="code"></pre id="code">




Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby FurFuznel on Wed Nov 06, 2002 11:32 am

Wow! I must admit that you are an amazingly helpful person! 8) Thank you yet again for your help with my lack of programming knowledge!

FurFuznel

===========================
"Mental Anguish is for those who choose to think!" - FurFuznel
===========================
"Mental Anguish is for those who choose to think!" - FurFuznel
FurFuznel
 
Posts: 16
Joined: Tue Apr 16, 2002 8:21 pm
Location: Canada


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron