|
How can we handle the Mouse wheel in a Dialog based application. On the Dialog controls are more in number and the Dialog is having the vertical scroll.
Can you help?
Thanks.
|
|
|
|
|
|
While running debug mode on an application written by me, the debug would complain that it has memory leak:
Detected memory leaks!
Dumping objects ->
{118957} normal block at 0x04D89230, 22960 bytes long.
Data: < > 00 00 00 00 CD CD CD CD 00 00 00 00 00 00 00 00
...
Is there any tool to trace the memory usage? It may be hard to find where the error is by simply trace the code( too long to examine ) Thanks!
|
|
|
|
|
VS has the ability to help you with that. What you have to do is add the following lines, which should be there by default, to the beginning of every cpp file in your project
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif If you have these lines in your code, then the debugger will give you the file name and line number of where the leaked memory was allocated, making it easier for you to figure out where you forgot to add the delete.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
That's of great help, thanks!
|
|
|
|
|
First you have to include the following files in your main .h file (so that you can have access to the following functions anywhere)
//For debugging
#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
do them in this order.
Now you can use the following function to actually call a memory dump with verbose leak pinpointing.
_CrtDumpMemoryLeaks();
a small hint; bookmark the function, and clear your output window before stepping through the function call
When the going gets tough... write a computer program to do the thing for you
|
|
|
|
|
I would like to display unicode characters for example "devanagari" script in an edit box in MFC dialog based application.
Any idea how do I this?.
|
|
|
|
|
#define _UNICODE
pEditBox->SetWindowText(_T("devanagari");
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
hi
i have embeded an ActiveX control in a web page, when the page is accessed the control downloads and registers successfully on client machine but it is not shown on the web page, instead a cross icon comes at its place
what might be wrong
plz help me its urgent
regards.
|
|
|
|
|
I create project with mfc and I use static splitters. I split it in 1 row 2 column. In each column have different runtime class.(Aclass<leftview> and Bclass<rightview>) I want to set vertical shared scrollbars(VSCROLL) in Bclass. Plese help me to complete this job. -_- Thank you!!
|
|
|
|
|
Hi
I was wondering if anyone knows the minimal code necessary to play a sound file of whatever sort (mp3, wave, whatever else...) at different speeds and/or in different directions (back or forward). Basically I'd like to make a super simple
turntable program... something with a "load" "play" and "stop" button and a slider that decides speed and direction of
your song...
thanks for any advice.
fred
|
|
|
|
|
I'm looking for a thread safe alternative to the STL that comes with VS 7.1 I have reason to suspect that it's causing my application to blow up every once in a while.
Anyone know of any?
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
|
recently I have written a hook dll and set some data in share data segment.after I installed this hook and it runs for some time,I find that the data in share data segment change automatically. who encounters this phenomina? I have checked my codes for a long time ,the problem of changing it does not exist. please help me
|
|
|
|
|
Can someone tell me how to check whether the Adobe Acrobat Reader is installed on a system (optional: which version?).
Should I just check whether the .PDF extension is registered or are there any special registry keys to look into?
--
Affordable Windows-based CMS: www.zeta-producer.com
|
|
|
|
|
this Key will tell where Adobe EXE is situated
HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe
and this key will tell about versions
HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\6.0
HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\6.0
I know that the hack,but ................
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank you! I will use this method, maybe slightly enhancing it to different versions and/or checking for the full Acrobat package, too.
--
Affordable Windows-based CMS: www.zeta-producer.com
|
|
|
|
|
Check for the .PDF extension registration. Adobe is by far the most popular pdf reader, but it isn't the only one.
Acrobat 6 is such a pain that I'm now hoping someone ports xpdf to windows. In the mean time I open all pdfs on my unix machine. (mind xpdf sucks worse in most ways, but it loads so much faster that I can normally live with the loss of features. One day it might get those features.)
|
|
|
|
|
|
How can I access an HTML resouce "myfile.html" from an
MFC extension DLL?
I've tried two methods:
Downloading the address (res://extension.dll/myfile.html) [because it works in IE if you type it is]
and
Loading the library and attempting to get the resource from there but when I try to get the file name it complains about the name being a CString and not struct HRSC__* [meaning how could i call for myfile.html after parsing it out of the address [which is a CString]]
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
I had to go the route of loading the library and reading the resource file,
After loading it I got the HRSC from the FindResource with the type RT_HTML [this is why I never was able to find anything on google].
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
Maybe, after all it was difficult to find on google so maybe, if i can find time.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
Hi
Let's say I have a pointer to a BITMAPINFO structure, and the structure holds information about an RGB bitmap in memory. Is there a way for me to directly write some string on top of the bitmap?
Currently I do it like this:
HDC hDC = CreateCompatibleDC(NULL);
void *pDIB;
HBITMAP hBmp = CreateDIBSection(hDC, pBmpInfo, DIB_RGB_COLORS, &pDIB, NULL, NULL); //pBmpInfo in of type BITMAPINFO*
memcpy(pDIB, pData, iWidth * iHeight * 3); //iWidth and iHeight are the width and height of the image, respectively, and pData is a pointer to the bitmap's pixel values, multiplied by 3 because it's RGB
SelectObject(hDC, hBmp);
DrawText(hDC, "This is a test", strlen(cstrStatus), &CRect(5, 5, iWidth, iHeight), DT_LEFT);
memcpy(pData, pDIB, iWidth*iHeight*3);
DeleteObject(hBmp);
DeleteDC(hDC);
So basically I first copy the bitmap's pixel values to a buffer created using CreateDIBSection, write the text on the DIB, and copy the DIB pixel values back to the original bitmap pixels' location. Is there a more efficient way to do this without copying the pixel values back and forth between the two buffers (something like writing the text directly to pData)? Due to the way the system is designed, my function must work on preloaded BITMAPINFO* input that resides in memory, not bitmap image files or other types of input. And because my system needs all the speed it can get, any tips on how to make the above code faster will be greatly appreciated.
Thanks!
|
|
|
|
|
Indrawati wrote:
Is there a more efficient way to do this without copying the pixel values back and forth between the two buffers (something like writing the text directly to pData)?
nope. not if you're using the GDI text functions - they require DCs, and DCs require HBITMAPs and HBITMAPs require you to SelectObject them, etc.. if you want to get into 3rd party text-rendering engines, you might be able to avoid it, but that's probably a lot more trouble than it's worth.
Software | Cleek
|
|
|
|