View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002073 | JEDI VCL | 00 JVCL Components | public | 2004-08-20 01:14 | 2006-06-19 06:24 |
Reporter | maxp | Assigned To | ivan_ra | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | 3.30 | |||
Summary | 0002073: OLE automation support does not work correctly in JvInterpreter | ||||
Description | Run JvInterpreterTest. Select 'sample - excel.pas'. Try to run. First error (type mismatch) occurs in line "Cell.Value := 'Line ' + Line;" After changing this line to "Cell.Value := 'Line ' + IntToStr(Line);" this part works, but it is definitely incorrect behaviour, because Cell.Value should behave as Variant type. The second error (OLE error 800A03EC occurs in lines Range := ExcelWindow.Range(ExcelWindow.Cells(1, 1), ExcelWindow.Cells(LineCount + 1, ColumnCount + 1)); and so on. | ||||
Tags | No tags attached. | ||||
|
It seems that in the last JVCL version all is OK. |
|
This was fixed in revision 10586 (example 'sample - excel.pas'). But JvInterpreter still incompatible with Delphi ole automation call sintaxis: in Delphi we write Excel.Cells[1,2], but in JvInterpreter scripts we must write Excel.Cells(1,2). In Delphi square brackets [] in OLE call means property, and compiler calls DispInvoke with DISPATCH_PROPERTYGET flag; In other hand, round brackets ()means method call (DispInvoke called with DISPATCH_METHOD or sometimes with DISPATCH_METHOD or DISPATCH_PROPERTYGET). Thats why correct Delphi sintaxis is: Excel.Cells[1,2] Excel.ActiveWorkbook.SaveAs('text.xls'); In JvInterpreter scripts call "Excel.Cells[1,2]" not works. This is fixible (some work with TJvInterpreterAdapter.DispatchCall and TJvInterpreterAdapter.GetValue), and I can do it. But this is problem: people who works with with JvInterpreter already have scripts, which can become unworkable after JvInterpreter fix. So, I suggest for a while to permit both types of OLE call: Excel.Cells[1,2] Excel.Cells(1,2) In this case tvery OLE call will be with DISPATCH_METHOD or DISPATCH_PROPERTYGET flag. Any comments? |
|
IMHO, it would be better do not make overfixes since the current realization is working. Anyway JvInterpreter syntax is not 100% compartible with Delphi. |
2006-05-31 03:35
|
JvInterpreter.pas.patch (678 bytes)
Index: JvInterpreter.pas =================================================================== --- JvInterpreter.pas (revision 10628) +++ JvInterpreter.pas (working copy) @@ -4237,7 +4237,21 @@ end; if Result then Exit; - end; + end + else + if Args.ObjTyp = varDispatch then + { Ole automation call } + begin + {$IFDEF JvInterpreter_OLEAUTO} + Result := DispatchCall(Identifier, Value, Args, True); + if Result then begin + Args.ReturnIndexed := True; + Exit; + end; + {$ELSE} + NotImplemented(RsOleAutomationCall); + {$ENDIF JvInterpreter_OLEAUTO} + end; end else begin |
|
This is patch allowing both types of OLE call: Excel.Cells[1,2] // legal Delphi call Excel.Cells(1,2) // old JvInterpreter call There is no additional property/method control, so functionality only extended |
|
Ivan, can this be marked as resolved? |
|
I can commit it into SVN, but my work file also includes solution for 0003730. Waiting for response |
|
Then please do it when you get the answer. |
|
this is now in SVN |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-08-20 01:14 | maxp | New Issue | |
2006-05-30 11:56 | maxp | Note Added: 0009363 | |
2006-05-31 02:55 | ivan_ra | Note Added: 0009366 | |
2006-05-31 02:55 | ivan_ra | Status | new => feedback |
2006-05-31 03:09 | maxp | Note Added: 0009367 | |
2006-05-31 03:35 | ivan_ra | File Added: JvInterpreter.pas.patch | |
2006-05-31 03:39 | ivan_ra | Note Added: 0009368 | |
2006-06-09 05:24 | obones | Note Added: 0009534 | |
2006-06-09 05:42 | ivan_ra | Note Added: 0009540 | |
2006-06-09 06:16 | obones | Relationship added | related to 0003730 |
2006-06-09 06:19 | obones | Note Added: 0009548 | |
2006-06-19 06:24 | ivan_ra | Status | feedback => resolved |
2006-06-19 06:24 | ivan_ra | Fixed in Version | => Daily / SVN |
2006-06-19 06:24 | ivan_ra | Resolution | open => fixed |
2006-06-19 06:24 | ivan_ra | Assigned To | => ivan_ra |
2006-06-19 06:24 | ivan_ra | Note Added: 0009603 |