|
Mark Salsbery hit the target: I saw, with spy tool, WM_KEYDOWN messages going to Dialog OK button!
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.
|
|
|
|
|
Hi,
Please can you tell me the correct way to perform clean-up operation for a Cfont object?
I use this in OnInitDialog() :
CFont *m_pTitleFont = new CFont;
m_pTitleFont->CreateFont(25,0,0,0,800,0,0,0,0,0,0,ANTIALIASED_QUALITY,0,"Verdana");
s_Title.SetFont(m_pTitleFont);
s_Title is a CStatic object. I use different font types for different Static controls. So I am usually creating three-four fonts.
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
Tara14 wrote: can you tell me the correct way to perform clean-up operation for a Cfont object?
How about delete m_pTitleFont; ?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I wonder if the CFont destructor calls the DeleteObject method, does it?
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.
|
|
|
|
|
CPallini wrote: the CFont destructor calls the DeleteObject method, does it?
Not directly. ~CGdiObject() does though.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
OK, thanks!
BTW this MS sample made me wondering about [^], since they explicitely call CFont::DeleteObject .
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.
|
|
|
|
|
CPallini wrote: BTW this MS sample made me wondering about
That's cool. The OP created his/hers with new so I chose delete as an idea
For a local object, DeleteObject is great to free the HGDIOBJ when you no longer need it.
When the CFont goes out of scope, it will be freed as well.
Cheers!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
You can look in the source and find out.....
Steve
|
|
|
|
|
What an empirical boy!
Do you suggest to take sources as references? They're of course, for the current release... and..what if MS changes mind over time?
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.
|
|
|
|
|
CPallini wrote: Do you suggest to take sources as references? They're of course, for the current release... and..what if MS changes mind over time?
They are not going to change something like. They can hardly make the class not clean up the resources when it previously did of vice versa.
Steve
|
|
|
|
|
Stephen Hewitt wrote: They can hardly make the class not clean up the resources when it previously did of vice versa.
I agree on the above observation, of course.
I don't agree on the method, of course.
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.
|
|
|
|
|
CPallini wrote: I don't agree on the method, of course.
In a perfect world the documentation would be complete and answer all your questions. In the real world this is not always the case and you often need to find your answers elsewhere. In such situations a mixture of common sense and a peek at source code often save the day. This is just life in the trenches.
Steve
|
|
|
|
|
Stephen Hewitt wrote: This is just life in the trenches
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.
|
|
|
|
|
Hi,
I have to do a project....for yesterday (As usual, you tell me ) but I don't have the time to do it. There is a wind of panic out there!
I need a developer ASAP to do it. I'm looking for an affordable solution because I'm not (yet???) a millionaire! It is why I thought about central Europa (Hungary, Tcheky, Russia etc...) or Asia (China or India?)
The project deals with ActiveX and graphics and EXIF, under VC6 and VS2005.
Any idea where I can found such developers in a very short notice?
If you are interested or if you know someone who should be, please contact me through this board or at devproject@aliceadsl.fr .
Thank you very much in advance
Best regards
Guy
|
|
|
|
|
|
|
Hi!
I have made a very simple program that:
-Create a main window getting screensize (es 1600x1200 or 3200x1200 if I have 2 monitor)
-Initialize DirectX (Direct3DCreate9())
-Create a Device (CreateDEvice())
-Create a Texture (D3dXCreateTextureFromResourceEx())
-Draw and move this texture.
My problems is that with this conficuration:
-2 monitor side by side
-Both resolution are 1600x1200
-First monitor have coordinate 0,0
-Second monitor have coordinate 1600,0
In the second monitor I have a dead zone (vertical black band) where nothing are draw. This band is approximately 200x1200 with coordinate 3000,0
If I use the same configuration but with a smaller resolution es 1200x1024 in both monitor the program works fine.
Why? Where is my mystake? Some idea?
Thanks.
|
|
|
|
|
So this is the last loop I need for my project.
I need to open the file LIBRARIANSHAVE347CATS.DAT and send the info to the screen. Then, it has to search through all entered data, and create a new output file called "bigbook.dat" in which all entered books of over 200 pages have all their data sent to the new file.
So far this is what I have:
struct card_catalogue
{
float dewey;<br />
string title;<br />
string author;<br />
int released;<br />
int num_pages;<br />
enum typeofbook {fiction = 1, nonfiction, reference, pond};<br />
};<br />
<br />
int main()<br />
{ <br />
card_catalogue books;<br />
ofstream outfile;<br />
int i; <br />
<br />
<br />
cout<< "Enter the Dewey Decimal Number please: ";<br />
cin>> books.dewey;<br />
cout<< "Enter the Title of the book please: ";<br />
getline(cin, books.title);<br />
cin.ignore(80, '\n');<br />
cout<< "Enter the Author of the book please: ";<br />
getline(cin, books.author);<br />
cout<< "Enter the Year of Release please: ";<br />
cin>> books.released;<br />
cout<< "Enter the Number of Pages please: ";<br />
cin>> books.num_pages;<br />
cout<< "<-----Type----->"<<endl; <br />
cout<<"1 - Fiction" <<endl<br />
<<"2 - Non-Fiction" <<endl<br />
<<"3 - Reference" <<endl<br />
<<"4 - pond"<< endl;<br />
cout << "Enter the type: ";<br />
cin >> i;<br />
<br />
if(i == 1)<br />
{<br />
cout << "You chose Fiction\n";<br />
}<br />
if(i == 2)<br />
{<br />
cout << "You chose Non-Ficiton\n";<br />
}<br />
if(i == 3)<br />
{<br />
cout << "You chose Reference\n";<br />
}<br />
if(i == 4)<br />
{<br />
cout << "You chose Pond\n";<br />
} <br />
<br />
outfile.open("LIBRARIANSHAVE347CATS.DAT",ios::app);<br />
<br />
if(outfile)<br />
{<br />
outfile << books.dewey;<br />
outfile << books.title << endl;<br />
outfile << books.author << endl;<br />
outfile << books.released << endl;<br />
outfile << books.num_pages << endl;<br />
outfile << i << endl <<endl;<br />
<br />
}<br />
else<br />
{<br />
cout << "An error occurred while opening the file. \n";<br />
}<br />
outfile.close();<br />
return 0;<br />
}
|
|
|
|
|
That looks great, let us know how your project turns out.
|
|
|
|
|
klutez123 wrote: I need to open the file LIBRARIANSHAVE347CATS.DAT and send the info to the screen.
So why are you opening the file and writing to it? Does that not seem the least bit odd to you?
klutez123 wrote: So far this is what I have:
The code you've shown addresses almost none of your requirements. It allows you to enter data for a single book. You either need to create an array of card_catalogue objects and write out the array after the loop terminates, or you'll need to write out the data in books each iteration of the loop. Where's the loop?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ever heard of indentation? I don’t even look at posts in which the poster doesn’t make the effort to indent the code.
Steve
|
|
|
|
|
What does "indent" mean? (I'm spanish :P)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Nelek wrote: What does "indent" mean? (I'm spanish)
In short it means you write this:
for( ;; )
{
}
instead of this:
for( ;; )
{
}
Steve
|
|
|
|
|
Ok, then it is to use the tabulated structure, isn't it? Thanks for the answer
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi,
Is there any API through which i can find the IP address of current computer(computer on which my exe is running).
Warm Regards,
Mushq
|
|
|
|