|
i would use shared DLL usually but the main problem which i faced as an AMATUER programmer was tht my program wont run on my friend system! so static DLL helped me out! though the size of the exe incresed to few MBytes but atleast i got STANDALONE application 
|
|
|
|
|
How to convert double value to float value.
please look at the following code
double dDoubleValue = 200.55000000.
float fFloatValue = (float)dDoubleValue;
output will be 200.54999999, but i need exact value 200.55000000.
|
|
|
|
|
Sakthi_Vel wrote: but i need exact value 200.55000000
floating point numbers are never exact.
|
|
|
|
|
You can use FLT_EPSILON.
For more information visit here[^]
|
|
|
|
|
round it when you are showing the value.
Russell
|
|
|
|
|
As by drawing with a "big" point :P ??
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Here[^] you will need a very BIG point!
Russell
|
|
|
|
|
What Every Computer Scientist Should Know About Floating-Point Arithmetic[^].
See also this post[^] of mine about rounding in SQL Server.
If you need an exact decimal, perhaps for currency values, use a scaled integer. These are harder to find in C++, there's no standard implementation as far as I know, but basically treating an integer as if it were in cents rather than dollars, or pence rather than pounds, generally works pretty well.
|
|
|
|
|
so there is no way to convert in c++ as of explanation ;)
|
|
|
|
|
Had you read up on how floating-point numbers are stored/represented on a binary computer, you'd already know the answer to your question.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to initialize my tree control with system directory tree in OnInitdialog function so that i can select my folder.
Remember I am working in mfc.
please help me.
Dhiraj
Dhiraj Kumar Saini
|
|
|
|
|
|
I have used the code with the link but it is giving error.
Can u give ne another link or code
i know its simple but not able to do it.
Thanks In advance.
Dhiraj
|
|
|
|
|
Dhiraj kumar Saini wrote: it is giving error
It is strange...What kynd of error?
alseway, in CP there are a section for articles related to custom tree contrlols:
All the articles on CP[^].
I can suggest
this[^]
this[^]
or this[^]
Russell
|
|
|
|
|
|
ACtually when i was trying to use the code of OnInitdialog function in my onititdialog function with InsertItem function it was giving two errors .
thet were related to linking error.
Remeber I am only using cod eof OnInitDialog funcion.
Dont know why.
Dhiraj
|
|
|
|
|
I think you have to study better the code given with the article...surely you have to copy something more than the code inside the function OnInitdialog
Russell
|
|
|
|
|
Hi,
Sorry to bother you I have gone through the code and implemented it also. Now the problem i am facing in my tree control is that it is showing all the drives and network neighbourhood but when i am selecting any one of them it is not expanding. I dont know why although i have added the event handlers for expanding.
please help me.
Dhiraj
|
|
|
|
|
hello to all,
i want to use "Navigate" function of CWebBrowser2 class which i have added as a activex control in my programm but i dont know how to use it in different classes other than CMainFrame and CView class as i dont know what will be the pointer to the frame in which the web site will be dispalyed. Bcoz i want to navigate to a given web site URL after clicking a perticular button of a dialog box means i want to use "Navigate" function in a message handler of that dialog box class, how can i generate a frame in which the web site will be dispalyed.can anybody help me plz.
Thanks and regards,
Anay Kulkarni
|
|
|
|
|
Hello Friends,
I am trying to retrive the Text From rich Edit control. But When I check it it return with empty string only.
I am using the following code
<code>
TCHAR Text[100] = {};
TCHAR SelText[100] = {};
GETTEXTEX GetText;
GetText.cb = wcslen(Text);
GetText.flags =GT_DEFAULT;
GetText.codepage =CP_ACP ;
GetText.lpDefaultChar = NULL;
GetText.lpUsedDefChar = NULL;
SendMessage(hEdit,EM_GETTEXTEX,(WPARAM)&GetText,(LPARAM)Text);
SendMessage(hEdit,EM_GETSELTEXT,(WPARAM)0,(LPARAM)SelText);
</code>
If u find any problem plz tell me. Thnx in Advance
-- modified at 7:46 Tuesday 18th September, 2007
|
|
|
|
|
sizeof(Msg); should return 100.
Also in the second line you are trying to get the selected text, but passing the flag as GetText.flags =GT_DEFAULT. so it will not work.
The first line with EM_GETTEXTEX is working fine with the changes.
|
|
|
|
|
Actully I am using wcslen(Text) instead of sizeof(Msg) Now. But still its giving me empty string in both EM_GETTEXTEX and EM_GETSELTEXT.
TCHAR *Text = new TCHAR[100];<br />
TCHAR SelText[100] = {};<br />
<br />
GetText.cb = wcslen(Text);<br />
GetText.flags =GT_SELECTION;<br />
GetText.codepage =CP_ACP ;<br />
GetText.lpDefaultChar = NULL;<br />
GetText.lpUsedDefChar = FALSE;<br />
<br />
lr =SendMessage(hChild,EM_GETTEXTEX,(WPARAM)&GetText,(LPARAM)Text);<br />
<br />
SendMessage(hChild,EM_GETSELTEXT,(WPARAM)0,(LPARAM)SelText);<br />
According to u I have made the changes. But Getting Access violation Error as below
access Violation in module Riched20.dll write at process 007C8268
I m not getting what is happening.
|
|
|
|
|
Following is the code i m using, and it's working.
CHAR Text[100];
GETTEXTEX GetText;
GetText.cb = sizeof(100);
GetText.flags =GT_DEFAULT;
GetText.codepage =CP_ACP ;
GetText.lpDefaultChar = NULL;
GetText.lpUsedDefChar = NULL;
::SendMessage(GetDlgItem (IDC_RICHEDIT21)->m_hWnd,EM_GETTEXTEX,(WPARAM)&GetText,(LPARAM)Text);
|
|
|
|
|
I am using win32 Dialog based application.
And the RichEditBox is in the other application
I have retrived the Handle of it through FindWindow() Function.
and When I use your code it gives me the Access violation Error.
I am not getting any Error when I set the text in the Rich Edit Control using WM_SETTEXT .
Do you have any idea why this is happening
|
|
|
|
|
if you are using WM_GETTEXT message from different process, in xp you will get Access Denied message (Atleast in an edit box with password option on).
For more information search CodeProject for "SUPER PASSWORD SPY" and read the details.
|
|
|
|