|
try this:
<br />
if (MAXVAL - size1 < size2)<br />
{<br />
}<br />
else<br />
{<br />
size1 += size2;<br />
}<br />
MAXVAL can be obtained from limits.h as toxcct said.
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
Hi,
how can i convert CString to wchar_t*? for example
CString m_strFilename;
how can i convert m_strFilename to wchar_t*?
i use L"" for string such that L"c:\filename.cpp", but is
there any function or macro do this?
Best Regards.
MJM
|
|
|
|
|
MultiByteToWideChar() is the function you want, but why not just use CStringW ?
|
|
|
|
|
thanks , I use CStringW !
|
|
|
|
|
See
<br />
USES_CONVERSION;<br />
CString str;<br />
str="Test";<br />
<br />
wchar_t* m_wchar = T2W(str.GetBuffer());<br />
str.ReleaseBuffer();<br />
<br />
|
|
|
|
|
Which is almost exactly the same as what I told him. It's ok to use the conversion macros if you are doing a lot of converting, but for a single time it's pointless to add the extra header required.
|
|
|
|
|
|
Hi,
I have a client application in which i first do a Create() and then Connect() to connect to my server application.
The problem is that even if i dont start the server application, i get the Connect() return value as WSAEWOULDBLOCK and no other error value.
How do i determine correctly whether the server is actually available or not ? Am i doing anything wrong ?
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
hi there
I'm a beginner in .net enviroment. I try to make a simple database application like this
http://www.functionx.com/vcnet/data...ridbinding3.htm
it's work's slowly. i'm waiting 5 seconds to make a simple select interogation. i have 3 entry's in that table
why that. what to do??
|
|
|
|
|
Did you see examples in codeproject about databse
|
|
|
|
|
Hi,
I wish to draw a horizontal line in a dialog to delimit two sets of controls. But i cannot find any such thing on the tools panel.
Can anyone please help me out with that ?
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
What I do generally (but maybe it's not the cleanest solution) is to put a picture control and reduce its vertical size to the minimum. Then I open the property dialog (right click on the control -> property) and I modify the style to be sunken. Like that you have a nice line.
|
|
|
|
|
Thanks Cedric. that's a pretty nice trick.
Thanks a lot.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
CoolASL wrote: draw a horizontal line in a dialog
You can also do this:
HDC hdc=::GetDC (m_hWnd);
::MoveToEx (hdc,10,10,NULL);
::LineTo (hdc,100,10);
::ReleaseDC (m_hWnd,hdc);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
You better use group control
you can group the set of controls with this.
|
|
|
|
|
thanks man.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
or you can use from a Static control with set Type to Etched Horz
|
|
|
|
|
hi WhiteSky..
Thanks for the response.
Sorry, i couldnt get that property.
Can you please specify which VS version you are using.
I am using 2003.
Or is it that i am not looking in the right place.
Thanks.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
When you insert picture control in your dialog then in property window set parameter Type->Etched Horz
|
|
|
|
|
CPen pen(RGB(0,0,0));
CClientDC ccd(this);
ccd.SelectObject(&pen);
ccd.MoveTo(0,240);
ccd.LineTo(x,y);
|
|
|
|
|
I want to create the Folder for keep the file that run by my project ,what the function use for this issue.
|
|
|
|
|
You can use the CreateDirectory[^] API function for this.
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
|
It's not a really question about programming issue it's about visual studio problem.
I want to use auto spaces, for instance is I write:
a=1;(without spaces).
I want it automaticly to be:
a = 1;(with spaces).
I tried to find this option but I haven't found(I'm talking about vs 2005 pro)it.
Can anyone tell me please how can I activate this option?
Thank you!
Semion_N
|
|
|
|