|
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
|
|
|
|
|
|
I got a "Database Timeout" error.
I m using an MFC application with MSDE database.
What can be the reason(s) for this??
|
|
|
|
|
wrong coding?
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
|
|
|
|
|
yashveer wrote: What can be the reason(s) for this??
I suspect there is a problem with your code. I could be wrong, 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 all,
I am trying to work with video files larger than 6GB. The MFC file classes use DWORD's for position and length, which limits them to 4GB. I knwo there are equivalents for routines like CFileFind::GetLength or CFile::GetPosition, etc. but I can't seem to find them. Does anyone have an idea?
Thanks in advance.
William
|
|
|
|
|
William Engberts wrote: CFileFind::GetLength or CFile::GetPosition, etc
U can use the API's directly.
GetFileSizeEx()<br />
SetFilePointerEx()
|
|
|
|
|
Not sure what version of VS you are using, but the file handing classes in the MFC (CFile etc) were updated to handle large file sizes. So the CFile::GetPosition() now returns a ULONGLONG, Seek() has a LONGLONG parameter...and so forth.
I now about the file limitation for VS6, but for the MFC 7.0 (VS7.1), these were updated.
I Dream of Absolute Zero
|
|
|
|
|
you may use CreateFileMapping and ViewMapOfFile to map such files into your process address,__int64 will be ok.
DWORD dwFileLo = ::GetFileSize(hFile,dwFileHi);
ASSERT(dwFileLo != INVALID_FILE_SIZE);
__int64 qwFileSize = dwFileHi << 32 | (dwFileLo & 0XFFFFFFFF);
Later buggers harm more.
|
|
|
|
|
|
Dude! Information overflow!!
Condense your code sample and ask again, else I doubt anyone would consider wading through all of that.
I Dream of Absolute Zero
|
|
|
|
|
|
are you kidding ?
you don't even formt your questions
reported as abusive dude !
|
|
|
|
|
I'm all curious now what his second question was.
I know the first was... "Here's 500 lines of my code, not even using the pre tag. What's wrong with it?".
Iain.
|
|
|
|
|
How to programmatically make the dotted-line rectangle show on the focused button when a dialog based application is just launched? Thanks!
In VC++6, the dotted-line rectangle displays automatically for dialog based applications. But latter versions of Visual C++ do not unless user press the ALT key.
Maxwell Chen
|
|
|
|
|
Erm, I'm pretty sure this is an OS settings. You haven't upgraded your PC too..?
Iain.
|
|
|
|
|
Iain Clarke wrote: Erm, I'm pretty sure this is an OS settings. You haven't upgraded your PC too..?
I am still using WinXP with SP2.
Maxwell Chen
|
|
|
|
|
If you look up SystemParametersInfo and SPI_GETKEYBOARDCUES , they're the parameters that govern whether keyboard shortcuts show up.
But you're more interested in the focus rectangle on a dialog... I'm assuming that's related. But if not, just make sure you have a tab stop order set appropriately, and that your buttons have the WS_TABSTOP set. Beyond that, I have no idea...
Iain.
|
|
|
|
|
Iain Clarke wrote: just make sure you have a tab stop order set appropriately, and that your buttons have the WS_TABSTOP set.
Yes, tab order of the button is set, and WS_TABSTOP is set for the button (therefore when ATL is pressed the rectangle show up on that button).
Iain Clarke wrote: SystemParametersInfo and SPI_GETKEYBOARDCUES
And I added the below in MyDlg::OnInitDialog(), but I don't even see the menu-access key underlined... (unless ALT is pressed)
SystemParametersInfo(SPI_SETKEYBOADRCUES, TRUE, NULL, 0);
(Weird?! It does not allow copy and paste when editing this post? )
Maxwell Chen
|
|
|
|
|
Doesn't it have to be...
BOOL bOn = TRUE;
SystemParametersInfo(SPI_SETKEYBOADRCUES, 0, &bOn, 0);
?
Iain.
|
|
|
|
|
Iain Clarke wrote: Doesn't it have to be...
BOOL bOn = TRUE;SystemParametersInfo(SPI_SETKEYBOADRCUES, 0, &bOn, 0);
Oh I made a mistake. This solution works! Thanks.
Maxwell Chen
|
|
|
|