|
Use sprintf .
e.g.
char str[200] = {0};
sprintf(str,"%d KB",494);
|
|
|
|
|
that i have tried before send.
i need in the win32(.Net) string variable.
then i will convert it into the wchar and then i put it into the list view
control.
it is char array how can i use it as string ?.
because when i got in the string form.
i can use append function as well as MultiByteToWideChar function.
amit
|
|
|
|
|
amitmistry_petlad wrote: i need in the win32(.Net) string variable.
You have not mentioned this earlier.
amitmistry_petlad wrote: i need in the win32(.Net) string variable
I guess, you are talking about standard library string .
For wide char string swprintf present, too.
amitmistry_petlad wrote: it is char array how can i use it as string ?.
you can use std::string for char array.
i.e.
char arr[] ="some value";
std::string var(arr); and std::wstring for wchar_t array.
I would prefer StrFormatByteSize suggested by James.
|
|
|
|
|
Always adding "KB" is a bad idea - if the size is large, you do not want to write something like 2048KB , you want to write 2MB .
Try the StrFormatByteSize(...) and StrFormatByteSizeEx(...) functions.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hey cool! I never heard of those APIs!
They must be new to Windows 95, huh?
Thanks James!
|
|
|
|
|
In additional you can use of wsprintf of course StrFormatByteSize is better
|
|
|
|
|
Hi,
Just recently, whenever I try to open an existing project with MSDEV 6.0 (SP6), MSDEV crashes. It appears to be only this particular project - I can open others OK. The offending project used to open OK until very recently. As far as I can see, none of the project files have become read-only.
Anyone have any suggestions what I might try?
TIA
Tony
|
|
|
|
|
Try deleting files like .dsw, .ncd, .opt, .plg, .clw etc. and try opening the .dsp file.
« Superman »
|
|
|
|
|
Thanks,
That did the trick!
Tony
|
|
|
|
|
I've installed VS2005 version 8.0.50727.42 (RTM.050727-4200)
Just start a simple console application, no code added and try to run it with F5 in DEBUG and RELEASE modes.
With DEBUG mode the VS2005 does not run it with F5 for debugging showing message box that MSVCR80D.dll is not found.
'console1.exe': Loaded 'C:\Soft\projs\test\console1\console1\Debug\console1.exe', Symbols loaded.
'console1.exe': Loaded 'C:\WINXP\system32\ntdll.dll', No symbols loaded.
'console1.exe': Loaded 'C:\WINXP\system32\kernel32.dll', No symbols loaded.
Debugger:: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load
The program '[1488] console1.exe: Native' has exited with code -1073741515 (0xc0000135).
There is no such a problem for RELEASE build, all is running and you can go thru code as it is executed.
'console1.exe': Loaded 'C:\Soft\projs\test\console1\release\console1.exe', Symbols loaded.
'console1.exe': Loaded 'C:\WINXP\system32\ntdll.dll', No symbols loaded.
'console1.exe': Loaded 'C:\WINXP\system32\kernel32.dll', No symbols loaded.
'console1.exe': Loaded 'C:\WINXP\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\msvcr80.dll', Symbols loaded.
'console1.exe': Loaded 'C:\WINXP\system32\msvcrt.dll', No symbols loaded.
By comparing project settings for release and debug modes I've found out difference in C/C++ -> Code Generation
Basic runtime checks "default" in RELEASE
"both (/RTC1,equiv. to /RTCsu)" in DEBUG
Command lines for C/C++ in project options are:
DEBUG
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\console1.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Wp64 /ZI /TP /errorReport:prompt
RELEASE
/O2 /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Yu"stdafx.h" /Fp"Release\console1.pch" /Fo"Release\\" /Fd"Release\vc80.pdb" /W3 /nologo /c /Wp64 /Zi /TP /errorReport:prompt
If we remove that /RTC option in DEBUG configuration all is fine and MSVCR80D.dll is loaded normally
What's the reason for that bug if anyone encountered it?
<div class="ForumSig">9ine</div>
|
|
|
|
|
(3+7)*8)-5)
tree......(-).....
........./...\....
.......(*)...(5)..
....../...\.......
....(+)...(8).....
.../...\..........
.(3)...(7)........
(7+3)/((2*6)-8)
tree.......(/)
........../...\
.......(+)....(-)
......./ \..../..\
.....(7) (3)(*) (8)
............./ \
...........(2) (6)
/8888888888888888888888888888888888/
If user want to enter:
((3+7)*8)-5)
then user press Enter the result show
Infix: + 3 7 * 8 - 5
Postfix: 3 7 + 8 * 5 -
or user enter other:
(7+3)/((2*6)-8)
result show
Infix: / + 7 3 - * 2 6 8
Postfix: 7 3 + 2 6 * 8 - /
I would like you to help me.
Best regard
Golden012
Golden016
|
|
|
|
|
Golden012 wrote: I would like you to help me.
Best regard
Golden012
Have you tried something?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi Friend !!!
I think maybe i did not type clearly.
Obove part is explanation of tree. ( Data Structure )
Under part is the problem that user input and reselt.
But i do not know how to use C or C++ for writing code.
If you still understand you can ask me.
But if you can do it i'm best regards and glad.
Thanks
Golden012
Golden016
|
|
|
|
|
hi,
I buid a class and export it in DLL and a simple program that use it.
It run OK at Debug mode, but when I am trying to run it (and the program use it) both at release mode, it crash when the DLL class destructor is called.
I can't find any problem at the code.
What can be the problem here ?
Thanks for your help.
|
|
|
|
|
There might be some uninitialized variable. Which goes unnoticed in Debug builds.
Refer this[^] article for better understanding.
|
|
|
|
|
What do you have on destructor of dll?
|
|
|
|
|
Hi everyone,
i use UI-Threads and need to destroy them. If i need the thread anymore, i post a threadmessage to him
with a WM_QUIT. The Thread terminates. But the CWinThread Object is still alive.
A m_bAutoDelete to TRUE does not resolve the problem.
Does anyone has a solution?
Big thanks
|
|
|
|
|
Try to call also AfxEndThread. Still, MSDN states:
Normal Thread Termination
For a worker thread, normal thread termination is simple: Exit the controlling function and return a value that signifies the reason for termination.
You can use either the AfxEndThread function or a return statement.
Typically, 0 signifies successful completion, but that is up to you.
For a user-interface thread, the process is just as simple: from within the user-interface thread, call PostQuitMessage in the Platform SDK.
The only parameter that PostQuitMessage takes is the exit code of the thread.
As for worker threads, 0 typically signifies successful completion.
|
|
|
|
|
I tried already AfxEndThread and PostQuitMessage;
The pointer to the thread has still an adress, all data inside is destroyed, but
Visual Studio told me about a Memory Leak
So, i re-analysed my source code and saw the bad line : an allocation without destruction.
Thanks nevertheless
|
|
|
|
|
Is there any API or registry entry to find the "Virtualized" folder of Vista?
It is seen that the Virtualized is in
D:\Users\admin\AppData\Local\Microsoft\Windows\Temporary Internet Files\Virtualized
for the user admin & if Vista installation directory is D:\
|
|
|
|
|
I've asked the shell team that question, and they said no.
|
|
|
|
|
|
((3+7)*8)-5)
tree......(-).....
........./...\....
.......(*)...(5)..
....../...\.......
....(+)...(8).....
.../...\..........
.(3)...(7)........
(7+3)/((2*6)-8)
tree.......(/)
........../...\
.......(+)....(-)
......./ \..../..\
.....(7) (3)(*) (8)
............./ \
...........(2) (6)
/8888888888888888888888888888888888/
If user want to enter:
((3+7)*8)-5)
then user press Enter the result show
Infix: + 3 7 * 8 - 5
Postfix: 3 7 + 8 * 5 -
or user enter other:
(7+3)/((2*6)-8)
result show
Infix: / + 7 3 - * 2 6 8
Postfix: 7 3 + 2 6 * 8 - /
I would like you to help me.
Best regard
Golden012
-- modified at 3:01 Wednesday 27th December, 2006
-- modified at 3:02 Wednesday 27th December, 2006
-- modified at 3:05 Wednesday 27th December, 2006
Golden016
|
|
|
|
|
i m sending a mail using SMTP...
But i want to authenticate my smtp server
can anybody just tell me how to use AUTH LOGIN command in vc++
i m sending HELO Command like this.....
TCHAR local_host[ 80 ];
gethostname( local_host, 80 );
sHello.Format( "HELO %s\r\n", local_host );
m_wsSMTPServer.Send( (LPCTSTR)sHello, sHello.GetLength() );
if( !get_response( GENERIC_SUCCESS ) )
{
m_wsSMTPServer.Close();
return FALSE;
}
after these lines of code i want to authenticate my server
do we paas username n password with AUTH LOGIN command only
Can somebody send me the line of code
aur just explain me the method of doing so
thanxs in advance...
|
|
|
|
|
Hi,
If I remember well when you trying to connect with authenticated server you should use EHLO keyword instead HELO.
Perhaps this helps you: rfc2554[^]
-----------
Mila
|
|
|
|