|
this looks like Managed C++.
have you thought asking in the C++/CLI forum[^] ?
|
|
|
|
|
Test2 is the name of my button and caption is the property of whats written on the button. It very possible that caption doesnt exist and i have to use text, but both doesnt work.
And as far as I know this isn't managed c++, unless I never done unmanaged c++ in my entire life.
|
|
|
|
|
samkook wrote: Test2 is the name of my button and caption is the property of whats written on the button. It very possible that caption doesnt exist and i have to use text, but both doesnt work.
Is this Button is your own activeX control ..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
|
I'm having problems with class redefenition errors (4 of them, plus 93 other errors about not being able to find class defenitions). Include guards are in place in every file but I'm still getting errors becuase the classes are dependant on one another and I can't figure out a way for all the dependancies to be satisfied and still not get any class redefenitions.
The relevant files:
game_main.cpp
requires stdafx.h and game_operations.h (class CGameWin)
tree_operations.h (class TreeOperations)
requires stdafx.h
GameDialog.h (class GameOptionsDialog)
requires stdafx.h, and game_interface.h (class CGameWin)
game_operations.h (class GameOperations)
requires stdafx.h, game_interface.h (class CGameWin), and tree_operations.h (class TreeOperations)
game_interface.h (class CGameWin)
requires stdafx.h, GameDialog.h (class GameOptionsDialog), and game_operations.h (class GameOperations)
As you can see, I need class CGameWin in both GameDialog.h and game_operations.h, which is a problem since game_interface.h needs GameDialog.h. It makes a loop. I can post the header files if you need me to, but it will take up a lot of space. Please help me out with this.
|
|
|
|
|
Header files should never need stdafx.h. Stdafx.h must be the first file included in all your cpp files.
Can you do a simple forward declaration in one of your header files and then include the actual header file in your cpp file?
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I got it running. Thanks for the help.
|
|
|
|
|
dear coder
how do i programatically prevent that a key does not repeat itself, in case that user press and hold that key (e.g a funktion key)?
thanks
cheers
|
|
|
|
|
|
hi WebSitesNG,
thanks for your reply.
i need it, because if the user accidentially press a particular key too long, so that it repeats itself, then this will result an error.
cheers
|
|
|
|
|
Check the previous key state bit.
void CMyWnd::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nFlags & (1 << 14))
{
return;
}
CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
}
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I am writing a MDI appkication but there are times when the user tries to open a new window and I want to prevent this (e.g. when there is a resource conflict).
I tried putting PostMessage(WM_CLOSE, 0, 0) in the OnCreate function but it doesn't work.
Any ideas?
Elaine
|
|
|
|
|
Returning -1 from the OnCreate method should abort the creation process and destroy the window.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
It works but puts up a dialogue box with an error.
Commenting out the CView::OnCreate call causes an exception.
|
|
|
|
|
I'm going to try overriding CWinApp::OnFileNew , that should do it.
Thanks for trying.
Elaine
|
|
|
|
|
Returning FALSE from CDocument::OnNewDocument() will also do it.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Also, returning FALSE from a PreCreateWindow() override will prevent the creation before the
associated HWND is created.
Mark
|
|
|
|
|
Unfortunately the causes an error dilaogue to appear.
I'm going to try overriding CWinApp::OnFileNew , that should do it.
Thanks for trying.
Elaine
|
|
|
|
|
I didn't know that. I'm going to have to look into that - if it's MDI-specific maybe(?)
Thanks!
Mark
|
|
|
|
|
It looks MDI specific but I suppose you could use OnFileOpen for SDI.
|
|
|
|
|
How to catch WM_CHAR ,WM_KEYDOWN in Dialog Base.
|
|
|
|
|
In MFC, by using The On*() handlers, or using PreTranslateMessage(...) from within the CDialog class. In straight C/C++, by adding the message identifiers to your message pump.
Many examples on this site catch those messages - if you do an article search for those messages, I am sure you will find matches.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
If you want to learn how to create Games with DirectX visit this portal: lightportal.co.nr
|
|
|
|
|
I've looked around but I think I'm looking for the wrong things because I instinctively feel there must be a very, very simple way for me to make a DateTimePicker control on a simple MFC dialog automatically update the current time (and maybe date in another control). I don't mind following an article if you point me there
|
|
|
|
|
ldsdbomber wrote: there must be a very, very simple way
You mean like you read the data from the source control and you write it to the target control? That is very simple.
led mike
|
|
|
|