Menu

How to initialize the property of an object

Dilip Rai
2018-03-12
2018-03-20
  • Dilip Rai

    Dilip Rai - 2018-03-12

    Hi Vikram,

    Thanks for such a nice project.
    I'm new to J-Interop. I got to know how to create the instance using j-interop along with the method call.
    But I don't know for now that how to set the property of com object using j-interop.
    For example for below object how to set the property?
    ar objServer = new DSSDataSource
    {
    Name = "x.x.x.x",
    Type = EnumDSSDataSourceType.DssDataSourceTypeServer,
    Location = "x.x.x.x",
    Mode = EnumDSSConnectionMode.DssConnectionModeServerAccess,

                AuthMode = EnumDSSAuthModes.DssAuthStandard,
                login = "XXX",
                Passwd = "XXX"
            };
    
            Let me know if further info required.
            Thanks,
            Dilip
    
     
  • Dilip Rai

    Dilip Rai - 2018-03-20

    I found the way, we need to pass int value corresponding to enum. Idea is first create the object and then set the property.

     

Log in to post a comment.