Skip to main content
gamedev.net
🔒 Locked

OPENFILENAME

Started by Load Runner Oct 14, 2001 at 3:52 PM 5 replies 1.1k views
Original Post
Load Runner
Load Runner
Hi Im trying to create a Open File Dialog Box my problem is i declare this as a global OPENFILENAME Ofn; and i get these errors: error C2146: syntax error : missing '';'' before identifier ''Ofn'' error C2501: ''OPENFILENAME'' : missing storage-class or type specifiers i cant seem to understand why. any help is apriciated.
Romance is dead,it was bougth by Disney and Hallmark and sold to the public in small portions.
Gladiator
Gladiator
make sure to #include commdlg.h
Load Runner
Load Runner
oops!
hehe sorry it wont happen again
all works now
Romance is dead,it was bougth by Disney and Hallmark and sold to the public in small portions.
Load Runner
Load Runner
Hmm.
well on second thought, it does not work at all
now when i push the menu item "Open" all it does is closing the window
heres the code:

case ID_MENU_FILE_OPEN:
{

OPENFILENAME Ofn;
char szFileName[MAX_PATH];

szFileName[0]=0;

Ofn.lStructSize = sizeof(Ofn);
Ofn.hwndOwner = hWnd;
Ofn.lpstrFilter = "Map Files (*.Map)\0\0";
Ofn.lpstrFile = szFileName;
Ofn.nMaxFile = MAX_PATH;
Ofn.Flags = OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_EXPLORER;
Ofn.lpstrDefExt = "Map";

GetOpenFileName(&Ofn);

}break;

any help is appriciated,as always
Romance is dead,it was bougth by Disney and Hallmark and sold to the public in small portions.
Punika
Punika
It's Important that you set your Instance (HINSTANCE) too!! I think that is the problem.

Bye

Punika

Edited by - Punika on October 14, 2001 7:43:44 PM
Punika
Load Runner
Load Runner
Nope still the same
Romance is dead,it was bougth by Disney and Hallmark and sold to the public in small portions.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.