Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion - make exposing Delphi objects to python painless by utilizing the new RTTI feature in D2010 (and above) #18

Closed
GoogleCodeExporter opened this issue May 13, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Hi,

I've a suggestion - make exposing Delphi objects to python painless by 
utilizing the new RTTI (runtime type information) feature in D2010 (and above).

Currently exposing a class to the hosted Python code needs to you to write too 
much code (check demo06), I guess if we take advantage of the new RTTI feature 
in the newer versions of Delphi, the process can be improved a lot.

For example, check out the Delphi chromium embedded project, all you have to do 
to expose the interface of any Delphi class to the JavaScript environment, is 
to register the class:

// this is your class exposed to JS 
  Test = class 
    class procedure doit(const v: string); 
  end; 

initialization 
// Register your class 
  TCefRTTIExtension.Register('app', Test);

// and in JavaScript code to call that class above:
app.doit(''foo'')', '', 0); 

Cool! Isn't it?

The above code was extracted from: 
http://groups.google.com/group/delphichromiumembedded/browse_thread/thread/1793e
7ca66012f0c/8ab31a5ecdb6bf48?lnk=gst&q=JavaScript+return+#

Some intro about RTTI introduced since D2010:
http://robstechcorner.blogspot.com/2009/09/delphi-2010-rtti-basics.html

Original issue reported on code.google.com by [email protected] on 29 Oct 2011 at 8:51

@GoogleCodeExporter
Copy link
Author

Original comment by pyscripter on 2 Nov 2011 at 1:45

  • Changed state: Duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant