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. COM
  4. Acces Violation with oledb CoUninitialize() instruction

Acces Violation with oledb CoUninitialize() instruction

Scheduled Pinned Locked Moved COM
databasec++sharepointsql-servercom
1 Posts 1 Posters 2 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I use Visual C++ 6.0 SP 4 , SQL Server and oledb I create a class to connect to my database. In my constructor i initialize com library like this : CoInitialize(NULL); In my destructor i release com library like this : CoUninitialize(); If i use this class to execute for exemple an sql query ( store procedure), my functions open, execute, close,... work. But if i close my application ( OnOK ) , two seconds later i obtain the following acces violation message : EXCEPTION(c0000005 acces,@40f919) EBP184f0b8 EIP40f919) ASM 45 fc 8b 08 8b 01 52 ff 50 08 8b e5 5d c3 cc cc cc cc cc cc EAX:184f618 EBX:dc0110 ECX:383439 EDX:383439 ESI:dc0064 EDI:184f664 ESP:184f0b4 The suspect function is _Release() throw() which is in a Visual C++ include file ( in Include\COMIP.H ) // Releases only if the interface is not null. // The interface is not set to NULL. void _Release() throw() { if (m_pInterface != NULL) { m_pInterface->Release(); } } But if i comment out CoUninitialize() instruction, my code work without acces violation. Can anybody help me? Best regards, Cheickna :confused:

    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