Click here to Skip to main content
15,910,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFlash and MFC Pin
FayezElFar12-Jan-05 4:36
FayezElFar12-Jan-05 4:36 
GeneralRe: Flash and MFC Pin
Anonymous.12-Jan-05 5:01
sussAnonymous.12-Jan-05 5:01 
GeneralSuppress Reboot when starting exe Pin
immes12-Jan-05 4:33
immes12-Jan-05 4:33 
QuestionResolving * and ? Pin
Joel Holdsworth12-Jan-05 3:03
Joel Holdsworth12-Jan-05 3:03 
AnswerRe: Resolving * and ? Pin
basementman12-Jan-05 3:58
basementman12-Jan-05 3:58 
GeneralUI design...! Pin
Feroz R12-Jan-05 2:20
Feroz R12-Jan-05 2:20 
GeneralRe: UI design...! Pin
Selvam R12-Jan-05 2:46
professionalSelvam R12-Jan-05 2:46 
GeneralCStatusBar help (new to VC++) Pin
LighthouseJ12-Jan-05 2:18
LighthouseJ12-Jan-05 2:18 
I'm new to Visual C++ and trying to learn it. I've written a Windows program from the ground up and I'm trying to add a status bar to my dialog window but I get a compile error:

...\489window.cpp(14): error C2228: left of '.SetPaneText' must have class/struct/union type

Here's my declaration and code with the offending line at the end, the static void declaration:

<br />
public:<br />
	CStatusBar m_bar;<br />
	static void setStatusBarText(CString newText){ m_bar.SetPaneText(NULL, newText, true); }


I have a menu and when the user clicks "Open..." in the menu, they get the open file common control and once the file has been chosen, my program fetches two fields, a height and width of the bitmap image and it should then set the status bar to be "<width> x <height>" with the numbers filled in.

Where the program does this is in a class I derived from CWinApp, but the codeproject.com example I found places the status bar declaration in the class derived from CWnd (I derived my dialog from CFrameWnd from using another example somewhere) which is where the above code is copied from. It's acting like it doesn't know what m_bar is because I can try and retype the m_bar.Create(...) line but once I hit the period, it tells me m_bar isn't a union, class or struct, but it was declare the line above it. Any help is appreciated, but please remember I'm new and need something easier to understand than most. Thanks in advance.

more:
I just adedded the create line in the constructor for my CFrameWnd derived class and it knows m_bar. I commented out the offending line above, so I just have the declaration and the create. I ran the program and it created the status bar and it looks just fine. I still get that error above.
GeneralRe: CStatusBar help (new to VC++) Pin
RChin12-Jan-05 2:49
RChin12-Jan-05 2:49 
GeneralRe: CStatusBar help (new to VC++) Pin
LighthouseJ12-Jan-05 3:00
LighthouseJ12-Jan-05 3:00 
GeneralRe: CStatusBar help (new to VC++) Pin
Antony M Kancidrowski12-Jan-05 4:35
Antony M Kancidrowski12-Jan-05 4:35 
GeneralRe: CStatusBar help (new to VC++) Pin
LighthouseJ12-Jan-05 7:22
LighthouseJ12-Jan-05 7:22 
GeneralRe: CStatusBar help (new to VC++) Pin
Antony M Kancidrowski12-Jan-05 14:11
Antony M Kancidrowski12-Jan-05 14:11 
GeneralDisabling MRU List Pin
Aamir Butt11-Jan-05 23:20
Aamir Butt11-Jan-05 23:20 
GeneralRe: Disabling MRU List Pin
Selvam R12-Jan-05 2:03
professionalSelvam R12-Jan-05 2:03 
GeneralRe: Disabling MRU List Pin
Aamir Butt12-Jan-05 16:48
Aamir Butt12-Jan-05 16:48 
GeneralCapturing and stretching image Pin
José Luis Sogorb11-Jan-05 23:07
José Luis Sogorb11-Jan-05 23:07 
GeneralRe: Capturing and stretching image Pin
Selvam R12-Jan-05 2:08
professionalSelvam R12-Jan-05 2:08 
GeneralRe: Capturing and stretching image Pin
José Luis Sogorb12-Jan-05 6:53
José Luis Sogorb12-Jan-05 6:53 
GeneralCreateProcess and process groups Pin
ionzarate11-Jan-05 22:55
ionzarate11-Jan-05 22:55 
GeneralRe: CreateProcess and process groups Pin
Blake Miller12-Jan-05 5:46
Blake Miller12-Jan-05 5:46 
GeneralAccess violation reading location 0xcdcdcddd. Pin
aj168211-Jan-05 22:31
aj168211-Jan-05 22:31 
GeneralRe: Access violation reading location 0xcdcdcddd. Pin
ThatsAlok11-Jan-05 23:53
ThatsAlok11-Jan-05 23:53 
GeneralRe: Access violation reading location 0xcdcdcddd. Pin
aj168212-Jan-05 0:45
aj168212-Jan-05 0:45 
GeneralRe: Access violation reading location 0xcdcdcddd. Pin
Cedric Moonen12-Jan-05 1:03
Cedric Moonen12-Jan-05 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.