|
I can just find the BIOS offset(0xFE000)using SMBIOS structures,but do not know the detail of the info it disp in WinHex tool.
|
|
|
|
|
Take a look at some of these links[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello. I'm currently extending an options risk application that makes use of Gunnar Bolle's neat little charting control. I'm trying to get a handle on the functionality by looking at the code but it would GREATLY speed things up if I could communicate with someone who is versed in the control. What I need to do is pretty basic; labeling, editing, scaling, etc. Any help would be greatly appreciated.
|
|
|
|
|
You could try posting a message in the forum at the end of the article so he sees it.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I already tried that. I'm thinking of putting out an international APB.
|
|
|
|
|
I have the follow code :
CSize sizeDoc = pDoc->GetBitmapSize();
CDC MemDC, TempDC;
MemDC.CreateCompatibleDC(pDC);
TempDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = MemDC.SelectObject(&pDoc->GetBitmap());
pDC->SetStretchBltMode(HALFTONE);
TempDC.StretchBlt(0, 0, sizeLog.cx, sizeLog.cy, &MemDC, 0, 0, sizeDoc.cx, sizeDoc.cy, SRCCOPY);
pDC->StretchBlt(0, 0, sizeLog.cx, sizeLog.cy, &TempDC, 0, 0, sizeDoc.cx, sizeDoc.cy, SRCCOPY);
pDC->SelectObject(pOldBitmap);
and on view I see nothing ... what I'm doing wrong ? TempDC don't have the same structure like MemDC ? Because if I do so:
CSize sizeDoc = pDoc->GetBitmapSize();
CDC MemDC, TempDC;
MemDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = MemDC.SelectObject(&pDoc->GetBitmap());
pDC->SetStretchBltMode(HALFTONE);
pDC->StretchBlt(0, 0, sizeLog.cx, sizeLog.cy, &MemDC, 0, 0, sizeDoc.cx, sizeDoc.cy, SRCCOPY);
pDC->SelectObject(pOldBitmap);
everything it's ok ...
|
|
|
|
|
CSize sizeDoc = pDoc->GetBitmapSize();
CDC MemDC, TempDC;
MemDC.CreateCompatibleDC(pDC);
TempDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = MemDC.SelectObject(&pDoc->GetBitmap());
pDC->SetStretchBltMode(HALFTONE);
TempDC.StretchBlt(0, 0, sizeLog.cx, sizeLog.cy, &MemDC, 0, 0, sizeDoc.cx, sizeDoc.cy, SRCCOPY);
pDC->StretchBlt(0, 0, sizeLog.cx, sizeLog.cy, &TempDC, 0, 0, sizeDoc.cx, sizeDoc.cy, SRCCOPY);
pDC->SelectObject(pOldBitmap);
When a memory device context is created, GDI automatically selects a 1-by-1 monochrome stock bitmap for it. GDI output functions can be used with a memory device context only if a bitmap has been created and selected into that context.
Here TempDC is not attached to any Bitmap, and therefore GDI function StretchBlt will not draw to TempDC.
You have to create a Bitmap compatible to your DC, and attach the same to temperory memory DC.
CSize sizeDoc = pDoc->GetBitmapSize();
CDC MemDC, TempDC;
MemDC.CreateCompatibleDC(pDC);
TempDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = MemDC.SelectObject(&pDoc->GetBitmap());
pDC->SetStretchBltMode(HALFTONE);
HDC hdc = ::GetDC(NULL);
HBITMAP hScreenBmp = CreateCompatibleBitmap( hdc , nWidth, m_nImageHeight );
TempDC.SelectObject( hScreenBmp );
TempDC.StretchBlt(0, 0, sizeLog.cx, sizeLog.cy, &MemDC, 0, 0, sizeDoc.cx, sizeDoc.cy, SRCCOPY);
pDC->StretchBlt(0, 0, sizeLog.cx, sizeLog.cy, &TempDC, 0, 0, sizeDoc.cx, sizeDoc.cy, SRCCOPY);
pDC->SelectObject(pOldBitmap);
|
|
|
|
|
Thank you so much, is working now.
|
|
|
|
|
private:
PROCESSENTRY32 * m_proc;
char * m_filename;
bool m_stringupdated;
Process::Process()
{
m_proc = new PROCESSENTRY32;
m_proc->dwSize = sizeof(PROCESSENTRY32);
m_stringupdated = false;
m_filename = NULL;
}
Process::~Process()
{
delete m_proc;
if(m_filename)
delete [] m_filename;
}
Process * allo = new Process();
allo->~Process();
VLD reports:
Visual Leak Detector Version 2.2.3 installed.
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 1 at 0x005A2100: 12 bytes ----------
Call Stack:
c:\users\jean\documents\visual studio 2012\projects\procenum\procenum\procenum.cpp (26): ProcEnum.exe!wmain + 0x7 bytes
f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (533): ProcEnum.exe!__tmainCRTStartup + 0x19 bytes
f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (377): ProcEnum.exe!wmainCRTStartup
0x760A33AA (File and line number not available): kernel32.dll!BaseThreadInitThunk + 0x12 bytes
0x76CF9EF2 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x63 bytes
0x76CF9EC5 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x36 bytes
Data:
48 21 5A 00 00 00 00 00 00 CD CD CD H!Z..... ........
Visual Leak Detector detected 1 memory leak (48 bytes).
Largest number used: 640 bytes.
Total allocations: 640 bytes.
Visual Leak Detector is now exiting.
The program '[10680] ProcEnum.exe' has exited with code 0 (0x0).
I'm freaking out guys I just don't see the leak ,Thanks in advance .
|
|
|
|
|
How many bytes allocated and pointed by m_filename?
|
|
|
|
|
it's not used ,its deallocating it anyway...
|
|
|
|
|
If the sizeof(PROCESSENTRY32) == 48, then I have found your leak.
|
|
|
|
|
not that either it's around 500~ bytes and I'm deallocating that too :/
|
|
|
|
|
I cant see any memory leak in the given code.
Please check memory leak without allocating memory Process.
|
|
|
|
|
Visual Leak Detector Version 2.2.3 installed.
No memory leaks detected.
Visual Leak Detector is now exiting.
The program '[9248] ProcEnum.exe' has exited with code 0 (0x0).
Not a false positive.
|
|
|
|
|
You are explicitly calling the destructor. This will free the allocated memory for the members but not the object itself. You should use delete instead:
delete allo;
Or you may use auto delete (using an additional member var):
Process::~Process()
{
delete m_proc;
if(m_filename) delete [] m_filename;
if (m_bAutoDelete)
delete this;
}
|
|
|
|
|
that pretty much solved me the problem
something to note
delete still calls the destructor.
so the auto delete code that you provided will cause an exception.
Process::~Process()
{
if(m_bDeallocated)
return;
delete m_proc;
delete [] m_filename;
m_bDeallocated = true;
if (m_bAutoDelete)
delete this;
}
|
|
|
|
|
Yes, you are right. That would result in a recursion. My code lacks resetting the m_bAutoDelete variable. It must be:
Process::~Process()
{
if (m_bAutoDelete)
{
m_bAutoDelete = false;
delete this;
}
else
{
delete m_proc;
delete [] m_filename;
m_proc = NULL;
m_filename = NULL;
}
}
However, this is not a good solution because the destructor is called twice and this will fail if the object wasn't allocated using new .
|
|
|
|
|
thank you and the reply, I learned something for this question. thanks again!
|
|
|
|
|
I'm trying to read the context of a PDF file(such as reading the word following the cursor) and
I used class wizard to add some header files (add class form Typelib ---> acrobat Access 3.0 Type Library<3.0>) to my project and include these header files in one .cpp file, but when compile, many compile error occurs.
what I know is as follow:
each header file imported include such line : "
#import "C:\\Program Files\\Adobe\\Acrobat 10.0\\Acrobat\\plug_ins\\Accessibility.api" no_namespace
"
when I comment out this line and then compile, everything is OK, but I'm not sure is it OK to do so, by the way I'm searching what the *.api file and its function on google and baidu(another search engine)
anyone who had read PDF file may help,
I really appreciate your help. thanks.
|
|
|
|
|
Did you check the documentation[^]?
Also, if you want help then you need to explain exactly what error(s) you see, we cannot guess what happens.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thanks for your reply, I have read the document, but I am not sure how to access PDF files.
the error is as follow:
error C2011: 'IAccessible' : 'struct' type redefinition
...
many this kind of error.
the headers imported is a wrap of I* interface,for example
CAccessible == IAccessible.
CAccID == IAccID
|
|
|
|
|
It looks like you have duplicate definitions in one or more of your source files. Check which headers you are including.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I know this, but I really didn't include more than one header. I am quite puzzled. thanks all the same.
|
|
|
|
|
I have recently spent some time getting some of my apps looking right on XP styles, by adding a manifest resource, and also modifying some controls that are custom-drawn.
However, if I use my xp-style-enabled controls in apps which do not have a manifest, and therefore draw using the old style, I find that my controls still draw with the current XP style. I have used IsAppThemed() as a way of determining how to draw my controls, but I have found that this returns TRUE even though the app is not XP-style-enabled, making the control look odd! I have tried using IsThemeActive but this also always returns TRUE.
Does anyone know how I can find out if the app is XP-styled (ie the other controls are using the XP-styles)?
|
|
|
|
|