Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7012977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:19:34+00:00 2026-05-27T22:19:34+00:00

We can use the SuperObject library to invoke methods of a certain object by

  • 0

We can use the SuperObject library to invoke methods of a certain object by its name and giving its parameters as a json string using the SOInvoker method like in this answer

I’d like to know how do I send a created object as a parameter. I tried to send it like

LObjectList := TObjectList.Create;
LSuperRttiCtx := TSuperRttiContext.Create;
LSuperObjectParameter := LObjectList.ToJson(LSuperRttiCtx);

SOInvoke(MyInstantiatedObject, 'MyMethod', LSuperObjectParameter);

but inside MyMethod the LObjectList reference is lost.

What am I doing wrong?

The superobject library can be downloaded here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:19:35+00:00Added an answer on May 27, 2026 at 10:19 pm

    It will works if you use array of records intead of object list.
    If you still want to use object list you will have to write encoders and decoders like this. I have written encoder/decoder for TObjectList, you will have to do the same for your objects and embed the class name somewhere.

    ctx.SerialToJson.Add(TypeInfo(TObjectList), ObjectListToJSON);
    ctx.SerialFromJson.Add(TypeInfo(TObjectList), JSONToObjectList);
    
    function ObjectListToJSON(ctx: TSuperRttiContext; var value: TValue;
      const index: ISuperObject): ISuperObject;
    var
      list: TObjectList;
      i: Integer;
    begin
      list := TObjectList(value.AsObject);
      if list <> nil then
      begin
        Result := TSuperObject.Create(stArray);
        for i := 0 to list.Count - 1 do
          Result.AsArray.Add(encodeyourobject(list[i]));
      end else
        Result := nil;
    end;
    
    function JSONToObjectList(ctx: TSuperRttiContext; const obj: ISuperObject; var Value: TValue): Boolean;
    var
      list: TObjectList;
      i: Integer;
    begin
      list := nil;
      case ObjectGetType(obj) of
        stNull:
          begin
            Value := nil;
            Result := True;
          end;
        stArray:
          begin
            list := TObjectList.Create;
            for i := 0 to obj.AsArray.Length - 1 do
              list.Add(decodeyourobject(obj.AsArray[i]));
            Value := list;
            Result := True;
          end;
      else
          result := False;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can use :contains to find the object has a certain keyword when it
You can use SelectFolder() to get a folder or GetOpenFolderitem(filter as string) to get
I can use VS08's MFC/ActiveX template to create a C++ ActiveX object that I
can i use hibernate to login jsp page using (session) if i'm not using
We can use standard C library routines in standalone micro-controller programming but we cant
How can use spans object to get all matches in a document for a
we can use both the method while passing parameters to sql query ? then
Can wsgi be configured to use a specific python executable? When using the WSGIPythonHome
How can use the WebBrowser control in WPF to navigate using Search engine uri
I can use set modDate to the modification date of theFile as string to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.