Hello,
I have a DLL written in C# with the following class:
namespace MapaGisSQL
{
public class DAL
{
public string server { get; set; }
public string database { get; set; }
public string password { get; set; }
public string username { get; set; }
public DAL()
{
}
public DAL(string server, string database, string username, string password)
{
this.server = server;
this.database = database;
this.username = username;
this.password = password;
}
}
}
It means that DAL is a constructor for this class.
I try to use the following code in MapBasic :
Include "MapBasic.def"
Declare Sub Main()
Declare Method New_DAL Class "MapaGisSQL.DAL" Lib
"MapaGisSQL.dll" Alias Ctor_CreateInstance( serverName as string, database as string, username as string, password as string) as This
Sub Main()
dim serverName as string, database as string, username as string, password as string
Dim obj as This
serverName = "myserver"
database = "mydatabase"
username = "myuser"
password = "123321"
obj = New_DAL(serverName, database, username, password)
'Then I am going to call some methods of DLL
End Sub
This code passes the compilation. But when I run the code in MapInfo 2019 I get the following message:
Could not find a public, static method named "DAL". Check method name and signature.
I don't understand what wrong. I did exactly as it is described in "mapinfo-mapbasic-v2019-reference.pdf", page 343.
Any help will be appreciated.