|
please, George, don't give too much to George_George. he's been abusing this board for several months, and he doesn't even search the web before asking very simple question.
so, please, don't give him too easy answers...
|
|
|
|
|
Toxcct,
I understand your pain, and have been following George_George exploits. He bites the hand that feeds him! However, my goal is to help and I won't let posters such as George_George change my focus just because he is a SOAB.
Geo
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
George L. Jackson wrote: just because he is a SOAB
lol, i feel lighter now that someone else have the same feeling than me.
BTW, I do have the same goal too, and I generally answer his technical questions, but there a time when he already has enough to find his answer. it's not our job to pound out a full working code. we are here to advice and to help when others are in real need. posting just to post is not my religion.
modified on Tuesday, December 18, 2007 10:33:26 AM
|
|
|
|
|
Sometimes, I get over helpful. However, I just modified his code a bit and asked him to play with the order of the member variables to lead him to his own Aha! moment. Of course, his post proved:
He was what I thought he was, and I let him off the hook.
Geo
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I agree a bit with you, but disagree too. Maybe is not "fair" to give him the easy answer, but for other users that maybe don't have had the "problem" or "question" before (i.e. me) an easy answer is full worthy to learn. Actually I have to say that altough GG is sometimes annoying, some of his questions had been interesting and the answers ave been very usefull for me to get some points that I hadn't even thought about.
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?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
The compiler will give the class initialize implicitly.In the book "Inside the C++ Object Model", it detailed specifically.
Later buggers harm more.
|
|
|
|
|
Hi
I need to make the header font bold in my ListControl. How do I do that?? Whihc message should I handle?? I dont see any variable in the NMLVCUSTOMDRAW structure for doing this. Please help
With Reagards
Vikas
|
|
|
|
|
Hello,
I have declared a namespace for 3 of my classes and changed the declarations accordingly using : : but I don’t know how to change the declarations of message maps.
In the following I get error saying
Dialog::OnCreate' : member from enclosing class is not a type name, static, or enumerator
error C2065: 'OnCreate' : undeclared identifier
error C2440: 'type cast' : cannot convert from 'int *' to 'int (__thiscall CWnd::*)(struct tagCREATESTRUCTA *)'
BEGIN_MESSAGE_MAP(f::Dialog, CDialog)
//{{AFX_MSG_MAP(CDynDialogEx)
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_HELP, OnHelpMsg)
ON_WM_MEASUREITEM()
ON_WM_DRAWITEM()
In the above OnCreate() is the message handler function
Prithaa
|
|
|
|
|
I don't understand well you question. Do you put namespace around your CDialog inherited class?
Can you post the relevant code?
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.
|
|
|
|
|
prithaa wrote: I have declared a namespace for 3 of my classes and changed the declarations accordingly using : :
Why?
Adding
using namespace f; did not help?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Make sure you understand what the various message map macros expand to.
The message map is a static member variable of the class. If you wrap
the dialog class declaration in a namespace then wrap the dialog
implementation in that namespace.
Move the message map table definitions into the same namespace the
dialog class is declared in.
namespace f {
class CAboutDlg : public CDialog
{
protected:
afx_msg void OnButton1();
DECLARE_MESSAGE_MAP()
};
}
namespace f {
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
END_MESSAGE_MAP()
void CAboutDlg::OnButton1()
{
}
}
|
|
|
|
|
Hi,
I need to create a unique id which consists only of numbers (0-9), and needs to be of a certain length (not more than 37 chars).
How can I do this?
I know that here is GUID, but this creates a hexidecimal number.
Thanks
|
|
|
|
|
Well, I think it is far easier to change the GUID representation than writing your own algo to create a unique ID . Unfortunately, a 128-bit wide number (as GUID is) requires more than 38 decimal digits.
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.
|
|
|
|
|
yes - that's exactly my problem
|
|
|
|
|
yes - that's exactly my problem
If I use part of the GUID that is generated and convert that to decimal. will that still be globaly unique?
|
|
|
|
|
SWDevil wrote: If I use part of the GUID that is generated and convert that to decimal. will that still be globaly unique?
No.
BTW why have you such a requirement constraint (just curious)?
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.
|
|
|
|
|
The requirement is a 64 char string.
But there is a first part that I have to include, and for the second part I have to generate a unique ID.
Both parts together should not be mopre than 64 chars.
|
|
|
|
|
BTW, do you really need a Global Unique Identifier?
GUID exist because ID creation must be shared (anyone may create his unique IDs via Guidgen) and not bound to a centralized mechanism
(as the one assigning car license numbers), do you have such a strict requirement?
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.
|
|
|
|
|
Could you get away with using a timestamp (probably including milliseconds?)
Thats nowhere _globally_ unique, but unique to every point in space. And maybe that is enough?
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I am thinking of using GetTickCount, but I understand that this might return a negative value? Is this true?
|
|
|
|
|
SWDevil wrote: ...GetTickCount...might return a negative value?
No. It returns a DWORD, that is unsigned.
It wraps around after 49,7 days, though.
Win95 used to crash after that uptime. Not that it was generally able to stay up that long without crash anyway.
time64 returns the seconds since UTC. It wraps around somtimes in the year 3000
If you really need, you could mix in the milliseconds since startup (GetTickCount)
time64 relies on the computers clock being set - tampering with the clock *could* make your UID non-unique. That may or may not be a problem.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?
|
|
|
|
|
On my system (VS 2005), the following define (note: ends with DEPRECATE)
#define _CRT_SECURE_NO_DEPRECATE
works, while
#define _CRT_SECURE_NO_WARNINGS
not.
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.
|
|
|
|
|
Anthony Appleyard wrote: Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?
I put this in Project Properties --> C/C++ --> Preprocessor definitions.
Maxwell Chen
|
|
|
|
|