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. Visual Basic
  4. library or application name

library or application name

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
5 Posts 3 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.
  • M Offline
    M Offline
    Marc Soleda
    wrote on last edited by
    #1

    In VB2005, I've done an application and a library that is used within the application. Both of them call a function that is placed in the library and that permits to write a message in the same logfile. I'd like to add the caller's name in the log file so each message in the log would have the source that has written the line. For example: appname.exe: error msg ... libname.dll: error msg ... Is there any way to retrieve the caller's name from within the function? Thanks in advance, Marc Soleda

    ... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits

    D R 2 Replies Last reply
    0
    • M Marc Soleda

      In VB2005, I've done an application and a library that is used within the application. Both of them call a function that is placed in the library and that permits to write a message in the same logfile. I'd like to add the caller's name in the log file so each message in the log would have the source that has written the line. For example: appname.exe: error msg ... libname.dll: error msg ... Is there any way to retrieve the caller's name from within the function? Thanks in advance, Marc Soleda

      ... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits

      D Offline
      D Offline
      Dave Sexton
      wrote on last edited by
      #2

      Try Application.ProductName

      M 1 Reply Last reply
      0
      • D Dave Sexton

        Try Application.ProductName

        M Offline
        M Offline
        Marc Soleda
        wrote on last edited by
        #3

        No, it always returns the same name

        ... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits

        1 Reply Last reply
        0
        • M Marc Soleda

          In VB2005, I've done an application and a library that is used within the application. Both of them call a function that is placed in the library and that permits to write a message in the same logfile. I'd like to add the caller's name in the log file so each message in the log would have the source that has written the line. For example: appname.exe: error msg ... libname.dll: error msg ... Is there any way to retrieve the caller's name from within the function? Thanks in advance, Marc Soleda

          ... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits

          R Offline
          R Offline
          Ray Cassick
          wrote on last edited by
          #4

          Try System.Reflection.Assembly.GetCallingAssembly.


          My Blog[^]
          FFRF[^]


          M 1 Reply Last reply
          0
          • R Ray Cassick

            Try System.Reflection.Assembly.GetCallingAssembly.


            My Blog[^]
            FFRF[^]


            M Offline
            M Offline
            Marc Soleda
            wrote on last edited by
            #5

            Great, perfect.

            ... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits

            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