You are not logged in.
Hello Arnaud,
My program uses Word automation late-binding, and today I found some EOleException errors are related to`SynCommons.SynVarDispProc`, in the following line:
// process Ole Automation variants
if Assigned(VarDispProc) then
VarDispProc(pointer(Result),Variant(Instance),CallDesc,@Params); // line 46521
It's weird, it's not clear to me why madExcept's reports error in`SynCommons.SynVarDispProc` when calling a Word document object.
Do you think if the OleVariant interception by SynCommons will cause any EOleException with message like "command failed" and so on? How to avoid SynCommons.SynVarDispProc to be called?
Thanks.
Call stack:
00696a6f +0bf app1.exe System.Win.ComObj DispatchInvokeError
006963e1 +1f1 app1.exe System.Win.ComObj DispatchInvoke
00696992 +0b2 app1.exe System.Win.ComObj VarDispInvoke
008cc0b3 +0d3 app1.exe SynCommons 46521 +10 SynVarDispProc
017e8517 +167 app1.exe MyUnit1 165 +35 MyClass1.Method1 // here the program calls the OleVariant
Last edited by edwinsn (2021-01-07 19:12:14)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Try to disable DOPATCHDISPINVOKE conditional around line 46585.
I will try, but I found two lines of comments about this conditional define:
// we NEED our patched DispInvoke to circumvent some Delphi bugs on Win64
// to circumvent LIdent := Uppercase() in TInvokeableVariantType.DispInvoke()
Are these two items still true?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
I'm in trouble then... I use TDocVariant with late binding...
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
@ab,
That's Great! But since the comments (posted below) didn't mention any Delphi versions and the code is either `{$ifdef DELPHI6OROLDER}` or `{$ifdef CPU64}`, so I actually couldn't read the info you provided above...
But thank you all the same!
{$ifdef DOPATCHTRTL}
{$define DOPATCHDISPINVOKE} // much faster late-binding process for our types
{$endif}
{$ifdef CPU64}
{$define DOPATCHDISPINVOKE}
// we NEED our patched DispInvoke to circumvent some Delphi bugs on Win64
{$endif}
{$ifdef DELPHI6OROLDER}
{$define DOPATCHDISPINVOKE}
// to circumvent LIdent := Uppercase() in TInvokeableVariantType.DispInvoke()
{$endif}
{$endif FPC}
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline