Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. .dll issue! VBA to C#

.dll issue! VBA to C#

Scheduled Pinned Locked Moved C#
questionhelpcsharp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andredani
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups