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. Visual Basic
  4. CoInitialize has not been called

CoInitialize has not been called

Scheduled Pinned Locked Moved Visual Basic
helpdebuggingquestion
3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi I have a little problem with VB. Im using a dll in the project and it works fine until i close the application then i get a "CoInitialize has not been called" error?? Why? and its only in debug mode?? /H :confused:

    M 1 Reply Last reply
    0
    • L Lost User

      Hi I have a little problem with VB. Im using a dll in the project and it works fine until i close the application then i get a "CoInitialize has not been called" error?? Why? and its only in debug mode?? /H :confused:

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      What DLL are you using? Is the error message a VB generated error or is the DLL generating it? You'll need to post some code or more details for us to assist. Michael :-)

      L 1 Reply Last reply
      0
      • M Michael P Butler

        What DLL are you using? Is the error message a VB generated error or is the DLL generating it? You'll need to post some code or more details for us to assist. Michael :-)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        The error message is a VB generated error message and the dll im using is a C++ dll (using _stdcall and its NOT a COM dll). The strange thing is that the error message don't appear every time and it never appear if i make a EXE file of the vb project. My source cod: Vb: Public Declare Function Data Lib "E:\C++ Program\Test\Debug\Test.dll" _ Alias "_CreateData@4" (ByVal pDb As Long) As Long Dim Temp As Long Temp = Data(10) C++: .h extern "C" { __declspec(dllexport) long PASCAL CreateData (long iDatabaseId); } .cpp #include "Test.h" long PASCAL CreateData(long iDatabaseId) { return iDatabaseId*10; } I would bee so happy if you could help me :) /Z

        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