|
OK,
another question:
if Im not creating a window class (using NULL) can I just somehow change the default brush for it ?
|
|
|
|
|
The Bestway to paint the background of ur window is in the WM_ERASEBKGND message.
Steps:
First map the WM_ERASEBKGND and then write the OnEraseBkgnd as follows.
<br />
BOOL CDesktopDlg::OnEraseBkgnd(CDC* pDC) <br />
{<br />
CRect rect;<br />
GetClientRect ( &rect );<br />
<br />
CBrush brush;<br />
brush.CreateSolidBrush ( RGB (255,0,0) );<br />
<br />
<br />
pDC->FillRect ( &rect, &brush );<br />
<br />
return TRUE;<br />
}<br />
Best Regards,
Jijo.
_______________________________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Thanx Jijo
|
|
|
|
|
I added a C file to a CPP proj and got an error complaing about the precompiled header thing. MSDN says I should create a subproject and stick the file in that. However, I would rather not create a new sub project for a number of reasons.
As a solution, I found that I could rename the .c to .cpp and get it to compile file. Everything works but I'm wondering if there is a ticking time bomb just waiting to happen after this program goes into production.
Thanks,
Al
|
|
|
|
|
change the compile setting for the C file to not use precompile headers.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Is it possible to do that for a single file in VC7? MSDN seems to indicate that the only way to do this would be to stick it in its own sub-project.
In any case I would rather not change ANY environment settings because this is for inclusion into an open source project that can be compiled on many platforms/compilers. Renaming it to CPP seems to be the easy way out. It’s just a collection of functions so I really can’t see how it would hurt. But thought it would be good to check with you guys first.
|
|
|
|
|
Hi,
I would like to have an Editor ( IDE, including source code) , with Auto-complete feature,and syntax highlighting, just like what we have in Visual Studio. If anyone has got the URLs for the same, pl. do reply.
Thanks in Advance
Jagadeesh
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
http://www.icsharpcode.net/OpenSource/SD/
(Its for C# though...)
|
|
|
|
|
Thanks for the effort ABean.
But I forgot to mention one thing, I am looking for sourec code in VC++. If you know any, pl. help me by posting the URL.
Best Regards
Jagadeesh
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi, I was curious if it was possible to disable clicks within a rich edit control without disabling the entire control. My problem is even though the user cannot type inside the control, he or she can still click inside of it. Once they do this, any new text written to the control by my app is printed in the new position clicked earlier by the user. Must I line scroll before each attempt to write to the control to prevent this problem. Or is there an easier way. Thanks.
|
|
|
|
|
Anonymous wrote:
Once they do this, any new text written to the control by my app is printed in the new position clicked earlier by the user.
Don't assume anything about the control or the cursor position within. When the control needs to be updated, set the cursor position accordingly, don't assume it's already correctly set.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Anonymous wrote:
I was curious if it was possible to disable clicks within a rich edit control without disabling the entire control.
You can subclass the control and handle click messages like WM_LBUTTONDOWN , WM_LBUTTONDBLCLK , and so on. The message handlers should be empty so that nothing happens in response to those messages.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
it is possible to have a property sheet acting as a dialog bar ? what i want to do is a dialog bar with several pages.
thanks.
|
|
|
|
|
a dialog bar acting as a property sheet, sorry.
|
|
|
|
|
Hi,
I want to update the value shown in dialog box created using CDialog class at real-time. For eg., if i want to show the clock time read from the computer clock(say in secs), how should i go about doing it?Suppose, the value is that of a variable in the program running in the background.
Thanks
|
|
|
|
|
You'll need a control on the dialog template, probably an edit or static control. Using ClassWizard, create a member control variable (CEdit or CStatic ). When it comes time to update the control, use something like:
m_control.SetWindowText(whatever_the_text_is);
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I'm actually using WTL in this project, but this appears to be a basic C++ question so I thought I'd ask it here.
I have class A, which is a base class for class B. Class B is in turn a base class for class C. In class A there is a virtual function. Let's call it Func1(). This function is defined in both class A and C (the A version just asserts, the C version actually does the work). In class B there is a non-virtual function that calls Func1(). As I understand it, it should call the class C version of this function, but instead it's calling the class A version.
Where have I gone wrong?
|
|
|
|
|
because class B is derived from class A. If you don't override Func1() in class B, Func1() from class A will be called because inherits Func1() from it's base class( class A ).
Do not forget that class B is not related with class C. The relationship u described is from C to B and not from B to C.
|
|
|
|
|
Just FYI, this really does work, and is infact the basis of the template design pattern. Where I went wrong: class A was written by somebody else (in this case it was part of WTL written by Microsoft). I thought it was virtual, it wasn't. If it was virtual it would've worked, as I've now found out.
Why it works: The method in class B that calls the virtual function is calling it on the this pointer. Thus, the virtual table is used to figure out which version to call, so even though class B doesn't know about class C, class C's definition of the function is used. Pretty cool when you do it right.
|
|
|
|
|
Dear all,
In Win2k or XP platform, it's easy to get that information through function DeviceIoControl with code IOCTL_DISK_GET_DRIVE_GEOMETRY. However, that solution fails in Windows 98 because we cannot create a file name by CreateFile with file name "\\.\PHYSICALDRIVE0". Windows 98 fails to return a handle to any physical disks. So my question is how I get physical disk geometry in Windows 98. I need some information such as TracksPerCylinder, SectorsPerTrack... From those, I can calculate the actual size of a physical disk.
Thanks for reading my question.
Best regards.
____
Tuan
|
|
|
|
|
Tuan Dang wrote:
So my question is how I get physical disk geometry in Windows 98. I need some information such as TracksPerCylinder, SectorsPerTrack... From those, I can calculate the actual size of a physical disk.
How about GetDiskFreeSpace[Ex]() ?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
How can I use this function in case of PhysicalDrive? I don't know what the first parameter syntax is?
However, those function doesn't return any information for getting attributes of a physical disk such as NumberOfCylinders, TracksPerCylinder, SectorsPerTrack...
Best regards.
|
|
|
|
|
You'll either need to iterate through each logical drive on the physical drive, adding the numbers for each, or create a virtual device driver to be used by CreateFile() .
You might also try looking at the WMI Win32_DiskDrive class, specifically the TotalCylinders and TracksPerCylinder properties.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Personally, I think the first solution is not the best. Examine this sample:
<--------------------------Physical Disk 1----------------------------->
<--Partition 1--->
(Primary)
C:
<------------Partition 2---------->
(Extended)
<---unallocated--->
<---------Logical Drive 1--------->
D:
You see, adding the size of all logical drives cannot give us the total size of the physical disk.
I will try your second suggestion. However, Win98 seems not to be supported. I think we don't have a complete solution for Win98 platform.
Thank you very much.
P.S: can I make a direct contact with you via email?
____
Tuan
|
|
|
|
|
Tuan Dang wrote:
You see, adding the size of all logical drives cannot give us the total size of the physical disk.
True, but in your example, why would you need the total size of the physical disk, since not all of it can be used anyway? For example, if you had an 80GB disk, 30GB for C: and 40GB for D:, that would leave 10GB of unallocated space. Until that 10GB is partitioned and formatted, it's of no use, so why include it in any totals? I'm sure you've got a reason for this, but it's not immediately obvious to me.
I wonder if you need to query the BIOS somehow to find out what it knows about the HD?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|