Цитата:
Сообщение от
belugin
я думаю, ято вряд ли получится передать IAxaptaRecord в качестве параметра в функцию DLL
Хе-хе. Я тоже так думал, но против лома помогает другой лом.
Вот пример с Excel и Delphi
X++:
static void Job33(Args _args)
{
ComExcelDocument_RU excel = new ComExcelDocument_RU();
ComVariant cv;
Com doc;
Com app;
ComInterface ci;
DLL _DLL = new DLL("COMCall.dll");
DllFunction dllfunc = new DllFunction(_dll, "ComObject");
;
excel.newFile();
excel.visible(false);
doc = excel.getComDocument();
app = doc.Application();
cv = ComVariant::createFromCOM(app);
ci = cv.iDispatch();
DllFunc.returns(ExtTypes::DWord);
DllFunc.arg(ExtTypes::DWord);
DllFunc.Call(ci);
}Исходный текст dll на Delphi
X++:
library ComCall;
uses
Windows,
ExcelXP;
function ComObject(Int : IDispatch) : Boolean; stdcall;
var
app : _Application;
begin
Result := False;
if Int <> nil then
begin
int.QueryInterface(IID__Application, app);
if app <> nil then
begin
app.Visible[GetUserDefaultLCID] := True;
app.Range['a1', 'a1'].Value2 := '?????';
app := nil;
end;
end;
end;
exports
ComObject;
begin
end.