raju said:
Is it possible to show the message box with in the class library
( in dll).
Why don't you try it? The answer should be yes.
However, it's extremely poor design for a number of reasons:
- Your client may be a service or background application, which should not
or even cannot interact with the user. If nobody's sitting behind the
computer, the application will stop running.
- Even if your client does interact with the user, showing a message box may
still block them unexpectedly.
- It violates separation of concerns. Your DLL should not concern itself
with displaying messages to a user, the application is already concerning
itself with that. Your DLL should return status or ask for additional input
in a programmatic fashion, so the client can decide how to best inform the
user. It should not make these decisions on its own.
- Your client may use a different language. You cannot ensure your DLL
supports all the localizations that your client does (and vice versa).
If you really must have this, you should at least provide the client with a
way to turn off these message boxes. That way, clients which really cannot
afford to show them (because they're running non-interactively) can at least
opt out.