|
You probably forgot to link against gdiplus.lib.
|
|
|
|
|
Thanks; please how do I link against gdiplus.lib?
|
|
|
|
|
Depends of the IDE you are using. For VC2005: open your project properties -> "Configuration Properties" -> "Linker" -> "Input" and add "gdiplus.lib" in the "Additional Dependecies" option.
|
|
|
|
|
put this in your stdafx.h under your include.
#pragma comment(lib, "GdiPlus")
|
|
|
|
|
Thanks. #pragma comment(lib, "GdiPlus") works.
|
|
|
|
|
Guys,
I have a small problem.
Our product, a monstruous C++ application (MFC I think) provides functions for automation. It allows you to create other applications that can click a button, set/get text from various controls etc...
One of the things I do in code is read out a column from a list. (CListView??)
This is where the problem lies, occasionally, apparently completely random and without any clear reason (at least, not as far as we could discover ) it fails to read out the value although there is one in the list. I have never ever been able to reproduce it on my Dev machine (Xp), but on the test machine it happens (Windows 2000). After some analysis I figured it must be some data corruption, because if you refresh the data from our application it suddenly works correctly again (refreshing takes too long so we try to avoid it).
Question: Could this be Windows 2000 related? Maybe it's fixed in a SP?
I tried google, but I'm not sure what to search on...
Many thanks.
|
|
|
|
|
V. wrote: Our product, a monstruous C++ application (MFC I think)
too funny
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Does your application log events? Have you tried using an external debugger (like DebugView[^]) with OutputDebugString()[^]?
Besides that, providing concrete information - like it *is* an MFC project, the control *is* a CListView, etc., would be more beneficial (to you, for sure, and to the ones trying to answer you as well)
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
mm, you're right. I should have given more info.
It's definetely MFC, of that, I'm pretty sure (99% ).
If I get the properties of the List it just says List Control. (CListControl should then be the class, right ?).
To find the actual code behind will be very, very hard as it seperated from the GUI (and as said in original post, "monstruous").
It logs tons of things, but we were never able to find the exact cause. We did add additional logging, now we have to wait until it actually occurs again.
The only thing I am sure of is that it cannot read the line correctly for some reason (in rare cases). The only link I have found thusfar is Windows 2000 as I never got it in Windows Xp. (but it could be something else)
thanks
PS: I know it's probably not detailed enough, but that's also the only info I've got.... I understand if you can't help me with this info .
|
|
|
|
|
Hello everyone,
Is thers any built-in way to determine whether or not an application is running already?
Thanks in advance
|
|
|
|
|
|
|
Hi all,
I am working on VC++ 2005,SDI type application.
in any form or dialog box three buttons use as system menu, those are Minize,Maximize or Close.
if Window is already maximize then the Maximize button replace by Restore Down.
i want if i m clicking on button of Restore Down ,then my application not restore it is get same size as same in case of button Maximize.
can it possible, please tell me ur Valuable suggestions for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
You'll probably have to code this yourself with GetWindowPlacement() , SetWindowPlacement() and storing the coordinates in the registry.
Have a look at the code in "ResizableState.cpp" from this library:
http://www.codeproject.com/KB/dialog/resizablelib.aspx[^]
modified on Friday, June 6, 2008 7:40 AM
|
|
|
|
|
You may need to have your CFrameWnd -derived class handle the WM_GETMINMAXINFO [^] notification. Windows calls it when adjusting the size of a window.
|
|
|
|
|
Hello!
I have created a custom edit control that uses COleDropTarget to accept/insert text drops. This works very fine.
However, when putting the edit control into a group control in the resource editor of Visual C++, the group control prevents the edit control from getting drag&drop notifications.
Is there any way to make the group control "forward" the drag&drop notifications? Or any other way such that the edit control sees the drop?
Best regards
Dominik
|
|
|
|
|
Hi all,
In an if statemen if ((Comp1) && (Comp2)) is Comp1 evaluated first and Comp2 after?
I mean, if Comp1 changes a variable, will this variable be changed by the time Comp2 is evaluated? Hence, can I use a variable assigned in the first comparisson to perform the second? Or would I have to do two if's in a row?
if(Comp1)
if(Comp2)
Thank you!
|
|
|
|
|
Yes, Comp1 is evaluated first. And also, if Comp1 is false, then Comp2 won't be evaluated. So you the variable will be modified once you check the second comparison.
|
|
|
|
|
yes, comp1 is avaluated before comp2.
also, you have to know that depending on the comparison operator used, the other "comps" may not be evaluated.
check this :
if ((1==1) || (c == d)) ...
here, the test (c == d) is never performed, because (1 == 1) is true, so true OR anything is actually true.
same is this :
if ((0==1) && (c == d)) ...
same is (0 == 1) always returns false, so false AND anything is false...
so if that even happens, when you have a function call of a variable modification in such a construction, it may not be performed...
basically, a if/while conditional statement should be used only for testing a condition to avoid mistakes.
|
|
|
|
|
piul wrote: In an if statemen if ((Comp1) && (Comp2)) is Comp1 evaluated first and Comp2 after?
It's called short-circuit evaluation.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Also, if you're not entirely clear on operator precedence and
ssociativity in C++, then maybe keep a link to this handy:
Operator Precedence and Associativity[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
void main
{
float a = 5.0 , b = 0.1 ;
float c ;
c = a + b ;
if( c >= 5.1 )
{
printf( "OK" ) ;
}
else
{
printf( "Not OK" ) ;
}
//in the above code c does not contain the the result i expected , it filled with 5.099999 and i get the output Not OK.
how i can check the value of c ? please help me
Thanks & Regards
|
|
|
|
|
That's because of floating point precision. Your float will never be represented exactly. Check this[^]
|
|
|
|
|
nitin3 wrote: //in the above code c does not contain the the result i expected , it filled with 5.099999 and i get the output Not OK.
how i can check the value of c ? please help me
Try this... works for me...
void main()
{
float a = 5.0f , b = 0.1f ;
float c = a + b;
if( c >= 5.1f )
{
printf( "OK" ) ;
}
else
{
printf( "Not OK" ) ;
}
}
Always append "f" to a float value else it's treated as a double, earlier you were comparing a float var and a double var.
Explained further -> http://nibuthomas.wordpress.com/2007/06/08/comparing-two-float-values/[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
floating point numbers are limited in resolution. They can get very close to the result, but not necessarily exact. You can minimize the problem by using "double" instead of "float", but that doesn't eliminate things. One quick fix is to simply use a small delta value in your computations. For example:
float delta = 0.000000001;
where delta is some number much smaller than you care about in your program. Then for greater than comparisons include it
if (c >= (5.1 + delta)) printf("OK");
|
|
|
|