|
Is there an easy way to do this without subtracting one from the other? Maybe some fancy math function already built?
|
|
|
|
|
|
Not that I know of. I have a function called
bool DoublesAreEqual(d1, d2, tol)
{
if (fabs(d1 - d2) < tol)
return true;
return false;
}
which does the job. It has the added advantage of allowing you to test to the tolerance you want so if you only need to compare to 2 decimal places you can.
This is a holdover from ancient C days so there may be a better way to do it with operator overloading.
Any one else have a suggestion?
I'm pretty sure I would not like to live in a world in which I would never be offended.
I am absolutely certain I don't want to live in a world in which you would never be offended.
Dave
|
|
|
|
|
Hi,
I am working on a project in win32 that involves multiple monitors.
Usually as soon we connect a new monitor, we would go the desktop properties, settings to extend the window desktop to the new monitor...
I want to do this through my program. My scenario is, the users connect and disconnect monitors on fly while executing my app. I dont want the users to go and manually extend the desktop for the monitors they plugin.
Any ideas...
Thanks in advance.
|
|
|
|
|
i have a shared directory with 40000 files and 11G. When using AutoCad to open a sigle file, it takes very long to open and sometimes it freeze.
OS => XP, win2000.
Win. Index service is on.
thanks.
|
|
|
|
|
|
how can i speed up when loading files? it's no sense that it takes so much times.
|
|
|
|
|
is it a C++/MFC programming question ? or an Operating System question ? or a General question ?
what takes a long time ? showing the file dialog or loading the file itself ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
open the file itself. it's not a programming issus
|
|
|
|
|
|
Wich are your machine specs? And AuctoCAD version? Besides, is it Windows XP or Windows 2000? =$
If you don't have much RAM memory, then having all those files on the same directory is not a good idea.. That's probably why it is crashing.
Also notice this is a Visual C++ / MFC forum.. Next time choose the appropriate forum for your posts.
regards [[]]
hint_54
|
|
|
|
|
i have a shared directory with 40000 files and 11G. When using AutoCad to open a sigle file, it takes very long to open and sometimes it freeze.
OS => XP, win2000
thanks.
|
|
|
|
|
|
I write a programm with C# and it's ok. But with Visual c++, I have the error: "include 'ATLComTime.h' not found. I add it in my project, but ich get new errors like the first one.
Why can i do to eliminate these errors?
Thank you.
Rick
|
|
|
|
|
didn't you forget the #include its header in the file that's using it ?
|
|
|
|
|
erikamania wrote: write a programm with C# and it's ok. But with Visual c++,...
hhmmm why do you want to compile your C# program with Visual C++ ?????????
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hã? You can't compile C# with a C++ compiler... But if the problem is an #include directive, then try adding the file's path to the "directories" list. Access Tools | Options and then click "Directories". But I'm not shure that's what is happening to you.
regards [[]]
hint_54
|
|
|
|
|
I'm Creating an ActiveX subclassing "EDIT". I would
like it to be able to change the colour of the background, text or indeed
both.
I've added the BackColor and ForeColor as Stock implementation.
I've changed below:
BEGIN_PROPPAGEIDS(CEditTestCtrl, 1)
PROPPAGEID(CEditTestPropPage::guid)
END_PROPPAGEIDS(CEditTestCtrl)
to
<CODE>BEGIN_PROPPAGEIDS(CEditTestCtrl, 2)
PROPPAGEID(CEditTestPropPage::guid)
PROPPAGEID(CLSID_CColorPropPage)
END_PROPPAGEIDS(CEditTestCtrl)
</CODE>
I've also modified the OnDraw method to;
<CODE>void CEditTestCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
DoSuperclassPaint(pdc, rcBounds);
pdc->FillRect(&rcBounds, &CBrush(TranslateColor(GetBackColor())));
}</CODE>
The Bakground colour changes. The problem lies when enter text in the control, the control reverts back to the orignal colour.
The question is what is the correct way in achieving this?
-- modified at 16:03 Tuesday 14th March, 2006
|
|
|
|
|
Hello Alton Williams,
I don't have answer to your question but i just want to know why are you doing this through ActiveX control. I mean you can change the background and text color of standard Edit control by Handling WM_CTLCOLOR Message. Is ActiveX your requirement?
Muhammad Azam
|
|
|
|
|
Muhammad Azam wrote: but i just want to know why are you doing this through ActiveX control
Answer this is a component of my result.
Muhammad Azam wrote: I mean you can change the background and text color of standard Edit control by Handling WM_CTLCOLOR Message.
I know that I want to able to have the result on VB, Delphi, VC++ ect.
|
|
|
|
|
Alton Williams wrote: void CEditTestCtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& cInvalid)
{
DoSuperclassPaint(pdc, rcBounds);
//added
pdc->FillRect(&rcBounds, &CBrush(TranslateColor(GetBackColor())));
}
Use pdc->SetBkMode(TRANSPARENT) to make text background transparent.
Nibu thomas
Software Developer
|
|
|
|
|
I need to verify that the outputs from two separate builds, using the same source code, is equivalent. If I compare the DLLs, there are 13 bytes that are different. Is there a tool somewhere that can do this kind of comparison?
Thanx,
Steve
|
|
|
|
|
Use fc /b file1 file2 from a command prompt.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I've tried that. There are 13 bytes that are different. I can see no reason for them to be different since the source code is the same and the same version of Visual C++ is being used. Is there a build date or something in the DLL that would cause the miscompare? If so, is there a way to ignore it?
Thanx,
Steve
|
|
|
|
|
Steven Mattison wrote: Is there a build date or something in the DLL that would cause the miscompare?
I think I read somewhere in the PE literature about the linker writing date-related information to the file. It should be the number of seconds since December 31st, 1969 @ 4:00 P.M.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|