Re: Dll Project with ADO
- From: yannis <none@xxxxxxxxxx>
- Date: Thu, 28 Feb 2008 11:41:09 +0200
lzq formulated on Πέμπτη :
I create a dll project under Delphi . I write a exports function like this
function ReportOut(Handle:HWND):DWORD;stdcall;
begin
ShowMessage('Begin Test !');
Report.QReport:=TQReport.CreateParented(Handle);
Report.QReport.Preview;
ShowMessage('End Test !');
Result:=0;
end;
exports ReportOut;
and I call this function under Visual C++.
at first I create a window and use this window's HWND as parameter .
It works.
but if I add a ADO controls such as ADOConnection or ADOQuery to
TQReport(a QuickReport controls) It cann't work when I call this
function,It says there is a Unhandled exception . I don't know how the
ADO controls works . I just guess if the ADO controls can not use 'heap'
when the VC program call this function .
Could you help me ,thanks!
Try calling CoInitialize before create the TQReport and CoUninitialize after the Result := 0; line of code.
Regards
Yannis.
--
In the end, everything is a gag.
- Charlie Chaplin (1889-1977)
.
- Follow-Ups:
- Re: Dll Project with ADO
- From: lzq
- Re: Dll Project with ADO
- References:
- Dll Project with ADO
- From: lzq
- Dll Project with ADO
- Prev by Date: Dll Project with ADO
- Next by Date: Re: Dll Project with ADO
- Previous by thread: Dll Project with ADO
- Next by thread: Re: Dll Project with ADO
- Index(es):