From: Paulo A. <pc...@gm...> - 2006-03-04 06:32:48
|
I want to use de "ofn" dialogs of course but i got an enigmatic error (tha= t visual c++ doesn=B4t produce.) here goes an example code for a console app: #include<stdio.h> #include<windows.h> OPENFILENAME ofn; char szFileName[500]; int main(int argc, char* argv[]) { szFileName[0] =3D '\0'; memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize =3D sizeof(ofn); ofn.hwndOwner =3D NULL; ofn.lpstrFile =3D szFileName; ofn.nMaxFile =3D sizeof(szFileName); ofn.hInstance =3D NULL; ofn.lpstrFilter =3D TEXT("Type Libraries *.tlb,*.olb\0*.tlb;*.olb\0All File= s *.*\0*.*\0\0"); ofn.nFilterIndex =3D 1; ofn.Flags=3D OFN_FILEMUSTEXIST; int bRes; bRes =3D GetOpenFileName(&ofn); MessageBox(0,szFileName,"-",MB_OK); return 0; } compiling with the typical: $ g++ example.cpp -o example.exe i Got: Temp/ccOqaaaa.o(.text+0xa5):example.cpp: undefined reference to ` GetOpenFileNameA@4' collect2: ld returned 1 exit status What is going on? Please any help. thanks |