Results 1 to 4 of 4

Thread: Message boxes from class libraries?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Message boxes from class libraries?

    I have made a class library which is to be used with a winforms app. IN the class library I use message boxes to inform the user of any exceptions. But when creating a new winforms app, and begin using the classlibrary, the messageboxes won't show up, instead I get an unhandled exception. Am I thinking wrong here?


    kind regards
    Henrik

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I think it is a bad idea to mix your UI with your dll unless you are aware of the consequences. What would happen when you try and use that dll for a web application?

    Anyway, you should be able to see your form, as I have done it before. Can you post some code where you show it or if you get an exception post the ex.tostring()?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    Gaah... yes you are right... of course I shouldn't mix those!!!!!

    Any suggestions on what to return to the developer when there is an exception?

    E.g. what should I do in the catch?

    kind regards
    Henrik

  4. #4
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    In the catch I usually throw up a new exception that has the original exception as it's inner exception and has my custom exception string that states what happened and may have some values for variables, etc.

    I am curious as to how others might be handling this?

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