|
Do you mean other than responding to the WM_CLOSE message?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Do you mean other than responding to the WM_CLOSE message?
When I right-click on some process names seen on Task Manager, and choose [Kill process tree], some can not be killed. (not the "System Idle" of course)
Maxwell Chen
|
|
|
|
|
The End Task button is on the Applications tab, not the Processes tab.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
What about having 2 processes that control each other?
When one of them finishes the other one restart it.
rotter
|
|
|
|
|
I remember battling some spyware that did this very thing. It exploited the fact that you could not kill two processes at once using Task Manager. They each watched the other and restarted as necessary. I finally got 'em both, though.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hi.
I'm writing an application, (using MFC), that connects to a SQL 2000 database.
In the past I have used indistinctly ADO OLEDB, (using #import statetment and all these COM stuff) and the MFC ODBC classes CDatabase, CRecordset, etc.
My question is:
Which is the more efficient method?.
I will lose something if I start to use ODBC classes more often?.
Which are the differents, (technical diff I mean) between these two methods?
It would be great to clarify all this because I'm working with those techniques for a long time ago and I really don't know their basements.
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
As far as I know, and I am not a database expert, ADO is build in such a way that the underlying database type is irrelavent to the programmer.
Which means that when you are accessing a SQL database with ADO, it is probably going to make calls through ODBC to access the data, which is adding a middle man. In other words using ODCB will be faster than using ADO.
AliR.
Visual C++ MVP
|
|
|
|
|
I created a button using CBitmapButton and set it to BS_OWNERDRAW but it is not shown on the dialog box.
CBitmapButton m_Btn1;
...
...
...
m_Btn1.Create("",WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,CRect(0,10,30,50),this,IDC_BUTTON3);
m_Btn1.LoadBitmaps(IDB_BITMAP1,IDB_BITMAP2,NULL,NULL);
|
|
|
|
|
I've made a test with your code (using MSVC++ 6.0) :
<br />
class CMyDialog : public CDialog<br />
{<br />
:<br />
CBitmapButton m_Btn1;<br />
:<br />
}<br />
<br />
BOOL CMyDialog::OnInitDialog() <br />
{<br />
CDialog::OnInitDialog();<br />
:<br />
m_Btn1.Create("",WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,CRect(0,10,30,50),this,12345);<br />
m_Btn1.LoadBitmaps(IDB_BITMAP_TEST1,IDB_BITMAP_TEST2); <br />
:<br />
return TRUE;<br />
}<br />
... and it work's fine.
Only thing is, that the button's coords a relative to the client area of the dialog ... means the button with CRect(0,10,30,50) appears in the upper left corner of the dialog.
Are you sure that it is not shown ?
Or is it hidden by an other control / item ?

|
|
|
|
|
CBitmapButton m_Btn1;
may be the local variable, got destroyed when out of scope.
|
|
|
|
|
How did you declare m_Btn1?
|
|
|
|
|
Been studying a program for a few days now made by a friend of mine, unfortunately he is not in town to answer some of my questions and i really need to understand this ASAP. I am not going to post the whole program but i will post what i think will help you in understanding my queries for this program
This is a soccer robot program made for MFC C++, two opposing teams Y for yellow and P for purple comprising of 10 players each.
This was how the players initial position was declared:
P[0].x = 158; P[0].xi = P[0].x;
P[0].y = 100; P[0].yi = P[0].y;
Declaration for soccer balls initial position:
balx = 325;
baly = 225;
Initializes value for close:
for(int l=0;l<11;l++)
{
Y[l].close = false;
P[l].close = false;
}
//computes for the distance between the ball and the players
for(int m=0;m<11;m++)
{
Y[m].dist = sqrt(pow((Y[m].x-balx),2)+ pow((Y[m].y-baly),2));
P[m].dist = sqrt(pow((P[m].x-balx),2)+ pow((P[m].y-baly),2));
}
Finds the shortest distance between the dark blue players and the ball:
(ALSO DONT UNDERSTAND why y[n].dist was compared to y[p].dist, are they not the same value? Can someone explain why the need for true and false?)
Y[0].close=true;
p=0;
for(int n=0;n<10;n++)
{
if(Y[n].dist < Y[p].dist)
{
Y[p].close=false;
p=n;
Y[n].close=true;
}
}
THIS CODE I DO NOT UNDERSTAND: Please explain what the true and false is for for the .close
Close was declared as a bool. I get everything except the need for the true and false with regards to .close Close was supposed to determine which among the players in the team was nearest to the ball.
if(P[s].close!=true)
{
if(P[s].xi
{P[s].x-=1;}
else {P[s].x+=1;}
if(P[s].yi
{P[s].y-=1;}
else {P[s].y+=1;}
}
Thank you very much, any help would be highly appreciated.
This is a repost, my apologies to the mods but i dont know where i posted my previous one. This will not happen again.
|
|
|
|
|
dopeman wrote: (ALSO DONT UNDERSTAND why y[n].dist was compared to y[p].dist, are they not the same value? Can someone explain why the need for true and false?)
Y[0].close=true;
p=0;
for(int n=0;n<10;n++)
{
if(Y[n].dist < Y[p].dist)
{
Y[p].close=false;
p=n;
Y[n].close=true;
}
}
Well Y[n].dist and Y[p].dist are the same value only on first iteration, you can avoid this unnecessary (though it is not a mistake) comparison starting from 1 the iteration:
for(int n=1;n<10;n++)
dopeman wrote: if(P[s].close!=true)
{
if(P[s].xi
{P[s].x-=1;}
else {P[s].x+=1;}
if(P[s].yi
{P[s].y-=1;}
else {P[s].y+=1;}
}
Probably this piece of code makes the players (except the one closest to the ball) to move towards the ball itself, but it really depends on how P[s].xi and P[s].yi are computed, you didn't show that.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks for the help, really appreciate it
declarations:
P[0].x = 158; P[0].xi = P[0].x;
P[0].y = 100; P[0].yi = P[0].y;
i think you are right, the code below is for the player not closest to the ball and it makes it try to follow the ball.
if(P[s].close!=true)
{
if(P[s].xi<p[s].x)>
{P[s].x-=1;}
else {P[s].x+=1;}
if(P[s].yi<p[s].y)>
{P[s].y-=1;}
else {P[s].y+=1;}
}
What i dont understand is the need to compare P[s].yi<p[s].y ,="" is="" that="" the="" original="" point="" of="" orgin="" being="" compared="" to="" new="" origin="" was="" moved="" by="" a="" random="" number="" on="" both="" x="" and="" y="" axis?<br="" mode="hold">
Now as for this code:
Y[0].close=true;
p=0;
for(int n=0;n<10;n++)
{
if(Y[n].dist < Y[p].dist)
{
Y[p].close=false;
p=n;
Y[n].close=true;
}
}
I still dont get it The program is supposed to determine using this code which one is the closest to the shortest distance computed between the ball and the player right? so how does this compare?
|
|
|
|
|
Hi,
I am getting the following error.Please help me in solving it.
Debug\vc60.pdb" is missing debugging information for referencing module
Regards,
Mayank
|
|
|
|
|
Maynka wrote: I am getting the following error.Please help me in solving it.
Actually it is a warning.
What is the module without debugging information?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello everybody!
I use a static lib (ANSI because of 3rd company libs included there which requires ANSI) and would like to use it in a unicode application.
Does someone know from expierence if there are any problems??
does some have further information, because it's very hard to find information about this topic??
Thanks and best regards
Mathias
|
|
|
|
|
neyerMat wrote: Does someone know from expierence if there are any problems??
No problems, provided you convert strings from you application before passing them to the library and viceversa.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks Pallini!
I never thougt that simple!
so long
Mathias
|
|
|
|
|
And as a side note, u even don't want to convert the strings, provided u r using the ANSI version of API for that particular strings
|
|
|
|
|
Using HtmlHelp with HH_DISPLAY_TEXT_POPUP to display a context-sensitive help in arabic, where the extended style of the owner window is set to WS_EX_LAYOUTRTL, results in displaying the help-text in a correct right-to-left order, but the entire multiline text is still left-aligned.
How do I set the right-alignment of the text in the help-popup window ?
|
|
|
|
|
I must install which Windows Components before I install Visual Stduio 2003?
I insert the CD1 of VS2003, it always tell me to restart computer.
The restart message is as below:
http://www.game.csie.ndhu.edu.tw/~akira/Else/vs2003error_eng.JPG
|
|
|
|
|