Results 1 to 4 of 4

Thread: [RESOLVED] Pass variable to DLL

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Resolved [RESOLVED] Pass variable to DLL

    VS 2008, .NET 2, Win XP

    I need help with passing a String variable from App to DLL?

    Why: I have App that on UnhandledException needs to call ErrorReport dll, send to that dll some strings like: App name, stack, error... Dll will send through internet this gathered data to me.

    I can open Dll, close it, code it, but I can not figure it how to send data to it like VB App name, VB App version, VB App error.message ...
    For example I can in my form make a global variable like Public TestGlobal As String and that I can call from anywhere in my app, but how to do it with dll?

    Code: I have app and one part of dll created:
    VB.Net Code:
    1. '===VB app code:
    2.    'call dll from my form on raising of UnhandledException error
    3.    Dim mySERform As New ErrorReport.frmMain
    4.    '=> i think i must here set the data that i wanna pass to dll?
    5.    'ErrorReport.FrmMain.<NoMethodsHere>
    6.    mySERform.ShowDialog()
    7.  
    8.  
    9. '===DLL 'ErrorReport' code:
    10. Public Class frmMain
    11.    Private DataString As String
    12.  
    13.    Public Property DataString1() As String
    14.         Get
    15.             Return DataString
    16.         End Get
    17.         Set(ByVal value As String)
    18.             DataString = value
    19.         End Set
    20.    End Property
    21.  
    22.    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    23.       '=> here goes the string(s) from VB app transfered to this dll fields
    24.       TextBox1.Text = DataString1
    25.    End Sub
    26. End Class
    Last edited by Zeljko; Sep 17th, 2009 at 07:55 AM.
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width