|
if i understand u right u need to keep a list of users with ip addresses when they connect
then u can route msgs to specific users
or did i misunderstand completely?
"there is no spoon" biz stuff about me
|
|
|
|
|
Hi !
This is I guess a stupid question, but I'm wondering how in C++ I can round a float :
if I do :
int i=1.6;
I get : i=1;
but I'd like instead i=2 !
Is there an easy way to do this, or do I have to do the work by myself ?
Thanks !
Jerome
|
|
|
|
|
Use ceil(), from math.h.
HTH
Ryan
|
|
|
|
|
Ryan Roberts wrote:
Use ceil(), from math.h.
Well, the result is not the one expected.
I'll try to make myself clear :
the float number 1.6 should be rounded to 2
the float number 1.5 should be rounded to 2
the float number 1.2 should be rounded to 1
the ceil() function always round to the upper integer.
I cannot find the function which will round my float number correctly according to mathematic rules. ceil() and floor() are not doing what I want !
Jerome
|
|
|
|
|
Must listen to question, this is the reason I was always crap at maths.
You actualy want to call.. round().. damn cryptic function names
HTH
Ryan
|
|
|
|
|
Ryan Roberts wrote:
You actualy want to call.. round()..
But it doesn't exists ! I try to find it in the MSDN, but it is not.....
mmmhh it looks like I'll have to write my own !
Jerome
|
|
|
|
|
// this rounds to nearest whole number
int round = (int)((val < 0) ? (val - 0.5) : (val + 0.5));
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Its in stlport. Guess they have to be different
Try #define round(x) floor(x+0.5)
Ryan.
|
|
|
|
|
Try this one:
<br />
double a=1.6; <br />
int i = static_cast<int>(a+0.5);
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
Hi!
I have problems by using QueryPerformanceCounter(), I got the message when compiling;
QueryPerformanceCounter' undeclared (first use this function)
how will I declare it?
|
|
|
|
|
|
I have created a function to update data to paint, and I have put this into the case WM_PAINT (on the WindowsProcedure function), and it works OK when there is a change with the size, etc... but I would activate this functions from my functions, so I thought to call the SendMessage function, but it doesn't work. SendMessage (hWindow,WM_PAINT,NULL,NULL).
somebody can help me?
|
|
|
|
|
Try InvalidateRect(hwnd,NULL,TURE);
The World is getting smaller and so are the people.
|
|
|
|
|
|
i have create a sdi project, use class CEditView. i need to display some font in it, but the CEditView's Font is so ugly so i wanna change other one.
if you know please tell me. thanks.;)
hi i like it and want to make batter...
|
|
|
|
|
1.Create a CFont object.
2.Get the CEdit control from the CEditView
3.Attach the font object to the CEdit control by {CEdit}.SetFont({CFont})
regards,
Prakash.
The World is getting smaller and so are the people.
|
|
|
|
|
but where i put in these code to wicheh function? if i put wrong when i open other new fiel Vc will tell me i have a kill error...
hi i like it and want to make batter...
|
|
|
|
|
I need to use 2 usb keyboards but i must read their states separately
i can use CreateFile & DeviceIOControl but i don't know
name of keyboards (\\\\.\\????)
where i can find list of device names?
if someone knows usb keyboard name mail me
stpg@ukr.net
thanks
|
|
|
|
|
Hi all,
I am developing an Activex control using MFC. In that i am having some edit and combo controls. Can anyone of you suggest how to add tool tip for this controls.
Thanks & Regards,
Gopinath.S
Gopinath.S
|
|
|
|
|
I haven't tried it in ActiveX but I am sure CToolTipCtrl works the same way they do in another MFC app.
Peter Molnar
|
|
|
|
|
Hello all,
Who can give me a sample about how to use DrawCaption().
eg: There is a dialog without default caption as it being created. I want to draw it with the text "MY DIALOG" by calling DrawCaption(). But which paramenter in this function can obtain the text "MY DIALOG" ?
Thanks a lot
|
|
|
|
|
Hi,
Please help me regarding one serious problem in our applications observed recently.
We have developped a VC++ Console based application with windows socket programming and MSMQ's with Multi threading (Using MFC).
It will connect to a server through TCP/IP before start processing and it is a gateway kind of application which need to run for months with lot of load.
The problem we are facing is some times the application is disappearing with out any notification. Till now we observed that out of 3 instances of the same application running on the same machine, One instance got disappeared
We have incorporated ErrorLogging and Try-Catch mechanisms also But did n't observe any useful log.
I would like to know under what circumstances such an application can disappear.
Thanks in advance
Rams
|
|
|
|
|
May be it is terminated due to memory leakes.
The World is getting smaller and so are the people.
|
|
|
|
|
Hi Every one How to avoid Application failure or ASSERT Dialog when application crash.
I dont want famouse Cancel , Retry ,Abort or simple Ok , Cancel Dialog in release mode , to come up .
I want whenever any thing goes wrong , my application simply exit.no intimation to user .
EXIT on ERROR silently is what i want.
can anybody help....
No Worries!
|
|
|
|