|
includeh10 wrote: I need a connection avi or gif (multiple-frames) for my C++ program.
connection means client/server connection.
Do you mean a TCP client/server connection? What as it to do with AVI and animated GIF (i.e. have you special needs?)?
includeh10 wrote: Can you help to privide a link for download?
Well you're a software developer, aren't you? Have a look at [^].
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
[My articles]
|
|
|
|
|
/*-----*//* the device context dc must still exist when the pen/etc is deleted */
class PEN{public: HDC d; HPEN pen,old; PEN(HDC dc,COLORREF col); ~PEN();};
PEN::PEN(HDC dc,COLORREF col){d=dc; pen=CreatePen(0,1,col); old=(HPEN)SelectObject(dc,pen);};
PEN::~PEN(){SelectObject(d,old); DeleteObject(pen);};
/*-----*/
class FONT{public: HDC d; HFONT font,old; FONT(HDC dc,HFONT f); ~FONT();};
FONT::FONT(HDC dc,HFONT f){d=dc; font=f; old=(HFONT)SelectObject(dc,font);};
FONT::~FONT(){SelectObject(d,old);};
/*-----*/
class TEXTCOLOR{public: HDC d; COLORREF col,old; TEXTCOLOR(HDC dc,COLORREF F); ~TEXTCOLOR();};
TEXTCOLOR::TEXTCOLOR(HDC dc,COLORREF c){d=dc; old=SetTextColor(dc,c);};
TEXTCOLOR::~TEXTCOLOR(){SetTextColor(d,old);};
/*-----*//* only declare one PEN and one FONT and one TEXTCOLOR in the same { } block */
Example of use:
{TEXTCOLOR brktlevel(dc,RGB((P->error&2)?255 ,0,0));
P->scrline=displ*CH;
scritem[displ&0xff]=P;
show(dc,L);
}
|
|
|
|
|
|
As Chris replied, MFC has classes for all of the GDI objects.
You should be using them instead of creating your own.
What exactly do you mean by keeping track?
I'm assuming you want to audit the creation and deletion of GDI objects.
For this you can derive your own classes from the GDI classes and in the constructor and destructor of these classes you could write your audit code.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
At the } the destructor automatically gets rid of the PEN/etc and restores the device context's previous PEN/etc instead of the programmer having to remember to.
Which #include file are CPen etc declared in?, so I can look to see what they do before I use them.
modified on Monday, September 21, 2009 1:53 AM
|
|
|
|
|
Your code is barely readable. Please, read the posting giudelines before posting (use the code tag in order to format your code decently).
|
|
|
|
|
do you want to reinvent CPen and CFont of the MFC or ATL, or what is the question
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Sorry. I had not heard of CPen etc, so I wrote my own similar.
|
|
|
|
|
you better read some articles here at CP and beginner books to get an overview of some class libraries of your choice as MFC, ATL.
The time you invest infront you get paid back very quick.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi
From MSDN:
"It is not necessary to wait until creation of the property sheet window to call AddPage. Typically, you will call AddPage before calling DoModal or Create."
Usually, each "Page" "OnInitDialog()" is called after it is first clicked.
Can I get CPropertyPage to be created before it is first click?
Can I get each CPropertyPage "OnInitDialog()" to be called before the "page" is clicked?
Best regards,
|
|
|
|
|
transoft wrote: Can I get CPropertyPage to be created before it is first click?
Yes. Check out the PSP_PREMATURE style.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
you better understand the purpose of "OnInitDialog()", which means that THIS CODE had to get executed for the proper initialization RIGHT BEFORE showing the page.
If you have some operations, do it somewhere else!!!
I prefer threads for long operations, because they dont stop the GUI.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I have to call GetDlgItem(..) which has to be called within "OnInitDialog()". I tried different ways before I post this message here.
I know the purpose of "OnInitDialog(). Because there are a lot of expert here, I post my question.
Thanks,
|
|
|
|
|
if the dialog isnt visible it isnt necessary to call GetDlgItem(..). If yoz have to change a value of a control, store the value in a member and change it in the OnInitDialog()
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Mr. DavidCrow already gave me solution.
|
|
|
|
|
I digged further about it and found:
http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesnative/thread/c6dc6a9a-0136-41e8-8bb8-2b92366d98e2/
the flags isnt supported anymore
But what is with OnSetActive() ?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi
I did following in CPropertyPage's constructor:
m_psp.dwFlags |= PSP_PREMATURE;
After debuging, I found that "OnInitDialog()" was called (after "AddPage") before it is clicked.
From my debuging, following statement (item 3) is not true.
1. OnInitDialog() fires for the first property page (the one all the way to the left).
2. OnSetActive() fires for the first property page.
3. OnInitDialog() then fires for each remaining property page, from left to right.
Thanks
|
|
|
|
|
An Addition OnSetActive() fires for every property page EVERY time it is clicked. So it is first choice for updating data. [->OnKillActive()]
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
|
the better way for my case is:
#pragma warning (error: 4245)
but both level 4 or this can not show warning:
UINT u;
if(u<0)
{
}
Thanks
|
|
|
|
|
I hope to get warning message at compiling time for:
UINT u=-1;
and
u=-1;
and
if(u<0)
{
....
}
because I modified data type of User ID from int iUserID to UINT uUserID, thousands of places had used -1 as invalid user ID (now is 0 for UINT), it is very hard to find all places to modify if without warning instructions.
Is it possible?
|
|
|
|
|
includeh10 wrote: I hope to get warning message at compiling time for:
And what happens when you compile it?
|
|
|
|
|
nothing, no error, no warning.
|
|
|
|
|
Try setting compiler warning level to 4 (/W4) in the C/C++ General properties of the project.
|
|
|
|