|
And this great book «Programming Server-Side Applications for Microsoft Windows 2000» will help you a lot.
A Chinese VC++ programmer
|
|
|
|
|
Hi, i have a variable of type float that get a return value
thats greater than what float or double, long double etc can hold.
The return data does not need to be so precise, example it holds 1.1520230e-007 when it overflows, and i really just
need 1.1520230. However when the variable overflows like this i cant print it, i cant cast it or move it
to a buffer.
Is there a c\c++ function that truncates it, i have tried to cast the return data as type float but no success.
Also i cant pass it to a buffer to then shorten it later as VS ignores the data except in the debug-watch window.
Any ideas are much appreciated.
Regards, Fred
|
|
|
|
|
Hi Fredrick,
sorry, but this does not make much sense.
Overflow is when a number becomes so large the data type can no longer represent it;
it would happen e.g. when you start with one, and keep multiplying by 10.
1.1520230e-007 is not the same as 1.1520230; it is actually 10 million times smaller.
also a number such as 1.1520230e-007 is far away from overflowing either the float or double type.
I suggest you rethink your problem, and/or reformulate what it is you want.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi all,
I'm really desperate to find out how I could link the webcam to a C++ program as I need to launch it on a real time basis! Is there any interface I could use as I'm really clueless as to how I could do it!
Thank You!
With regards,
Jas
|
|
|
|
|
|
i want to create a new process thorugh my programm to simulate 3 lifts.could any one tell me how to create a new process in linux using C
|
|
|
|
|
You might want to try searching for a Linux programming site. The Code Project is almost exclusively oriented towards Windows.
|
|
|
|
|
try the system() API.
int system(
const char *command
);
I believe thats a standard call available on Windows and Linux.
|
|
|
|
|
Of course this is the wrong forum for your question. Anyway, Linux provides fork and execv functions. Have fun with man to find out their usage.
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
|
|
|
|
|
Hai friends
When i create one sample project...
class EDCService :public IFileIO
Service - oneclass
IFileIO -interface class
then, i create instance of the class
EDCService::IFileIO fio;
finallay i compiled...showing below error..please suggest me!!
error C3153: you cannot create an instance of an interface
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
|
How to solve that error?
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
|
hi michel thanks 2 your replay...Already i try this logic ..wen i add that dll..via
(#using "mscorlib.dll")..
showing this error:
fatal error C1190: managed targeted code requires a '/clr' option
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
You are creating object of the Interface IFileIO
rowdy_vc++ wrote: EDCService::IFileIO fio;
Do this:
EDCService fio;
Is this you want??
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
yes i try ...but showing this error
error C2259: 'EDCService' : cannot instantiate abstract class
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
Do you realy need for IFileIO interface?
If you don't need it then remove it.
What declarations you made inside it?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
I tried this::
IFileIO.h
<br />
#pragma once<br />
<br />
interface IFileIO<br />
{<br />
void setData(int xi);<br />
};
EDCService.h
#pragma once
#include "IFileIO.h"
<br />
class EDCService:public IFileIO<br />
{<br />
public:<br />
EDCService(){};<br />
int x;<br />
<br />
void setData(int xi)<br />
{<br />
x = xi;<br />
}<br />
};
Its works fine for me.
I can create instance like this
EDCService serviceObj;
Try it and let me know how it works
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Hi
i use SendMessage(hndl,WM_SETTEXT,0,buufer) to send data in the edit control............ every time the program runs it clears the old text from the edit control and writes the new one to it ......but i want to keep the old data in the edit control and appends the new one ......
tHanks in advance
AbidBhat
|
|
|
|
|
First Get Text from Control and then append your text to this text and then set this combined text to edit control
Got it?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
At first I thought this was a joke but now I think you are serious. I hope programming is just a hobby for you.
|
|
|
|
|
I think you need to save previous data of your program on the registry or a file for read again.
|
|
|
|
|
Not funny.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I dont think my replay is funny?
|
|
|
|
|
manish is right, but there is a more efficient way:
send EM_SETSEL, -1, -1 to move the cursor to the end of the text
send EM_REPLACESEL, (TRUE/FALSE), (LPARAM) "your text" to insert the text at the cursor location (i.e. the end)
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|