Compiler errors in FolderView.h

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

Compiler errors in FolderView.h

Postby Inuk » Fri Dec 17, 2004 10:26 am

Hello,

As a personal project I would like to build a small backup program and am trying to figure out a way to have the user add thier own folders and files to the backup routine. I saw the article "Quick and Easy Folder Veiws" and though this is part of my solution. So I printed the article, studied the code then downloaed the code and unipped all the files, loaded the project and hit "run". I immediatly caught a bunch off errors. I just wonder if I am doing somehting wrong. I am using CPP Builder 5 with update 1.

I am catching a ton of errors when I try to run the "Proj_FolderView" project startiing in the following area:

}
virtual HRESULT STDMETHODCALLTYPE
SetToolbarItems(LPTBBUTTONSB lpButtons,
UINT nButtons, UINT uFlags)
{

The errors say:
[C++ Error] FolderView.h(141): E2293 ) expected
[C++ Error] FolderView.h(24): E2312 'hParent_' is not an unambiguous base class of 'TShellBrowser'
[C++ Error] FolderView.h(64): E2451 Undefined symbol 'hParent_'
[C++ Error] FolderView.h(183): E2352 Cannot create instance of abstract class 'TShellBrowser'
[C++ Error] FolderView.h(183): E2353 Class 'TShellBrowser' is abstract because of '__stdcall IShellBrowser::SetToolbarItems(_TBBUTTON *,unsigned int,unsigned int) = 0'

I have not changed the program in anyway I just inzipped the files from that I got from the cppbuilderdevjournal.com archives.
Inuk
 

Postby Damon » Sat Dec 18, 2004 1:42 pm

Hi Inuk,
I'm not sure if I tested the component in C++Builder 5. I'll try to install that version of the weekend and get back to you...

Cheers,
Damon
User avatar
Damon
BCBJ Editor and Admin
BCBJ Editor and Admin
 
Posts: 285
Joined: Wed May 26, 2004 11:25 pm
Location: Stillwater, OK, USA

Postby Inuk » Sat Dec 18, 2004 2:13 pm

Thank you Damon.

BTW I tried with another project (from your site) with the same error.

Cheers back at cha
Inuk
Inuk
 

Postby Damon » Wed Dec 22, 2004 1:31 am

Hi Inuk,
Well, I had to do some massive cleaning to find my BCB5 CD, but I did find it eventually. :)

( For anyone else interested in the FolderViews, Part I article, it's publically available as listed here: http://www.bcbjournal.org/public/ )

Anyway, I found the issue causing the compile-time errors. It was actually just one line of code in FolderView.h Line 141. Apprarently BCB5 uses an older version of <shlobj.h> in which LPTBBUTTONSB isn't defined. Instead, you need to use LPTBBUTTON. So, the modified code is...

Code: Select all
  virtual HRESULT STDMETHODCALLTYPE
//    SetToolbarItems(LPTBBUTTONSB lpButtons,  COMMENT THIS OUT
    SetToolbarItems(LPTBBUTTON lpButtons,
      UINT nButtons, UINT uFlags)
    {
      return E_NOTIMPL;
    }


I also had to edit the .BPR file in Notepad to remove some of the BCB6-specific references (I can't believe Notepad is still required for this). You can download the entire modified project folder here...

http://bcbjournal.org/public/FolderView1_BCB5.zip

HTH,
Damon
User avatar
Damon
BCBJ Editor and Admin
BCBJ Editor and Admin
 
Posts: 285
Joined: Wed May 26, 2004 11:25 pm
Location: Stillwater, OK, USA

Postby Inuk » Wed Dec 22, 2004 8:30 am

Thank you Damon,

I'll have a look at it later. I appreciate your help on this, I guess I am going to have to upgrade my software sooner or later. :)

That looks interesting! I didn't know that you you could poke around in the bpr file! I've printed a copy of each to compare the changes and I'll apply that to the other projects.

Thanks
Pat
Inuk
 


Return to Technical

Who is online

Users browsing this forum: No registered users and 15 guests

cron