|
The result of the equation below should be 18.056298955613577023498694516971, but I cannot get anything other then 00 and I don't know why. Anyone else know why?
UINT answer = (36883 / 49024) * 24;
|
|
|
|
|
Integer division of 36883 by 49024 is zero. Multiply that by 24 and you get zero.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I understand that but I cannot find a solution to this problem. If done by calculator it comes out like this;
36883 / 49024 = 0.75234578981723237597911227154047
0.75234578981723237597911227154047 * 24 = 18.056298955613577023498694516971
|
|
|
|
|
Try (36883.0 / 49024.0) * 24.0.
The compiler thinks you're declaring integers, because you aren't including the decimal point.
As mentioned above, integer division of your values results in zero.
|
|
|
|
|
|
Hi
How i can :
run an *.exe file and then stop it ?
|
|
|
|
|
Use ShellExecute()for starting exe , why you want to stop exe?
Regards,
Abhi Lahare
|
|
|
|
|
i have to close exe and run it to update some other tasks.
|
|
|
|
|
|
How can I read/write registry entries in an mfc dll?
e.g. can I use the CWinApp interface ?
Thanks.
- KarmaFX
|
|
|
|
|
karmafx wrote:
How can I read/write registry entries in an mfc dll?
The same way you would in an EXE...with the registry API.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks..
Okay, so I guess I cannot do it the MFC way ?
i.e.
CWinApp* pApp = AfxGetApp();
CString key = "Preferences";
CString f = pApp->GetProfileString(key,....
int l = pApp->GetProfileInt(key, ....
....
?????
|
|
|
|
|
Sure, you can use the CWinApp() methods, but they are slightly less flexible that the API itself. It really just depends on exactly what you are wanting storing and where.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Ok...so now my questions boils down to:
How do I get a CWinApp interface within a dll ?
in my experience AfxGetApp returns null in dll's...
Thanks again.
- KarmaFX
|
|
|
|
|
There are several decent registry classes here on CodeProject.
Why not choose one and use it?
Ignore the CWinApp stuff
|
|
|
|
|
karmafx wrote:
How do I get a CWinApp interface within a dll ?
Unless your DLL already uses MFC, you can't.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Take a look at the CRegKey class.
Larry J. Siddens
|
|
|
|
|
Thanks alot !
- KarmaFX
|
|
|
|
|
in the following code iam trying to save an edited icon with its relevant pixel information.
But iam unable to save in Iconformat using the specifier ImageFormatIcon.
But the same can be saved in Bmp format using the specifier ImageFormatBMP
Can anyone let me know the reason.
CImage icon_image;
icon_image.Create(sizex, sizey, 8);
// Fill color table with pre-defined colors
RGBQUAD FAR* pRGB = new RGBQUAD[nColors];
DWORD dwval;
UINT r, g, b;
int j;
for (int i=0; i
|
|
|
|
|
I try to make some DoModol when user click whith right button of mouse on CButton , but i cant catch click above.
please help me. . . .
|
|
|
|
|
Right-clicking a button is not very intuitive. What exactly is it that you are trying to do?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
i need to popup window dialog (something like menu popup),
the dialog/menu will popup on right click button.
|
|
|
|
|
Create a new class and inheriate the CButton class...
class CMyButton : public CButton
{
. . .
}
Then capture on the WM_RBUTTONDOWN message. Using the wizard for VC6.0 and the properties for VS2003.
In there do what you need to do.
Hope this helps.
Larry J. Siddens
|
|
|
|
|
ok , this is the "long" way that i thought about ,
but can`t i do it with out creat new class ??
does microsoft didnt make to us "easy" to us easy life ?
|
|
|
|
|
yanshof wrote:
but can`t i do it with out creat new class ??
No you have to make you own class derived from CButton!
yanshof wrote:
does microsoft didnt make to us "easy" to us easy life ?
Don't you think MS already make you life easy by providing Inheritance to there proprietary classes
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|