.dll issue! VBA to C#
-
Hi all im trying to convert a .dll call method from VBA to C# VBA Code look like this: Public Sub SnodAnrop() Dim result As String host = "***" port = "***" user = "****" pass = "**" cert = "" cacert = "" service = "**" arg = vTyp & pnr & datumIn & datumUt extra = "" result = Space(1024) buf = 1024 i = Module1.snod25x(host, port, user, pass, cert, cacert, service, arg, extra, result, buf) SnodError (result) If sFel = 0 Then result = GVRSvar(result) WriteToFile (result) End If Declare Function snod25x Lib "sn25.dll" Alias "****" (ByVal host As String, _ ByVal port As String, _ ByVal user As String, _ ByVal passwd As String, _ ByVal cert As String, _ ByVal CAert As String, _ ByVal Nodtjanst As String, _ ByVal arg As String, _ ByVal extra As String, _ ByVal result As String, _ ByVal Resultbuf As Long) As Long And i have come this far in C#: private string result; [DllImport("sn25.dll", EntryPoint = "****")] static extern int snod(string host, string port, string user, string passwd, string cert, string CAert, string Nodtjänst, string arg, string extra, string result, int buf); private void button1_Click(object sender, EventArgs e) { result = new String(' ', 1024); string user = "*****"; string pass = "***"; string service = "GVRPOSDIAP2"; int i = snod("*****", "****", user, pass, "", "", service, textBox1.Text ,"", result, 1024); textBox2.Text = i.ToString(); textBox3.Text = result; } This two code strips are the same. In different language. The Problem is that dont get any result back, its empty, but in the identical code in VBA its returning info at string result. My Question is how can i write the code in C# so a get back info at the string result???? The int i is giving me status back witc