|
CodingLover wrote: ReadBuffer contains all zeros
All zero?? Then the function dosent worked as expected isnt it...?
CodingLover wrote: In the WriteBuffer after each character it contain zero
Thats is excatly the problem. That is in the statement sprintf(buff, "%s", temp.c_str()); , the sprintf() function will stop scanning the source string when it encounters a NULL. In your case since the source string is UNICODE, the second byte will be zero and hence the sprintf() returns at that point.
BTW there is another solution for the sprintf to work with unicode strings. used "%S" instead of "%s" in the format specifier.
|
|
|
|
|
Naveen wrote: BTW there is another solution for the sprintf to work with unicode strings. used "%S" instead of "%s" in the format specifier.
I've try that too. But no luck. In that time also, no any character is added to char buffer(buff)
Please help me to solve this, I'm wired with this now.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
HRESULT hrRead; ULONG readLen = 0;
do {
char writeBuffer[100] = {0};
hrRead = pOutFileStream->Read(writeBuffer, sizeof(writeBuffer), &readLen);
if (hrRead!=S_OK) break;
str.write(writeBuffer, readLen);
} while(hrRead == S_OK);
logics
|
|
|
|
|
I try your suggestion, but no luck. Do you think it's really need. Because Read() not return S_OK if read less number of bytes than define.
And also for the second part, yes I move the pointer to the beginning of the stream.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I get a memory leak like this on debugging (after exiting the application):
{1557} normal block at 0x00483160, 2 bytes long.
Data: <1 > 31 00
How do I exactly find out the variable (name) holding the memory
0x00483160 that causes the leak.
Note : Double-clicking on the aforementioned line doesn't show me the
place of the memory leak
Thanx in Advance.
|
|
|
|
|
|
Hi, I've been using c# for some time , but I'm new in c++ and I'm using qt.
My question is whether there is a container control in C++ like a sliding menu ( for example, tool box , server explorer, solution explorer in Visual Studio when auto-hide (stample like) button is pressed.) These menus are hidden as you know when this auto-hide option is chosen and they appear sliding towards the center of the screen when mouse is over their tab.
I want to use a control likewise in my C++ (qt) application.
I went through Qt Designer but I couldn't find an object like that
Seeking for your help, thanx
|
|
|
|
|
You can implement the behavior by using Extended MFC classes in Visual Studio 2008 Feature Pack[^]. There you can find Visual Studio, Office and Native UI components for your application.
Otherwise you'll have to write your own.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Hi,
No you cant use any MFC Classes in Qt application.
You better post this QtCenter[^]
Or
QtForum[^]
All the best..
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
I am using a dev++4.9 version of bloodshed compiler sofware and i am having problems with getting my source code to show up as output onn the screen. I am hopping that one of you can tell me what compiler will make the code show up. I am not rich so thinking maybe you people can tell me where i can download that kind of software.
|
|
|
|
|
Well Visual C++ Express Edition is free.
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
[My articles]
|
|
|
|
|
I have added a dll to my project. it has all the defaults which vc wizard created. but I just added some resources (icons) to it without modifying its code.
when I load the library and do nothing with the library, and then simply free the library, and close my program, visual c reports lots of memory leaks. but when I don't load the project, no memory leakage occurs. In both cases, I don't use the library resources. I just load and unload it.
what is the problem?
to load:
hModule = LoadLibrary("Resources.dll");
ASSERT(hModule);
to unload:
FreeLibrary(hModule);
nowhere else, hModule is referenced.
|
|
|
|
|
What are the leak messages? Can you paste them here?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Welcome to DLLs. The leak detector fails on automatically created objects in a DLL due to how the heap is torn down. This is even a problem with Boundschecker.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Can u explain more? memory leakage is reported by MFC, not by add-ins. should I ignore them? have you ever had the same problem?
|
|
|
|
|
Ali Tavakol wrote: have you ever had the same problem?
Yes, many times with MFC and add-ons and for the same reason. When implicitly linking, this isn't a problem since the entire process space is going away. When explicitly linking, this can sometimes indicate a genuine leak. Unfortunately, there is no easy way to know.
At one point years ago, I actually figured out exactly what was happening, but my memories are a little vague now. If I remember right, the CRT cleanup progresses to the point where the detection routines can't run effectively. The process and or module effectively enters a non-deterministic state. (This issue shows up when unloading DLLs. Since DLLs could be dependent on each other, what order they load and/or unload is not guaranteed.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
When using this font for drawing it is not Fixedsys but the defualt candidate font.
In my application, I use GDI and GDI+, when use GDI I draw with the default system font
(it seems fixedsys), how can I use the same font when I use GDI+?
Thanks.
logics
|
|
|
|
|
fixedsys? That's pretty ancient, unless you're still targeting
Windows 1.0-3.0
GDI+ uses True Type fonts so you can't create a fixedsys
Gdiplus::Font. For example, Gdiplus::Font font("Fixedsys",12.f)
maps to "Microsoft Sans Serif" on my Vista machine.
Maybe time to use a modern font?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello everyone,
Depends.exe is not shipped any more in VS 2008? I have a full installation of VS 2008 Team Edition, but no such file found. In VS 2005, there is related one.
It is not shipped any more or have some alternative ones?
thanks in advance,
George
|
|
|
|
|
Yes.
You can download a new version than that in VC6.0.
logics
|
|
|
|
|
Thanks followait,
I am surprised.
1. Are there any documents about depends.exe is not supported any more?
2. Are there any alternative tools besides the old depends.exe?
3. What means "new version that than in VC6.0."? I am using the one from VS 2005, is it the lastest version? If not, could you provide a link please?
regards,
George
|
|
|
|
|
I jump from VC++ 6.0 to VC++ 2008.
logics
|
|
|
|
|
Hi followait,
What is your point? In your VS 2008 it ships with depends.exe or not?
regards,
George
|
|
|
|
|
The latest version of Dependency Walker (newer than the one included in VS 2005) can be downloaded here: http://dependencywalker.com/[^].
Best regards
Dominik
|
|
|
|
|
Thanks Dominik,
I understand it could be downloaded there. But my question is VS 2008 is not shipped with depends.exe and we need to download manually?
regards,
George
|
|
|
|