This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Portable File Selector (PC & PPC)


Portable File Selector (PC & PPC)

Postby Andrea » Mar 14, 2003 @ 4:55pm

Andrea
 


Postby ppcStudios » Mar 14, 2003 @ 8:08pm

User avatar
ppcStudios
pm Insider
 
Posts: 744
Joined: Aug 23, 2002 @ 3:53pm
Location: Canfield, Ohio


Postby Andrea » Mar 14, 2003 @ 8:59pm

Andrea
 


Postby damian » Mar 14, 2003 @ 9:54pm

You can use the standard Win32 API for that... that'll make it work well and be portable.
damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Portable

Postby warmi » Mar 14, 2003 @ 10:37pm

warmi
pm Insider
 
Posts: 518
Joined: Aug 24, 2002 @ 8:07am
Location: Chicago USA


Postby Andrea » Mar 15, 2003 @ 3:47am

I've tried this and it works fine on my PC. Unfortunately, it refuses to compile for my Pocket PC.
Could somebody help me? I think I use a part of the Win32 API that is not supported under WinCE...
Thanks

OPENFILENAME ofn;
char szFileName[MAXPATH] = "";

ZeroMemory(&ofn, sizeof(ofn));

ofn.lStructSize = sizeof(ofn);
//ofn.hwndOwner = hwnd;
ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAXPATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = "txt";

if(GetOpenFileName(&ofn))
{
//..
}
Andrea
 


Postby Sm!rk » Mar 15, 2003 @ 5:10am

User avatar
Sm!rk
pm Member
 
Posts: 172
Joined: Dec 16, 2002 @ 4:40pm


Postby damian » Mar 15, 2003 @ 7:01am

Another problem is that you need to have your strings in unicode for WinCE.

By portability, I meant that it works both in WinCE and normal Windows.

In case you're still having problems, check this page out:
)again, remember you'll need to modify everything there for unicode)
damian
pm Insider
 
Posts: 3960
Joined: Sep 3, 2002 @ 7:59pm
Location: Acton, MA (home), NYC (school)


Postby Andrea » Mar 15, 2003 @ 5:14pm

Thank you Damian, Sm!rk, ppcStudios and warmi !! It works !! Here is the code I used :

OPENFILENAME ofn;
TCHAR szFileName[MAXPATH] = TEXT("");

ZeroMemory(&ofn, sizeof(ofn));

ofn.lStructSize = sizeof(ofn);
//ofn.hwndOwner = hwnd;
ofn.lpstrFilter = TEXT("Executable Files (*.exe)\0*.exe\0All Files (*.*)\0*.*\0\0");
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAXPATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = TEXT("exe");
if(GetOpenFileName(&ofn))
{
}

And using tGetFile from Tillanosoft make it even better !! (just replace GetOpenFileName by tGetOpenFileName)
Thanks again for solving my problem so quickly.
Andrea
Andrea
 


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum