|
Not sure what 'Beginning' and 'MyIntro' are, but this looks like you forgot a semicolon in your header file. Just an idea, but did you remember the semicolon after the closing brace in your class declaration?
class MyClass
{
...
}<font color="red">;</font>
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Yes, the semiconlon is there. MyIntro is the real class name, and "Beginning" is the real object name (I just named them simply for this message board).
If anyone would like me to e-mail the code, just ask--still not sure why it's not working. You should be able to call functions (or at least make an object) from a class in a console app, right?
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Sure, send me the code and I will take a look at it. But I am almost certain that it is just a matter of a missing semicolon or possibly a closing brace somewhere.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
You've most probably made a simple coding error. The following works:
class MyIntro {};
MyIntro Beginning;
int main() { return 0; }
|
|
|
|
|
Hi,
The program I am working on is an SDI. When the program starts, I have a bitmap background active. I have created split screen windows in CMainFrame::OnCreateClient. When I try to call the split screen from one of my dialog boxes' OnOK buttons, I can not switch from the background bitmap to a split window screen. How can I best accomplish this?
Any help greatly appreciated,
CitationJet
|
|
|
|
|
You should try the ST_SplitterWnd from Daniel Zuppinger:
http://www.codeproject.com/splitter/st_splitterwnd.asp
You can add, remove, switch panes in splitted windows.
Eric
|
|
|
|
|
How can I find out which control in my formview is now focused?How can I do it with GetFocus()
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
You can use the GetDlgCtrlID() method of CWnd to determine the control ID of the current control with focus:
CWnd *pWnd = GetFocus();
int FocusID = pWnd->GetDlgItemID();
if(FocusID == IDC_MYCOMBOBOX)
; // whatever
Hope this helps,
- Nigel
|
|
|
|
|
NigelQ wrote:
pWnd->GetDlgItemID();
I got this error:
GetDlgItemID is not member of CWnd.
I test GetDlgCtrlID too but it didn't work.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Thanks.Now I make it with GetDlgCtrlID() .
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
How can i trap enter key in a derivated CEdit class.
|
|
|
|
|
Use the ES_WANTRETURN style.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Or ::PreTranslateMessage in the dlg or mainframe,
And I swallow a small raisin.
|
|
|
|
|
Does anyone know how I can extract a specific icon format from an icon file?
I have an application with an icon associated with (IDR_MAINFRAME as usual) but it actually contains 10 different icon formats (such as 16 x 16, 16 colours; 48 x 48, 256 colours; etc). I want to be able to be able to pass a particular icon format as an HICON as a parameter to a function.
Any ideas?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
You can use LoadImage() to specify the size and color depth you want to load. It will load the format that comes closest to what you specify.
Shog9
|
|
|
|
|
I want add a checkbox before each item in a treectrl.And I want make it multi-selection.How do I?
Need your help.
Sincerely,Pole.
|
|
|
|
|
Add the TVS_CHECKBOXES style to your tree control.
There's always one more bug.
|
|
|
|
|
Thanks for your help.
Sincerely,Pole.
|
|
|
|
|
??
Any code by change? I want the caption bar to look XP-like
even if it's operating in an non-XP environment.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
There are examples here at CP of how to pain a custom caption.
|
|
|
|
|
Any code out there that highlights a check box when a mouse
hovers over it?
|
|
|
|
|
I am running into the case where the system is running our of memory so new and malloc are returning 0 causing our application to crash. Of course windows is totally hosed at this point as well (it doesn't handle out of memory situations very well). Checking for allocation failures everywhere would be huge task and I am concerned that it would not add much value. What do you guys do about this? Do you actually check for failures and handle them? If so, how do you handle them? Thanks!
Chris
PS - I have setup a new handler with a safety buffer to ensure that I have enough memory to display a warning message to allow the user to logout, but this is till not good enough.
|
|
|
|
|
Chris Hafey wrote:
Do you actually check for failures and handle them?
yes.
Chris Hafey wrote:
If so, how do you handle them?
all of my apps use a common error code system, so i just return the appropriate error code. eventually that error will work its way back to the UI, which will give the user a nice message box.
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
Chris Hafey wrote:
Checking for allocation failures everywhere would be huge task and I am concerned that it would not add much value.
Your concerns are unfounded. However, people using your software should be really concerned. You are excercising very dangerous practices. I hope you very soon learn the errors of your ways before you hurt anyone but yourself...
What do you guys do about this?
Check every single allocation.
Do you actually check for failures and handle them?
Are you trolling, or is it that you really don't know?! Of course you have to check for failures!
If so, how do you handle them?
In the appropriate way. There's no way to know how your application should handle failures. If not even you, the developer, know what to do in case of a failure in your own application...
I'm speechless.
Would you mind telling us the name of this application? Using it would be like juggling with handgrenades with the safety off, and I sure don't want to come anywhere near it.
|
|
|
|
|
I'm back again with the same old bullshit. I can't figure out what the deal is. The app runs fine on 2000, XP, and NT. I watch the GDI resources in the task list of 2000 and XP and the number of GDI objects being used does increase slightly during execution of the application when I perform specific operations. Not a tremendous amount, though--It's tolerable. The problem is, when I run it on Windows 98, the % of GDI resources being used goes up significantly when I perform those same operations and soon enough, the app crashes because the computer is out of memory. I'm not sure what could be the difference between XP/2000/NT and 98 as far as GDI resources are concerned. Can anyone help me out?
|
|
|
|