|
Do you really need the resource for the buttons?
Can't you just create them from your subclass?
|
|
|
|
|
I have some code in ASM but I can change it to VC++ command, how to use ASM in VC++???
please help me!!! thanks
|
|
|
|
|
Have a look in the MSDN at "__asm" if you have a MS compiler, otherwise look out for "asm".
Good luck
-Dominik
|
|
|
|
|
try
__asm
{
your asm code here
}
|
|
|
|
|
__asm
{
//write your assembly code here
}
R_Renjith The True CP ian
|
|
|
|
|
also think so
|
|
|
|
|
I need that when my windows is created it automatically execute some task.
In particular query the database using ado and displaying the results in editbox, lists, etc...
I tryed to put the call to the function that retrive the data in the constructor, but the controls are not yet created so Assertion Failure.
I went on and tryed when the window post WM_CREATE, same error, I tried with WM_SHOWWINDOW, same same.
Finally in the WM_PAINT, OnPaint, everything works perfectly.
The downside is that everytime my window is covered, resized, maximized, etc, my App requery the database, and this is a Big WASTE OF RESOURCES, especially if made on sone network.
I solved this by creating a BOOL m_AlreadyQueried.
And putting an if(!m_AlreadyQueried){...}
So when the WM_PAINT is posted the OnPaint calls the Query function, and sets m_AlreadyQueried = TRUE, the next time OnPaint is called the if evalutates false and the App doesn't query the database.
There is anther way of making this?
I mean maybe I'm wrong using WM_PAINT, but the other messages are posted "TOO EARLY".
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
If yo want to do it in your view class you can do it in OnInitUpdate()
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
|
|
|
|
|
Or if you are in Dialog, do it in OnInitDialog
Or, if you are in generic CWnd, you can try to do it in OnShowWindow , checking that the command is SW_SHOW and GetSafeHwnd() returns you not null and then query the database. Remember to have some flag, for example a static boolean variable inside function, then, after query, set it to false, e.g.:
...
if(GetSafeHwnd() != NULL){
static bool bFirstTime = true;
if(bFirstTime){
bFirstTime = false;
}
}
Hope this helps
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
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!
|
|
|
|