|
Yes, WM_PAINT is no good place to stuff code in.
Register our own message and when you window is beeing created, post
it to yourself and the do the proccessing in response to the message.
If it's a dialog post it in WM_INITIDIALOG, if its a window post it in WM_CREATE.
|
|
|
|
|
how to send a virtual key in a service when the Winlogon desktop is the input desktop?
|
|
|
|
|
perhaps have a look at the function ::keybd_event or SendInput?
|
|
|
|
|
? use which api function?
I'm a beginner of VC++...
|
|
|
|
|
BOOL CDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CenterWindow();//???????????
return TRUE;
}
|
|
|
|
|
|
You can set the flag "Center" in the properties of your Dialog ("More Style" Tab).
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Try CenterWindow()
|
|
|
|
|
Hi!
I have created a SDI program (CRichEditView)and I tryed to draw some shapes.
But: I havent found the OnDraw function!
How can draw something????
Thanks
|
|
|
|
|
Anonymous wrote:
But: I havent found the OnDraw function!
Simple.It is not overriden by default.You can overriden it yourself by classwizard.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
I have a problem:
I declare a variable CString string; in Class1.
During the execution of Class1 I give a value to this variable
string = "hello";
After on Class 2 I declare a pointer to the Class1:
Class1* pClass;
pClass = Class1;
Now I want to utilize the value stored in string
AfxMessageBox(pClass->string);
But the messagebox show empty.
It's the same if I don't use a pointer:
Class1 newClass;
AfxMessageBox(newClass.string);
But If I make
pClass->string = "bingo";
AfxMessageBox(pClass->string);
BINGO!
What's up?
COnsider that Class1 and Class2 are both running at the same time, on two CFrameView.
I set to display AfxMessagesBox in the costructor and destructor of each class, so I know what's running at what time.
But why when I call the variable string from Class2 it's lost its value.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
laphijia wrote:
Class1* pClass;
pClass = Class1;
Can you please post your code? Because the snippet above will show an error message during compile, I think.
Martin
|
|
|
|
|
Ok sorry:
CLoginForm* pLoginForm;
pLoginForm = new CLoginForm;
AfxMessageBox(pLoginForm->szString);
delete pLoginForm;
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
using VC++6 ,i can easily rename the member variables of CRecordset-derived class with classwizard,
but when i use VC++7 ,i cannot find one easy way to rename the variable which appears at several place in .cpp and .h file.
i want to know : is there any tool in VC7 which can update columns and bind the member variables to columns in the database table like classwizard in vc6?
anybody have some advice appreciated anyhow.
|
|
|
|
|
I am using the desktop window as a parent window of a child window in my app. The child is unable receive messages as a result. Any help would be greatly appreciated.
|
|
|
|
|
What messages you want to recieve and what is your child window? A dialog? Or a button?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
How can i achieve that in my program,
wat's the function or API to do this?
I don't need it to be able to resize using mouse, just rather by function calls will do.
And how do i propogate the message from CDialog to the controls in the dialog boxes?
like WM_SIZE or any another msg.
Thanxs a billion.
|
|
|
|
|
See this article for one solution.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Use either SetWindowPos or MoveWindow . What message do you want to propogate? Because ususally the controls are resized in the WM_SIZE message of the dialog box.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanxs!
i would want to propogate messages like WM_SIZE to a subclass that i have created.
I wll take a look at the article recommended Ravi Bhavnani.
BTW,
wat's the difference between INT and int, BOOL and bool,....?
Thanxs once again
|
|
|
|
|
aldeba wrote:
wat's the difference between INT and int, BOOL and bool,....?
the int and bool data types are native data types that you will find in C++. The int is a four byte signed integer and I believe that the bool is a one byte value that indicates either true or false.
Microsoft has declared the INT and BOOL datatypes to make programs more portable. If you search through the header files in windows.h, you will find that the INT is probably defined as an int like this:
#define INT int
And the BOOL is defined as an int as well. That is because the bool datatype does not exist in C, and all of these functions are supposed to work in C as well as C++.
The code is made more portable by letting you define what the underlying datatype is for the INT or BOOL when you compile the program on different machines. For instance the difference between compiling your program for Win32 or Win64. Or an Intel machine or a UNIX machine.
I prefer to use the native datatypes for my own internal code, but if I am writing a library of API functions to distribute, I usually use the #defined types.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
aldeba wrote:
i would want to propogate messages like WM_SIZE to a subclass that i have created.
You dont need to do that, if you change the size of the controls from the dialog(eg. MoveWindow), the control will recive a WM_SIZE message.
|
|
|
|
|
I am getting error LNK2019, after adding this code to a project:
void CSimpleShlExt::DeleteFiles(string sPath)
{
vector <string> Paths;
string enumerate = sPath;
if (enumerate[enumerate.length()- 1 ]!= '\\')
enumerate += '\\';
enumerate += "*.*";
WIN32_FIND_DATA fd;
::FindFirstFile(enumerate.c_str(), &fd);
}
and I think I need to get rid of ATL_MIN_CRT, which is defined I believe, but I cannot find where. I am using .NET. Can anyone help me ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
actually, removing this code does not solve the problem, but it now fails to build with the code that originally compiled fine. So my project settings must have changed, but how to change them back ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
In VC 6 _ATL_MIN_CRT is set in the Project Settings->C++ tab->Compiler options. No idea where it is in VC 7 'cause I never could find the bloody project settings in that version. If worse comes to worse, put this in stdafx.h:
#undef _ATL_MIN_CRT
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|