Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Use of DLL written with c#

  1. #11
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    Wow, there are lot of information in debug_client.txt on ox2 = CreateObject("vfpcomserver2.vfpcom2")
    (needed to exit Lianja to open the file):

    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=set debug on rc=0 (Success)
    Class Activex Object OBJECT(250928680,0) Method: name='CONSTRUCTOR'
    File ../../rco_activex.cpp at line 69 Activex(679948152) was created
    File ../../rco_activex.cpp at line 197 setControlName() vfpcomserver2.vfpcom2
    ...
    File ../../rco_activex.cpp at line 296 SLOT signature=docmd(QString) shortname=docmd typename=QVariant
    File ../../rco_activex.cpp at line 296 SLOT signature=dotnet(QString,QString) shortname=dotnet typename=QVariant
    File ../../rco_activex.cpp at line 296 SLOT signature=evalexpr(QString) shortname=evalexpr typename=QVariant
    File ../../rco_activex.cpp at line 296 SLOT signature=foxproc1() shortname=foxproc1 typename=QVariant
    File ../../rco_activex.cpp at line 296 SLOT signature=foxproc2() shortname=foxproc2 typename=QVariant
    File ../../rco_activex.cpp at line 309 PROPERTY name=objectName type=QString
    ...
    File ../../rco_activex.cpp at line 309 PROPERTY name=control type=QString
    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=ox2 = CreateObject("vfpcomserver2.vfpcom2") && create the server object rc=0 (Success)

    In my case I wrongly declared foxproc2 parameters, so it shows none. Need to be:
    Code:
        PROCEDURE foxproc2(one as Integer,two as Integer) as Integer
            RETURN one+two
        ENDPROC


    Now I see in new debug_client.txt there are two input parameters:

    File ../../rco_activex.cpp at line 296 SLOT signature=foxproc2(int,int) shortname=foxproc2 typename=int

    In VFP I can get:

    Code:
    ?ox2.foxproc2(3,4)
    7
    In Lianja console:

    Code:
    ?ox2.dynamicCall('foxproc2',3,4)  && proc with parameters
    .F.

    Changing parameters data type from integer to string does not help.
    What am I missing?

  2. #12
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,738
    The first parameter is a signature.

    “foxproc2(int,int)”
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #13
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    Nope. This does not work for me either:

    Code:
    ?ox2.dynamicCall("foxproc2(int,int)",3,4)
    .F.
    I was playing here with QString instead of int, too. Function dynamicCall works only if there are no parameters

    Code:
    ?ox2.dynamicCall('foxproc1()')
    D:\Program Files (x86)\Microsoft Visual FoxPro 9\
    Anyway, this was not Fabio's initial question about C# DLL.
    For exposed function:
    File ../../rco_activex.cpp at line 296 SLOT signature=dotnet(QString,QString) shortname=dotnet typename=QVariant
    this definitely works in Lianja:

    Code:
    ?ox2.dotnet('PLUS.Lider.Client.LiderClient','GetGUID()')
    79c00d92-3ea1-4212-ad0d-c1e4cf9ce6c5

  4. #14
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,738
    Once again, if you SET DEBUG ON it will show you how it is matching method signatures.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #15
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    SET DEBUG ON
    before ox2 = CreateObject("vfpcomserver2.vfpcom2")
    then exiting Lianja to see debug_client.txt

    This is the content of debug_client with signature of foxproc2:

    File ../../rco_activex.cpp at line 296 SLOT signature=foxproc2(int,int) shortname=foxproc2 typename=QVariant
    Opening Lianja again:

    Code:
    set debug on
    ox2 = CreateObject("vfpcomserver2.vfpcom2")
    ?ox2.dynamicCall("foxproc2(int,int)",3,4)
    .F.
    Then check it in VFP:
    Code:
    ox2 = CreateObject("vfpcomserver2.vfpcom2")   
    ?ox2.foxproc2(3,4)
    7
    Last edited by josipradnik; 2020-01-31 at 08:08.

  6. #16
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,738
    No I mean after the dynamicCall with DEBUG ON will look output some tracing.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #17
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    After?
    Here it is:

    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=set debug on rc=0 (Success)Class Activex Object VFPCOMSERVER2.VFPCOM2(225041960,647714992) Method: name='dynamicCall'
    File ../../dao.cpp at line 1324 unknown type=0
    File ../../rco_activex.cpp at line 771 DynamicCall() name=foxproc2(int,int) value= type=0 typename=(null) value.type=U
    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=?ox2.dynamicCall("foxproc2(int,int)",3,4) rc=0 (Success)


  8. #18
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,738
    Looking at that, Itís the return value which is not properly typed.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  9. #19
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    I made 4 variants of procedure's returned value (foxproc2,foxproc3,foxproc4,foxproc5):

    Name:  Screenshot - 01.02.2020. , 08_21_35.jpg
Views: 24
Size:  42.3 KB

    According debug_client.txt It is irrelevant for dynamicCall():

    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=set debug on rc=0 (Success)Class Activex Object VFPCOMSERVER2.VFPCOM2(204201512,580947000) Method: name='dynamicCall'
    File ../../dao.cpp at line 1324 unknown type=0
    File ../../rco_activex.cpp at line 771 DynamicCall() name=foxproc2(int,int) value= type=0 typename=(null) value.type=U
    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=?ox2.dynamicCall("foxproc2(int,int)",3,4) rc=0 (Success)
    Class Activex Object VFPCOMSERVER2.VFPCOM2(204201512,580947000) Method: name='dynamicCall'
    File ../../dao.cpp at line 1324 unknown type=0
    File ../../rco_activex.cpp at line 771 DynamicCall() name=foxproc3(int,int) value= type=0 typename=(null) value.type=U
    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=?ox2.dynamicCall("foxproc3(int,int)",3,4) rc=0 (Success)
    Class Activex Object VFPCOMSERVER2.VFPCOM2(204201512,580947000) Method: name='dynamicCall'
    File ../../dao.cpp at line 1324 unknown type=0
    File ../../rco_activex.cpp at line 771 DynamicCall() name=foxproc4(int,int) value= type=0 typename=(null) value.type=U
    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=?ox2.dynamicCall("foxproc4(int,int)",3,4) rc=0 (Success)
    Class Activex Object VFPCOMSERVER2.VFPCOM2(204201512,580947000) Method: name='dynamicCall'
    File ../../dao.cpp at line 1324 unknown type=0
    File ../../rco_activex.cpp at line 771 DynamicCall() name=foxproc5(int,int) value= type=0 typename=(null) value.type=U
    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=?ox2.dynamicCall("foxproc5(int,int)",3,4) rc=0 (Success)

  10. #20
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,738
    Try with beta5 and use int() for int parameters.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us