|
People here hate such kind of posting. Always ready to help you out of your problem, but not to do anybodies homework.
You are lucky , you are getting less flames, as lots of CP'ians are on vacation.
|
|
|
|
|
I agree with you people are on vacation, codeproject is privacy
|
|
|
|
|
I think you are new on c++ and I suggest see www.cplusplus.com maybe it some helpful for you
|
|
|
|
|
my application consists of a treecontrol in which i have displayed system files and folders in a tree control similar to the left hand side of Windows Explorer. i am able to copy the folder from the treecontrol and paste it on the explorer where ever we need.Also copy and paste operations are occuring with in the tree control.Now i have added unicode support to my application.The copy to clipboard function is failing.when i copy the folder from explorer i am able to paste it in the treecontrol.But when i tried viceversa i am getting an error message like "the file name you specified is not valid or too long.specify a different file name".how can i make the folder copy from the treecontrol.The code i used is ,
CDropFiles DropFiles;
if(!PrepareFileBuff(DropFiles))
{
return;
}
if (OpenClipboard())
{
BeginWaitCursor();
::EmptyClipboard();
HGLOBAL hMem = ::GlobalAlloc(GMEM_ZEROINIT|GMEM_MOVEABLE|GMEM_DDESHARE, DropFiles.GetBuffSize());
memcpy( (LPTSTR)::GlobalLock(hMem), DropFiles.GetBuffer() ,DropFiles.GetBuffSize() );
::SetClipboardData (CF_HDROP, hMem );
::CloseClipboard();
EndWaitCursor();
}
|
|
|
|
|
radhika28 wrote: memcpy( (LPTSTR)::GlobalLock(hMem), DropFiles.GetBuffer() ,DropFiles.GetBuffSize() );
Try using wmemcpy instead.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
i got the file size.but in win32 how would i convert it into string so i can append 'KB' after the converted string.
e.g.
494 size
then after append 'KB' it should be like 494KB.
thanks
amit
|
|
|
|
|
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
|
|
|
|