Archived

This topic is now archived and is closed to further replies.

Load Runner

OPENFILENAME

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Woohoo!
it works now.
i just declared OPENFILENAME Ofn; as a global

anyway thanks for taking your time.

Share this post


Link to post
Share on other sites