473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

CToolBar Problem

100 100+
Hi,
I am trying to use the toolbar resource...IDR_TOOLBAR1....
Here I have declared CToolBar cToolBar; in my Dialog class "class CExoDialog : public CDialog"

In OnInitDialog Function....I have written some thing like this
Expand|Select|Wrap|Line Numbers
  1.  
  2.     cToolBar.Create(this);
  3. cToolBar.LoadToolBar(IDR_TOOLBAR1);
  4. cToolBar.ShowWindow(SW_SHOW);
  5. cToolBar.SetBarStyle(CBRS_ALIGN_BOTTOM | CBRS_TOOLTIPS | CBRS_FLYBY);
  6. RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
  7.  
  8.  

But it is not compiling and giving the following error
Syntax error : missing ';' before identifier 'cToolBar'
E:\bookexample\one.cpp(204) : error C2501: 'CToolBar' : missing storage-class or type specifiers
E:\bookexample\one.cpp(204) : error C2501: 'cToolBar' : missing storage-class or type specifiers
E:\bookexample\one.cpp(279) : error C2065: 'cToolBar' : undeclared identifier
E:\bookexample\one.cpp(279) : error C2228: left of '.Create' must have class/struct/union type
E:\bookexample\one.cpp(280) : error C2228: left of '.LoadToolBar' must have class/struct/union type
E:\bookexample\one.cpp(281) : error C2228: left of '.ShowWindow' must have class/struct/union type
E:\bookexample\one.cpp(282) : error C2228: left of '.SetBarStyle' must have class/struct/union type
Error executing cl.exe.




PLease help...
Jun 25 '07 #1
1 3018
weaknessforcats
9,208 Expert Mod 8TB
I think cToolbar is a class that you are using as an object.
Expand|Select|Wrap|Line Numbers
  1. cToolBar obj;
  2.  
  3. obj.Create(this);
  4. obj.LoadToolBar(IDR_TOOLBAR1);
  5. obj.ShowWindow(SW_SHOW);
  6. obj.SetBarStyle(CBRS_ALIGN_BOTTOM | CBRS_TOOLTIPS | CBRS_FLYBY);
  7. RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
  8.  
Jun 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
1
by: DaniloAlmeida | last post by:
Hi all, In Using the VC.NET 2003 and I'm trying to create a new program SDI with a ToolBar object, My problem is when the toolbar is created the buttons are disabled and I want to know how can I...
0
by: RedHedToo | last post by:
I've been tasked to create a tool for a 3rd party application. I must create a toolbar that is to be added to that application and when a button is pressed, a popup window with functionality is to...
1
by: Lea Hayes | last post by:
Hi, I have noticed problems with the CToolBar class when using a manifest file in VC++ 2003. To test my theory I created an empty MFC MDI project with the manifest file so I get the WinXP style...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.