Error during print
-
Hi, While performing the print operation my application is crashing(only some times). In logs i have found the following error: Violation address: 0x7c93426d Exception code: 3221225477 Description: EXCEPTION_ACCESS_VIOLATION: The thread tried to read from or write to a virtual address for which it does not have the appropriate access. Access violation error at READING from 0x0. Can somebody suggest me what may be the possible cause of error.
-
Hi, While performing the print operation my application is crashing(only some times). In logs i have found the following error: Violation address: 0x7c93426d Exception code: 3221225477 Description: EXCEPTION_ACCESS_VIOLATION: The thread tried to read from or write to a virtual address for which it does not have the appropriate access. Access violation error at READING from 0x0. Can somebody suggest me what may be the possible cause of error.
Why don't you use the debugger to find the offending line? Have you more detailed info coming from the log file? With the info you provided it is really hard guessing the reason of the error. :)
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] -
Why don't you use the debugger to find the offending line? Have you more detailed info coming from the log file? With the info you provided it is really hard guessing the reason of the error. :)
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] -
Why don't you use the debugger to find the offending line? Have you more detailed info coming from the log file? With the info you provided it is really hard guessing the reason of the error. :)
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]Actually at one place i am using the follwing code and dcRef is NULL in my case so it is going to the else part.
mDC = new CMetaFileDC();
if (mDC != 0)
{
HDC myhdl;
if (dcRef != 0)
{
myhdl = dcRef->m_hAttribDC;
}
else
{
myhdl = getDC();
dcRef = CDC::FromHandle(myhdl);
}mDC->CreateEnhanced(dcRef, 0, bounds, description); mDC->SetAttribDC(myhdl); // Set default mapmode to MM\_HIMETRIC mDC->SetMapMode(MM\_HIMETRIC); }
Is there any problem in passing a pointer acquired from CDC::FromHandle to CreateEnhanced.
At some other place i am usingmMetaFileHandle = mDC->CloseEnhanced();
delete mDC;
mDC = 0;
do something .....
if (mMetaFileHandle != 0)
{
// Release metafile handle if existing
::DeleteEnhMetaFile(mMetaFileHandle);
mMetaFileHandle = 0;
}
HDC myhdl = getDC();
CDC dc;
dc.Attach(myhdl);
dc.DeleteDC();In the above code getDC is returning a handle to the device context.