|
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
|
|
|
|
|
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: In VC++6, the dotted-line rectangle displays automatically for dialog based applications
Not in my machine. In both vc6 and vc8 I checked, for displaying the focus rectangle, either you have to press tab or ALT key.
Maxwell Chen wrote: But latter versions of Visual C++ do not unless user press the ALT key.
A difference between the apllicaton created in vc6 and later are, by default the applications will be using version 5 of comctl32.dll, where as in later version of vc, it will be using version 6 of comctl32.dll ( that y u get the XP look and feel for the application created in vc7 or vc8 ).
|
|
|
|
|
Naveen wrote: Not in my machine. In both vc6 and vc8 I checked, for displaying the focus rectangle, either you have to press tab or ALT key.
You are right! I doublechecked again with VC6, and it does not under WinXP. (It might be in Win2K / WinNT4 time ...)
Maxwell Chen
|
|
|
|
|
Are you looking for DrawFocusRect() ?
"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: Are you looking for DrawFocusRect()?
This solution works, too. Thanks!
Maxwell Chen
|
|
|
|
|
Finally I realized that to return FALSE in OnInitDialog solves it, too.
Maxwell Chen
|
|
|
|
|
Just looking for a point in the right direction. I need to enumerate the existing network connections (like those listed in "Connect To"...
Would like to be able to determine which is active and other characteristics of the connection, including the underlying device...
Where should I look? (I hope it's not WMI)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Have you looked 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
|
|
|
|
|
Hi all,
Say I want to find the number of characters in a string. In simple way, get the length of the string and then count the numbers of space, tabs and the difference gives the number of characters. Here is a simple code.
int iSpace = 0;
int iRet = 0;
int iTabs = 0;
int iLength;
string strString("One Two Three ");
iLength = strString.length();
for(int i = 0; i<ilength;i++)>
{
if(strString.at(i) == ' ')
{
iSpace ++;
}
if(strString.at(i) == '\t')
{
iTabs ++;
}
if(strString.at(i) == '\r')
{
iRet ++;
}
}
cout << (iLength - (iSpace + iTabs + iRet));
cout << endl;
<pre>
Should I do anything more on this to make more reliable the result. :-D
I appreciate your help all the time...
Eranga
|
|
|
|
|
The character classification functions may help you
MSDN link[^]
they let you do things like:
char c;<br />
..<br />
if (isspace(c)) {}<br />
<br />
if (isalnum(c)) {}<br />
<br />
etc
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|