jsbattig / delphi-javascript

Automatically exported from code.google.com/p/delphi-javascript
3 stars 3 forks source link

RTTI. Using of TADOTable/TADOQuery. XE2, XE4, XE5. #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For reproduce error do following:

1. Create DataModule (name: DM). Put TADOConnection (connected to MS SQL 2008R2 
database), TADOTable/TADOQuery. 

2. Create in runtime JS Engine (name: oSMJSEngine), register/create 
CreateJSObject for DataModule. 
Code: 
TJSClass.CreateJSObject (DM, oSMJSEngine, 'DM', [cfaInheritedMethods, 
cfaInheritedProperties, cfaProtectedMethods, cfaProtectedFields, 
cfaGlobalFields, cfaGlobalProperties]);

I try to play with TJSClassFlagAttributes but it didn't help also.

3. From JavaScript try to run following command: 
DM.ADOTable1.FieldByName ("SomeFieldName").AsString 

And you will get error in unit "jsintf.pas", in function "procedure 
TJSClassProto.DefineJSClass(AClass: TClass; AClassFlags: 
TJSClassFlagAttributes);", starting at line 2014:
defineEnum({ pt.Name + '_' + } GetEnumName(pt.Handle, i), 1 shl i);

Error message:
Project xxx.exe raised exception class $C0000005 with message 'access violation 
at 0x00642891: read of address 0x000000c8'.

It's also related to error: Insufficient RTTI available to support this 
operation -- this is what I got in XE2.

I am using Windows 7 x64 bit. Projest was compiled for x86 platform.

I am using latest copy of "delphi-javascipt" project -- was taken from your SVN 
repository, by end of Oct/2013.

Thanks!

Original issue reported on code.google.com by andre...@diatomenterprises.com on 30 Oct 2013 at 12:54

GoogleCodeExporter commented 8 years ago
Problem with AnsiChar. Need to exclude it, or handle on different way. :)
My question -- my answer :)

Original comment by andre...@diatomenterprises.com on 21 Nov 2013 at 12:17

GoogleCodeExporter commented 8 years ago
Fixed. tkChar are now excluded from enums

Original comment by n.ame...@gmail.com on 22 Nov 2013 at 3:50