C# and function parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kare
    New Member
    • Aug 2008
    • 2

    C# and function parameters

    Hello,

    I'm writing a dll in which i need to create function with different arguments.
    When using function overload method i try to call these functions from FoxPro and it shows that my dll has three functions example: CMDLINE, CMDLINE_2,CMDLI NE_3, but in c# i declared them with the same name "CMDLINE".

    I need such functions: CMDLINE(); CMDLINE(int blah); CMDLINE(int blah,string blah2);

    Because now its CMDLINE(int blah, string blah2) and if i don't write all the parameters i get an exception which says me tha "The parameter is incorrect";

    I need help for function overloading in class library or this exception catching or making things to work with optional parameters.
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Can FoxPro handle overloaded methods? It looks like you did it correctly, but the program using the .DLL choked on it.

    Comment

    • kare
      New Member
      • Aug 2008
      • 2

      #3
      i think that maybe problem with overload is because of writing class library not regular win32 application. c# compiles my overloaded functions as different functions with added "_2" , "_3" index at the end of function's name. I can't find the solution because i need to use foxpro to call my functions(the software which will use the dll is written in FoxPro). Could anybody help?

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Well, post your code, because that doesn't sound right. I'm certain that class libraries can handle overloaded functions. It could be that FoxPro can't and that is the way that it interprets them.

        Comment

        Working...