Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Use of DLL written with c#

  1. #21
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    If I properly understand where to put int(),

    Code:
    ?ox2.dynamicCall("foxproc5(int(),int()",3,4)
    .F.
    Beta5, the same result in all four variants.

  2. #22
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,739
    No, on your parameters not the signature.

    ox2.dynamicCall("foxproc5(int,int)",int(3),int(4))
    Last edited by barrymavin; 2020-02-01 at 02:54.
    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. #23
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    Nothing shows. No .F. result.

    Debug_client.txt:

    File ../../lib_dbw.cpp at line 1742 dbw_execute() command=set debug on rc=0 (Success)Class Activex Object VFPCOMSERVER2.VFPCOM2(252239400,673826824) 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)",int(3) ,int(4)) rc=0 (Success)
    Class Activex Object VFPCOMSERVER2.VFPCOM2(252239400,673826824) 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)",int(3) ,int(4)) rc=0 (Success)
    Class Activex Object VFPCOMSERVER2.VFPCOM2(252239400,673826824) 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)",int(3) ,int(4)) rc=0 (Success)
    Class Activex Object VFPCOMSERVER2.VFPCOM2(252239400,673826824) 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)",int(3) ,int(4)) rc=0 (Success)

  4. #24
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,862
    Hi Josip,
    thanks for all your sample..

    but my DLL don't work.

    Is possible that the problem is on the DLL.. I don't know.. I don't use never VS and c#.

    I perform other test...

    One question, my c# dll file is: GeneralInputOutputServiceGroupCGK5188.dll
    I need to copy the file into c:\windows\syswow64 and register it before use?
    Or I need to copy the file where is my Lianja/VFP prg?


    thanks
    Fabio

  5. #25
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    I need not to worry about registering it because C# project has set in its Properties,
    Tab "Build Events",
    in "Post-build event command line" something like that:

    Code:
    "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /u PLUS.Lider
    "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /i "D:\....yourfolder\yourdll"
    (In fact, the last part is: ... /i "$(TargetPath)" , depending on "Output path" from previous tab)

    and "Run the post-build event" is specified:
    On successful build
    After rebuilding solution/project, DLL is registered in Windows GAC (C:\Windows\Microsoft.NET\assembly\GAC_32).
    And regardless where is now DLL located, I can in Lianja
    Code:
    ox = CreateObject("vfpcomserver.vfpcom")
    ?ox.dotnet('PLUS.Lider.Client.LiderClient','ScreenResolution()')
    1600x900
    Starting part of my C# (after few usings) is:
    Code:
    namespace PLUS.Lider.Client
    {
        [ComVisible(true)]
        [ClassInterface(ClassInterfaceType.AutoDual)]
        public sealed class LiderClient
        {
    ...
            public string ScreenResolution()
            {
                return Screen.PrimaryScreen.Bounds.Width.ToString() + "x" + Screen.PrimaryScreen.Bounds.Height.ToString();
            }
    ...
            public string GetGUID()
            {
                string Guidd1;
                Guid c = Guid.NewGuid();
                Guidd1 = c.ToString();
                return Guidd1;
            }
    Last edited by josipradnik; 2020-02-04 at 12:10.

  6. #26
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,862
    this:
    [ComVisible(true)]

    give me a error...

    I'm too newbie to VS..

  7. #27
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,099
    Hi Fabio,

    You should show me error text or a screenshot.

    I suppose your C# does not start with
    Code:
    using System.Runtime.InteropServices;
    Last edited by josipradnik; 2020-02-05 at 03:21.

Page 3 of 3 FirstFirst 123

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