Strange error using a dll

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Torben Laursen

    Strange error using a dll

    Hi

    I have a dll written in C++ builder that I have been using for several years
    by calling it using VBA or C++ from VS.

    But I cannot use it from a C# program. When I try to use a function inside
    it I get this strange exception:
    Unable to load DLL 'DB_Forms.dll': Invalid access to memory location.
    (Exception from HRESULT: 0x800703E6)

    Can anyone give me some hints on what may be wrong?

    PS I am using VS2005

    Thanks Torben


  • Peter Bromberg [C# MVP]

    #2
    RE: Strange error using a dll

    Did you set a reference to this using the COM tab from Add References, and
    make your call against the generated Interop assembly?
    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:

    UnBlog:





    "Torben Laursen" wrote:
    Hi
    >
    I have a dll written in C++ builder that I have been using for several years
    by calling it using VBA or C++ from VS.
    >
    But I cannot use it from a C# program. When I try to use a function inside
    it I get this strange exception:
    Unable to load DLL 'DB_Forms.dll': Invalid access to memory location.
    (Exception from HRESULT: 0x800703E6)
    >
    Can anyone give me some hints on what may be wrong?
    >
    PS I am using VS2005
    >
    Thanks Torben
    >
    >
    >

    Comment

    • Chris Dunaway

      #3
      Re: Strange error using a dll


      Torben Laursen wrote:
      Hi
      >
      I have a dll written in C++ builder that I have been using for several years
      by calling it using VBA or C++ from VS.
      >
      But I cannot use it from a C# program. When I try to use a function inside
      it I get this strange exception:
      Unable to load DLL 'DB_Forms.dll': Invalid access to memory location.
      (Exception from HRESULT: 0x800703E6)
      >
      Can anyone give me some hints on what may be wrong?
      >
      PS I am using VS2005
      >
      Thanks Torben
      What is the function signature of the function inside the .dll and what
      is the corresponding C# p/invoke signature you are using?

      Comment

      Working...