|
Oh no, not a mistake, it was merely a minor defect.
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.
[my articles]
|
|
|
|
|
Chandrasekharanp wrote: How do i display time and date in an application?
In the same way you would display anything else. If it's a GUI application, most controls support the WM_SETTEXT message. If it's a console application, check out cout or printf() .
"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 guys. I am using Form View and trying to draw on a dialog box that is a child of the form view. I realized that it does not have a virtual function i can override unlike In CView. Please help.
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Can't you implement the Dialog WM_PAINT message handler (OnPaint )?
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.
[my articles]
|
|
|
|
|
Thanks. I had not thought of that. But first let me view you article!!
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Wamuti wrote: Thanks. I had not thought of that. But first let me view you article!!
Thanks, Have a look also at Libor's one [^](there algo implementation is cleaner).
Wamuti wrote: Wamuti: Any man can be an island, but islands to need water around them!
shouldn't be too, should 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.
[my articles]
|
|
|
|
|
Hello everyone,
I am using perfmon to watch the working set and virtual bytes, when I do a keyword search in SourceInsight.
I found the value of working set is larger than virtual bytes when do a search, I am confused how could working set larger than virtual bytes? I have this confusion is virtual bytes is all things -- reserved, committed memory -- which includes RAM (working set) and page swap file. So, virtual bytes should be always larger than working set.
BTW: I watched that private bytes is always lower than virtual bytes when do the search.
thanks in advance,
George
|
|
|
|
|
Sometimes pages are left in the Working Set of a process even if they are not in use, hence the number might be larger than the process' virtual address space.
"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
|
|
|
|
|
Thanks DavidCrow, great!
Your reply is great! I have made some self-study as well. The following MSDN page describes the situation when the unused pages are put on system standby list if the system has enough free memory, I think this is one of the situations when it will make the working set larger than virtual memory?
Do you agree? Any comments about my new findings?
This new case is mentioned here,
http://support.microsoft.com/kb/108449/en-us
--------------------
Process pages that are paged out of your process space are moved into the "standby list," where they remain until sufficient free RAM is available, or until system memory is low and they need to be reused. If these pages are accessed by your process while they are still on the standby list and more RAM has become available, they will be "soft-faulted" back into the working set. This does not require any disk access, so it is very quick. Therefore, even though you have an upper limit to the size of your working set, you can still have quite a few process pages in memory that can be pulled back into your working set very quickly.
--------------------
regards,
George
|
|
|
|
|
Are you asking whether I agree with you, or an article on MSDN? I realize that MSDN and its authors are not infallible, but why constantly ask if we, a small set of CP developers, agree with it? Whether we do or not is irrelevant.
"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
|
|
|
|
|
My mistake not making myself understood.
I mean whether you think my understanding of the MSDN article is correct...
regards,
George
|
|
|
|
|
Hi,
I have a multi-icon resource which has a bunch of different icons within it:
resource id: IDI_MYICON
16x16 (16 colours, 24-bit, and 32-bit)
32x32 (16 colours, 24-bit, and 32-bit)
48x48 (16 colours, 24-bit, and 32-bit)
'LoadIcon' takes a 'BOOL' which can be used to select big or small. How can I load the 48x48 icon at the best possible quality which can be drawn to a window?
Cheers,
Lea Hayes
|
|
|
|
|
Have you tried LoadImage?
modified on Thursday, January 10, 2008 4:24:50 AM
Sample:
HICON hIcon = (HICON) LoadImage( AfxGetInstanceHandle(), MAKEINTRESOURCE( IDI_ICON1 ), IMAGE_ICON, 48, 48, 0 );
DrawIconEx( dc.m_hDC, 0, 0, hIcon, 0, 0, 0, 0, DI_NORMAL );
DestroyIcon( hIcon );
|
|
|
|
|
Hi,
Thanks!! I hadn't tried the 'LoadImage' function, the following works great!
HICON hIcon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(nResID), IMAGE_ICON, 48, 48, LR_SHARED);<br />
::DrawIconEx(pDC->GetSafeHdc(), rtItem.left - THUMB_OFFSET + 6, rtItem.top + 6, hIcon, 48, 48, NULL, NULL, DI_NORMAL);
Many thanks!
Lea Hayes
|
|
|
|
|
I had modified my post with a sample... please have a look.
|
|
|
|
|
It works.
Now I want to hide its caption, and make its bord not draggable?
(To make it dock at the top side all the time, and keep its size)
Thanks.
|
|
|
|
|
BCGSoft has no documentation or support?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It isn't documented, I searched the source code, it's BCGM_CHANGE_ACTIVE_TAB.
|
|
|
|
|
i have an opened file handle( using CreateFile() ).
i want to read a single line from it, or upto a special character. how to do that ?
Thanks & Regards
|
|
|
|
|
You can use of CFile::Read.
|
|
|
|
|
You're using a rather low level API to perform your task.
The proper function to read a file from the handle obtained with CreateFile is the ReadFile function [^] that you can use of the following ways (among others...):
Approach 1: Read a single character at time and stop whenever you get your line terminator (for instance '\n' ).
Approach 2: Read a big chunk of the file (maybe the whole file) and the search the lines inside the read memory buffer.
Please note that you can alternatively perform your I/O task using:
- The CStdioFile class of MFC taht features the ReadString method [^] to read a single line of text from a file.
or
- The STL 's std::ifstream that similarly features a getline method [^].
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.
[my articles]
|
|
|
|
|
Read the complete file in a buffer and find your special character with byte compares.
Greetings from Germany
|
|
|
|
|
Dear All,
My project code is getting migrated from MFC excutable to ATL COM Dll. We are using GSL (GNU Scientific Library) for complex mathematical calcualtions.
GSL internally had some data structures, which are being initialized when loaded.
The data structure initialization is happening when GSL was loaded from MFC executable.
But its is not happening properly when loaded in COM Dll.
The code is getting complied and running. But GSL data initialization is not happening.
I couldn't find out the reason.
Thanks very much, Nani
|
|
|
|
|
Well, I think you need to post some 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.
[my articles]
|
|
|
|
|
Hi
I hvae a .bmp file . Now I want to show the image on dc using
StretchDIBits() function . how can i get its
CONST VOID *lpBits, // bitmap bits
CONST BITMAPINFO *lpBitsInfo, // bitmap data
parameters from .bmp file
Trioum
|
|
|
|