Re: ADO in dll AV
From: Viatcheslav V. Vassiliev (support_at_oledbdirect.com)
Date: 12/24/03
- Next message: moritenw: "can't ceate TWideStringField with FieldDefs Value?"
- Previous message: Brian Bushay TeamB: "Re: passing date parameter in commandtext"
- In reply to: Brian Bushay TeamB: "Re: ADO in dll AV"
- Next in thread: Daniel: "Re: ADO in dll AV"
- Reply: Daniel: "Re: ADO in dll AV"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 24 Dec 2003 09:49:54 +0300
It is better to include ComObj unit in main project - this will call
CoInitialize from main project.
This is from MSDN CoInitialize description:
Because there is no way to control the order in which in-process servers are
loaded or unloaded, do not call CoInitialize, CoInitializeEx, or
CoUninitialize from the DllMain function.
MSDN DllMain:
Warning The entry-point function should perform only simple initialization
or termination tasks. It must not call the LoadLibrary or LoadLibraryEx
function (or a function that calls these functions), because this may create
dependency loops in the DLL load order. This can result in a DLL being used
before the system has executed its initialization code. Similarly, the
entry-point function must not call the FreeLibrary function (or a function
that calls FreeLibrary), because this can result in a DLL being used after
the system has executed its termination code.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Brian Bushay TeamB" <BBushay@Nmpls.com> ???????/???????? ? ????????
?????????: news:da6iuvs5njbak1os39f2h1bgkr8eicjoho@4ax.com...
> >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.
> >
>
> Are you calling CoInitialize in the Initialization section of the DLL?
ADO is
> uses COM and in a DLL you need to manage initializing COM
>
>
> --
> Brian Bushay (TeamB)
> Bbushay@NMPLS.com
- Next message: moritenw: "can't ceate TWideStringField with FieldDefs Value?"
- Previous message: Brian Bushay TeamB: "Re: passing date parameter in commandtext"
- In reply to: Brian Bushay TeamB: "Re: ADO in dll AV"
- Next in thread: Daniel: "Re: ADO in dll AV"
- Reply: Daniel: "Re: ADO in dll AV"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|