Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Error during print

Error during print

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ashtwin
    wrote on last edited by
    #1

    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.

    CPalliniC 1 Reply Last reply
    0
    • A ashtwin

      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.

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      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]

      In testa che avete, signor di Ceprano?

      A 2 Replies Last reply
      0
      • CPalliniC CPallini

        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]

        A Offline
        A Offline
        ashtwin
        wrote on last edited by
        #3

        Actually in my system it is not crashing. The logs i got from the client machine. I checked on the net and got the clue that it may the problem with installed drivers.

        1 Reply Last reply
        0
        • CPalliniC CPallini

          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]

          A Offline
          A Offline
          ashtwin
          wrote on last edited by
          #4

          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 using

          mMetaFileHandle = 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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups