Module name?

.net , vb6 United States
  • 17 years ago

    How can I get the name of the module running. When you have a form its easy, you just code

  • 17 years ago

    There is no way to get the name of a module as far as I know.  I've created an add-in that adds the name, as:

    Private Const THIS_MODULE                   As String = "BMain"

    to the tops of all of my modules, forms, classes, user controls.  It also adds:

    Const THIS_CONTEXT                          As String = "Main"

    to the beginning of each function, sub, property, etc.  This information together with the undocumented "Erl" property, which indicates the current line number when an error occurs, combine to create a pretty effective Error logging system in my apps. . . .  

    I had wanted to add an URL showing the basis for my error handling strategy.  MSDN used to have a pretty good technical article.  Alas, with .NET out M$ seems to be purging out a lot of good information on how to use their, now legacy, older versions of VB :-(

    For more info see:
    Erl Property



  • 17 years ago

    I do not know of any way to do that.  Some of these masters might.  That would be a cool thing to know.


Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programs must be written for people to read, and only incidentally for machines to execute.”