|
Actually, if you really want to track down these memory leaks without forking out for BoundsChecker, there is a really good debugging trick described in Knowledge Base Article Q151585 which described the _crtBreakAlloc variable (You can search for Q151585 or "Use _crtBreakAlloc to Debug a Memory Allocation" in MSDN)
Basically, when you get an object dump with numbers next to it, you start your program in the debugger, set _crtBreakAlloc to that number, then run your program. The debugger will break when the memory is allocated that you have forgotten to free. Very very handy.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hi all,
Q1.
I can convert LPSTR to LPWSTR:
USES_CONVERSION;
LPWSTR lp1 = A2W(szString);
Is any other way to convert LPSTR to LPWSTR ???
Q2.
What is difference between E_FAIL and S_FALSE ???
Thanks for helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
something like:
wchar_t* AmA2W(const char *s)
{
int clen = strlen(s);
wchar_t *w = (wchar_t*)calloc(clen + 1, sizeof(wchar_t));
MultiByteToWideChar(CP_ACP, 0, s, clen, w, clen);
return w;
}
Just remember to manually free the returned string.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi Molin,
About, fifth parameter in MultiByteToWideChar ...
If i put -1 instead w, then what will happen ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I guess the function will fail. The fifth parameter is a wide-character buffer...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
|
sytem environment:vc6 sp6,win2000 sp2
WINDOWINFO wi;
::GetWindowInfo(m_hWnd,&wi);
error:
C2065: 'WINDOWINFO' : undeclared identifier
C2146: syntax error : missing ';' before dentifier 'wi'
C2065: 'wi' : undeclared identifier
C2039: 'GetWindowInfo' : is not a member of '`global namespace''
C2065: 'GetWindowInfo' : undeclared identifier
|
|
|
|
|
You need to install the platform SDK to use this function, according to the MSDN.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
|
Thanks, All OK!
|
|
|
|
|
I have a plot which uses some line routines of the device context. Lines may be drawn (in some scale) from one point outside the visible area to another. When I draw in my window it automatically clips all lines outside certain client area. When I use the same drawing routine in printing, lines are cut only in the borders of the paper.
For this clipping SelectClipRgn may be used. However, it works improperly in preview mode.
Does anybody know the way to fix clipping?
Andrei the Adroit
|
|
|
|
|
Dear Sirs,
I wish to create a grid within an application that has a variable name on the left hand side and a value on the right that can be edited. Are there any ActiveX controls that I can use for this?
Regards
|
|
|
|
|
|
It seems that we can not toggle the Numlock key on Windows 98.
Is it right?
|
|
|
|
|
Are you looking at the keybd_event API function. It says that you can send any event, hoever it will not work on Windows 95, it does not say anything about windows 98.
|
|
|
|
|
Why use the statement "EnableCompoundFile()" in the function "CMyServerDoc::CMyServerDoc"? Here, "CMyServerDoc" is a class derived from the class "COleServerDoc". My application is a MDI based server application.
Does it have anything to do with "COleServerItem"?
|
|
|
|
|
I am using an asynchronous property in my ActiveX control to implement the background of my control.
What should I do to implement the property?
Is there any articles about the topic?
Thanks.
Maer
|
|
|
|
|
thank you!
I am a beginner
|
|
|
|
|
I've been using it for years and never seen it show line numbers. The current line number is in the status bar, or if you use Source Safe, it shows the files with line numbers
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I have dialog based application and I need to create child window (as a reaction
on pushing a button). I designed a form (form class derived from CFormView).
But when I call Create function - system gives an error and closes the dialog.
If anybody knows how to solve this problem, tell me!!!
|
|
|
|
|
It would help to know what the error is. To create a child dialog, I design it in the dialog editor, double click on it to create a class and then #include the class and create an instance of it and DoModal in response to the event that triggers it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Error is in "viewform.cpp" (line 69) - system gives this.
+: I can't use DoModal, 'cos form is not a dialog. I told, it's derived
from CFormView. ('cos I need views in my application).
|
|
|
|
|
I'm not sure where you're headed here. You've got a formview (fair enough ) and you're trying to call DoModal on it ? You can have your formview, but if you want a modal dialog, you will need to create a dialog template, even if it's the same as the one for the formview, and derive a class from CDialog by double clicking on the form and creating a class. This class you can call DoModal on, you cannot do this to a formview, as you have discovered.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
hi,
i want to move a dialog based window. this isn't a problem but i do not
want to redraw the dialog along the way, but a rectangle with the size of
the dialog. This results in faster drawing. I tried to return HTCAPTION whenever
i received a WM_NCHITTEST message but the drawing speed left a "trail", that's
why i want to use the rectangle outline.
However i don't succeed in doing this. I have to work with the fullscreen dc
because my app is a dialog and thus the main window.
How do you fill the screen dc again or better delete/restore the space previously
occupied by something else for instance the dragging rectangle and then redraw the rectangle?
Is there any sample code that uses a rectangle to show the new windows position instead
of immediately redrawing the window being moved?
thanks
|
|
|
|