ADO in dll AV

From: Daniel Lemire (NoSpam_dlemire_at_b2b2c.ca)
Date: 12/23/03


Date: 23 Dec 2003 13:13:48 -0700


Hi there,

this has probably been taked about before but couldn't find an answer.

I have a DLL that exports one function. In this function I have the following code:

    // Create the datamodule
    DM_Main := TDM_Main.Create(Nil);
    // Print it's report
    Result := DM_Main.PrintReport;
    // Free the datamodule
    DM_Main.Free;

When the DataModule (DM_Main) has no Ado component on it, it works fine. But when I add a TAdoConnection object on it, I get an AV when calling the exported function.

I added ShareMem in the uses of all my units in case it was a string problem but that wasn't the case.

I have Delphi 6 enterprise, update pack 2 installed.

Thanks

Daniel



Relevant Pages

  • Re: Convert C-Builder program to Delphi?
    ... > quite separate from the function declaration itself. ... >this DLL ... >way the only place anything needs to be changed is in the #define macro. ... Exports SomeDLL_Open Name 'SomeDLL_Open'; ...
    (comp.lang.pascal.delphi.misc)
  • Re: Convert C-Builder program to Delphi?
    ... > quite separate from the function declaration itself. ... >this DLL ... >way the only place anything needs to be changed is in the #define macro. ... Exports SomeDLL_Open Name 'SomeDLL_Open'; ...
    (comp.lang.cpp)
  • Re: Export C++ class from a Borland DLL and use it in Microsoft VC
    ... Borland uses a different C runtime than Visual Studio. ... Of course, it is not impossible to use a DLL across compilers, even across different languages. ... You still need to use pure extern "C" exports, but the functions themselves can accept and return C++ classes. ... You must either not use enums in your interface, or modify Borland's compiler settings for your particular cpp file. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Export C++ class from a Borland DLL and use it in Microsoft VC
    ... Borland uses a different C runtime (including a different memory ... Use a C-style DLL. ... use pure extern "C" exports, but the functions themselves can accept and ... You must either not use enums in your interface, ...
    (microsoft.public.dotnet.languages.vc)
  • Re: silverfrost IDE
    ... to make a dll that gets picked up by VB. ... I do not believe that Salford Fortran uses .def files ... exports according to your preference. ... Salford provides its own linker which AFAIK does not use .def ...
    (comp.lang.fortran)