🔒 Locked
undefined identifier
Advertisement
Original Post
I successfully used the fucntion "GetOpenFileName" in the past, but in my new project it doesn't work. I #include <#include <Commdlg.h> and the comdlg32.lib, but it doensn't solve the problem, i also read this but....
Anyhelp?
Sample of codes:
And these are the error messages i get:
[edited by - remi on July 12, 2003 11:36:38 PM]
#include <Commdlg.h>
...
OPENFILENAME ofn;
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn); // SEE NOTE BELOW
ofn.hwndOwner = hWnd;
ofn.lpstrFilter = "Raw Files (*.raw)\0*.raw\0";//All Files (*.*)\0*.*\0";
ofn.lpstrFile = buffer;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = "raw";
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
if(GetOpenFileName(&ofn))
{
//
}
And these are the error messages i get:
'OPENFILENAME' : undeclared identifier
missing ';' before identifier 'ofn'
'ofn' : undeclared identifier
left of '.lStructSize' must have class/struct/union type
left of '.hwndOwner' must have class/struct/union type
left of '.lpstrFilter' must have class/struct/union type
left of '.lpstrFile' must have class/struct/union type
left of '.nMaxFile' must have class/struct/union type
left of '.Flags' must have class/struct/union type
'OFN_EXPLORER' : undeclared identifier
'OFN_FILEMUSTEXIST' : undeclared identifier
'OFN_HIDEREADONLY' : undeclared identifier
left of '.lpstrDefExt' must have class/struct/union type
left of '.lStructSize' must have class/struct/union type
'OPENFILENAME_SIZE_VERSION_400' : undeclared identifier
'GetOpenFileName' : undeclared identifier
[edited by - remi on July 12, 2003 11:36:38 PM]
put rescue cd in cd drive. press the large reboot button on your computer... click some buttons and wait 30 minutes, and voila ;P
heh... can't come up with a better solution than that
edit: are you sure you're not screwing your code up somewhere before this code that could cause this eh weird error ?
[edited by - angry on July 12, 2003 11:47:20 PM]
heh... can't come up with a better solution than that
edit: are you sure you're not screwing your code up somewhere before this code that could cause this eh weird error ?
[edited by - angry on July 12, 2003 11:47:20 PM]
Perhaps you need "#include <windows.h>".
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement