|
Search abilities of the forum become worse and worse, I can not find my recent posts anyway.
If I input user name for searching, results list all posts from ancient year and can not sort them descendingly.
If input keywords, result says "no answer" but posts are just there!
many problems!
|
|
|
|
|
Perhaps the Site Bugs/Suggestion forum is what you are looking for.
|
|
|
|
|
I have a resource leak that I have thus far been unable to track down. I am using Process Explorer and Task Manager and am monitoring every counter that they are able to monitor. All counters are stable, ie there are no memory leaks, handle leaks, etc that I can detect. However, after my program has run for an hour or so all applications and Windows start giving a whole range of errors, but all of them are related to lack of resources.
The only thing so far that is interesting is the Virtual Size value in Process Explorer. It stands at about 1,2GB, while my process's Working Set and Private Bytes is less than 70MB. All other resources are 100% stable after my application started up.
I have enable Microsoft Application Verifier and set GFLAGS to enable all the Heap functions for my process. Alas, no errors. I've also tried Memory Validator, but it gives 100's of errors of uninitialized variables, all in MS code, nothing else really that matters.
Are there other utilities that will enable me to track the actual resource that is leaking ? Any other suggestions maybe as to what type of "undetectable" leak I am experiencing ?
Thanks
OD
modified on Friday, July 31, 2009 3:47 PM
|
|
|
|
|
A bit more description would be more helpful but not as much as debugging the code, especially places that work with buffers ( strings etc) system managed handles (GDI objects, Global memory etc).
Also:
od@ananzi.co.za wrote: all in MS code, nothing else really that matters.
It is very possible that YOUR code uses win32 APIs incorrectly causing one of any number of possible leaks.
|
|
|
|
|
I agree with RomanMzh in that it sounds like a GDI resource leak. You can use the task manager to see how many GDI objects your application is using. This MSDN Magazine article should give you enough information to track it down.
Resource Leaks: Detecting, Locating, and Repairing Your Leaky GDI Code[^]
Essentially all you need to do is select the 'GDI Objects' checkbox in the select columns dialog. I would recommend selecting 'Handle Count' as well. If either your GDI objects or handle count continues to increment... you may have a leak.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi Guys, I've managed to track down the "leak". The application uses a mailslot to send some frequent statistical data to another process for display. The receiving program was receiving the data a lot slower than the sender was transmitting it, so eventually the Mailslot IPC ran out of shared memory and from there all the problems started.
|
|
|
|
|
Hi,
I want to scale and rotate a bitmap (loaded using GDI+) and save the rotated and scaled bitmap to a file using GDI+.
How can I do it?
Thanks,
|
|
|
|
|
|
Hi
Thank you very much for reply.
The Graphics::RotateTransform Method[^] only rotate the graphics object. not the bitmap.
How can I rotate the bitmap?
Or How can I get bitmap from Graphics?
Thank you very much,
|
|
|
|
|
transoft wrote: The Graphics::RotateTransform Method[^] only rotate the graphics object. not the bitmap.
I would suggest researching the classes you are working with. The Graphics Class[^] accepts a an Image object[^] in the constructor.
transoft wrote: How can I rotate the bitmap?
Or How can I get bitmap from Graphics?
See if something like this works:
Graphics g(hdc);
Image i(L"HelloWorld.bmp");
g.DrawImage(&i,0,1024);
g.TranslateTransform(100.0f, 50.0f);
g.RotateTransform(45.0f);
g.DrawImage(&image,0,0);
CLSID jpgClsid;
GetEncoderClsid(L"image/jpeg", &jpgClsid);
i.Save(pIStream1, &jpgClsid);
heh, I have not tested the above code, it was written here in the reply box. Let me know if it works.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi David
I thought that "Graphics.Drawimage" only rotates and scales in the memory and would not affect bitmap.
I will test the code and let you know it works or not.
Best regards,
|
|
|
|
|
transoft wrote: I thought that "Graphics.Drawimage" only rotates and scales in the memory and would not affect bitmap.
It does scale/rotate the bitmap in memory. All GDI/GDI+ bitmap operations occur in memory. Then you draw the Graphics object in the Image object and save to disk.
Best Wishes,
-David Delaune
|
|
|
|
|
Dear David
Thank you very much for your code? I tried and had no luck. Do you know what happen?
Best regards,
|
|
|
|
|
transoft wrote: Do you know what happen?
Well, my sample probably was not quite correct as I wrote it in the reply box. I did this one inside my compiler and tested it:
Gdiplus::Image image(L"HelloWorld.bmp");
Bitmap bmp(1024,1024);
Graphics g(&bmp);
g.TranslateTransform(260.0f,80.0f);
g.RotateTransform(45.0f);
g.DrawImage(&image,0,0);
CLSID encoderClsid;
GetEncoderClsid(L"image/png", &encoderClsid);
bmp.Save(L"HelloWorld2.png",&encoderClsid);
I confirmed this sample actually works.
Best Wishes,
-David Delaune
|
|
|
|
|
Dear David,
Your code works perfect. Thank you so much for helping me. I spent so much on it.
Best regards,
|
|
|
|
|
hello,
i want to make a game trainer using mfc. please guide me and tell me is it good to write a tainer in mfc ??
sorry, but here it is.
i have a game "Fallout 3". there are several trainers available for it on internet but i want to develop my own trainer for this game. so i want to say that is there any tutorial available for writing a game trainer in mfc for any game ?
btw thanks
rahul
modified on Saturday, August 1, 2009 12:59 AM
|
|
|
|
|
Kindly read the guidelines. It's the sticky post, saying "How to get an answer to your question" and is located at the top of this forum.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Hi,
I'm using Michael Chourdakis's very nice SSL package from here:
http://www.codeproject.com/KB/IP/ssl_sockets.aspx
I used the code as a base for a test app and its working very well, however, I'm having a strange issue.
On one remote test machine, when I run as a server in NON SSL mode, sending a few hundred bytes back and forwards, its lightening fast. I switch to SSL mode and its a little slower (due, I suppose to the encryption) but it's still fast.
However, on a second remote test machine at a different location the results vary. The NON SSL mode works lightening fast, however the SSL mode takes 30-40 seconds to complete. It connects and then there is a long period until the data is transferred back and forth, but once it starts its fast.
Is it possible that on this second machine the Certificate is being re-negotiated every time? If so, do you know if there is an app or an OS fix?
Thanks for your help,
Phil
|
|
|
|
|
I'd like to be able to put content into the clipboard so it could be pasted into Excel... but I also want some formatting information (font, color, ...) so the CF_TEXT is not good enough. Any idea, pointer?
Regards,
Jerry
|
|
|
|
|
hi all,
i am writing content into a notepad file using _wfopen function and saving it in unicode format by giving cc = unicode as one of the arguments..
its saving the file in unicode encoding too.. but when i tried to read the file, its not reading as unicode rather its reading as ascii..
i found this by giving an if condition like this:
wchar_t firstchar = NULL;
if (file.Read(&cFirstChar, sizeof(wchar_t)) && firstchar == (wchar_t)0xFEFF)..
its not showing the first character as 0xfeff rather its showing the first character as the letter present in the notepad file..
am i wrong in saving the file? if so, how to make the first character of the file as oxfeff..
thanks,
rakesh
|
|
|
|
|
First about Unicode.
There are two ways to store Unicode.
E.g 'a' (ASCII) could be stored in Unicode like so:
0x61 0x00 or 0x00 0x61
How do you know the difference ?
By storing a FE FF at the beginning of every Unicode string (this is called a Unicode Byte Order Mark) you know which way to read the bytes.
Example: If I store 'a' in Unicode file I can have:
FF FE 61 00
OR
FE FF 00 61
|
|
|
|
|
hi,
ya you were correct..its showing the ascii value rather FEFF as the first character of the file..
but the file encoding is in unicode.. (i have made it to write it in unicode encoding thru code..)
Thanks,
Rakesh.
|
|
|
|
|
That means you didn't save it as Unicode ....
What code are you using to write to the file ?
|
|
|
|
|
Hi there,
The GetKeyNameText function returns the name of the key pressed in the keyboard.
My question is, is there a way to tell whether the key is upper case or lower case?
Jr.
|
|
|
|