In my project (Borland C++ Builder, Windows Xp ) am using following code for opening the file

  TOpenDialog *OpenDialog;

   OpenDialog->Filter = "all files (*.*)";
     OpenDialog->InitialDir="::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
     OpenDialog->Execute();

But the "My computer" tab is empty its not showing the drives. Rest "My Rescent Documnets" , "Desktop", "My Documents", "My network drives" all are showing the folders or drives in them.

I had created a new project in BCB with the same above code in that its working fine. When i am including this new project files in my old project again the error is reproducable.

I tried to use OpenFileDialog the code as follows :-

   OpenFileDialog *OpenFileDialog1 = new OpenFileDialog;

   OpenFileDialog1->Filter = "all files (*.*)";
     OpenFileDialog1->InitialDir="::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
     OpenFileDialog1->Execute();

this is giving compliation error : Undefined symbol 'OpenFileDialog'
Help me out to figure out the problem

Recommended Answers

All 2 Replies

Is that a compilation error or a linker error?
if that's a linker error then you may have to add libraries or modify the command lines.
Make sure your compiling for win32GUI instad of win32 console.

For the following code

 OpenFileDialog *OpenFileDialog1 = new OpenFileDialog;

     OpenFileDialog1->Filter = "all files (*.*)";
     OpenFileDialog1->InitialDir="::{20D04FE0-3AEA-1069-A2D8-08002B30309D}";
     OpenFileDialog1->Execute();

the error which i am getting is
Warning W8074 .\TMainForm.cpp 1438: Structure passed by value in function _fastcall TMainForm::LoadRegistryMainWindowPosition()
Error E2451 .\TMainForm.cpp 2156: Undefined symbol 'OpenFileDialog' in function _fastcall TMainForm::ScnLoadMenuItemClick(TObject *)
Error E2451 .\TMainForm.cpp 2156: Undefined symbol 'OpenFileDialog1' in function _fastcall TMainForm::ScnLoadMenuItemClick(TObject *)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.