|
Hi,
is There any Third party tool to detect resource leaks...
or is it possible to write my own code to detect the same..
if yes pls help me with any sample....
|
|
|
|
|
Try BoundsChecker or Purity
|
|
|
|
|
I prefer more to use Deleaker - russian alternative to BoundsChecker, it works more perfectly.
|
|
|
|
|
What kind of resource? GDI or handles?
|
|
|
|
|
hi Friends!!
i am displaying a wmf image on the view.. i have problem that Certain WMF files are not getting displayed on the view.. One thing i am doing is resizing the image before it is been displayed on view.. i have noticed that this happens if the Dpi is 1000?
can any one show me way??
Thnks in advance
Regards
Samir
|
|
|
|
|
You could:
- Debug your code.
- Post here the relevant resizing code.
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]
|
|
|
|
|
Hi all,
I am making my application unicode supporting one. i have .txt,.doc files.. i want to upload the file in my application.
I want to check what type of file before loading.. i am able to check whether ANSII or Unicode using BOM. I dont know how to check for UTf-8 and Unicode Big Endian type files. Its not accepting BOM condition.
Does anyone know how to check that one?
------------------------------------------------
Code Snippet:
This is how, i check for unicode encoded file:
if (file.Read(&firstChar, sizeof(wchar_t)) > 0 && firstChar == (wchar_t)0xFEFF)
{
......
}
But, UTF-8 and unicode big endian type of files dont satisfy this condition.
--------------------
Please guide me how to resolve this issue.
Thanks,
Rakesh.
|
|
|
|
|
00 00 FE FF UTF-32, big-endian
FF FE 00 00 UTF-32, little-endian
FE FF UTF-16, big-endian
FF FE UTF-16, little-endian
EF BB BF UTF-8
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi Superman,
I tried exactly those methods you have mentioned in my code.. But to my surprise, it didnt work well..
Can you please guide me how to resolve this issue??
Mohan
|
|
|
|
|
Hi guys,
I am relatively new to programming dx.
I just want to know if it is possible to draw a small blue semi transparent object on the desktop so that it will not affect the desktop. I mean you could still click your icons etc.
thanks !
|
|
|
|
|
You could do that with an always-on-top Layered Window[^] (this would take care of the semi-transparency) with the WS_EX_TRANSPARENT[^] extended style set. How you can fit that in with DirectX is another question...
p.s: This[^] might be usefull too.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thanks !
And would you know how I can paint that window blue ?
|
|
|
|
|
Well, that depends which path you took, if you checked out this[^] link and read the Using Layered Windows section you can either simply paint it blue in OnPaint or create a bitmap, paint it blue and use UpdateLayeredWindow . It mostly depends on your needs. Since you want a blue triangle, as i understood, you could use the WM_PAINT aproach with SetLayeredWindowAttributes[^] and next to the alpha value specify a colorkey, then fill your dialog in WM_PAINT with the "hollow color" and then paint a blue triangle onto this.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Quote: "Hit testing of a layered window is based on the shape and transparency of the window. This means that the areas of the window that are color-keyed or whose alpha value is zero will let the mouse messages through."
I think layered windows is JUST what I need, thank you so much.
It might sound odd, but since I am really new to all this, would you know of a place where I can find a project for Layered windows so I can explore it a bit more ?
|
|
|
|
|
Well, not really, sorry, but Google[^] is your friend and your search is as good as mine, and also you can look around here at Codeproject, there should be such articles or examples like this one[^] for example. Good luck.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
ok, thanks a bunch Code-o-mat !
|
|
|
|
|
Hi,
In a nutshell: I need to display the location of the cursor when I click somewhere in the Windows Calculator window (or any other app beside my own).
I need to get the cursor position on the click event (WM_LBUTTONDOWN) when the click occurs in another window. In my test I am using calculator. I display with GetMessagePos or GetCursorPos the coordinates in 2 textboxes under the mouse move but whenever it goes beyond my app window, of course, my app message loop stop receiving those mouse move events.
This is in a barebone win32 no MFC app.
Thanks!!!
Antoine
|
|
|
|
|
Orchus wrote: In a nutshell: I need to display the location of the cursor when I click somewhere in the Windows Calculator window (or any other app beside my own).
You will need a global mouse hook to trap mouse events that occur outside of your application window. The following tutorial describes about hooks and DLLs in general, and has a sample mouse hook as well: http://www.flounder.com/hooks.htm[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Are you looking for SetCapture() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
Thank you for answering.
In this case I may have done something wrong it did not work...
case WM_MOUSEMOVE:
SetCapture(hWndTarget);
TCHAR temp[256],temp2[256];
long x,y;
x=LOWORD(GetMessagePos());
y=HIWORD(GetMessagePos());
wsprintf(temp,_T("%d"),x);
SetWindowText(hX,temp);
wsprintf(temp2,_T("%d"),y);
SetWindowText(hY,temp2);
Should this work?
I am running Windows 7 b7600 and VS2010 beta 1.
Thank you,
|
|
|
|
|
Call SetCapture() when your app first starts up.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Orchus wrote: It did not work either...
Which means what exactly? Does SetCapture() return NULL ? Are you not receiving any WM_MOUSEMOVE messages? Does the window handle belong to the current thread? Is it a foreground or background window?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
When I move the window out of my application's area, the two textboxes stop displaying coordinates. The calculator window is sitting next to my application, plainly visible. If I give focus to the calculator, I also do not get any mouse_move message as the two textboxes are not displaying anything.
I also noticed that I do not get any notifications when the cursor is hovering controls in my app such as buttons or edit boxes.
I don't know if the window handle (calc.exe) belongs to the current thread.
Thank you for your time,
|
|
|
|
|
I always run VisualStudio as admin, but when I debug the application I am developing, I would like it to launch the app at the normal user privilege level. Is there any setting available for doing this? (I know I could launch my app, then attach the debugger, but I would like to avoid this to make debugging convenient for other members of my team.)
Thanks.
Wayne
|
|
|
|