class library problem

G

glenn

I am assuming that Microsoft has renamed their (dll's) and are now calling
them class libraries since I can't find anything related to dll's in Visual
Studio. If I am correct in this assumption then can anyone help me with how
to have my class library display a MessageBox.Show. I can't seem to add the
proper using statement to get access to that class.

Can dll's access messageboxes?

On a side note: Is is possible for a class library/dll to open a windows
form?

I am new to VS but am very familiar with the old dll and windows stuff so
not quite sure why this is so difficult...

Thanks,

glenn
 
B

Brendan Grant

Within the .NET world, the common name for .NET dll's is
assembly and you add a reference to an assembly from your
own application/assembly/etc to access the
classes/functions/etc within it.

MessageBox.Show() is part of the System.Windows.Forms
namespace, so you would have to include a reference to the
System.Windows.Forms.dll assembly.

It is possible to have a class library/dll open a windows
form. So long as the assembly you are opening it from has
access to it (either in the same assembly or another one),
you would open it just as you would from another window or
console app (provided you are referencing
System.Windows.Forms)
 
G

glenn

Well, that is what I figured as well, however, its not obvious how to do
what you are telling me. If I click on the references and tell it to add a
reference, there is no such item to add. If I manually go to the top of my
unit and just add the using statement for System.Windows.Forms it tells me
it doesn't exist.

It looks like because I'm in an assembly I loose access to that part of the
system. So how do I get it to add properly so I can use it?

Thanks,

glenn
 
G

glenn

Nevermind, I exited VS and restared and now I have the windows reference
that I can add. Sorry, not sure why I had to restart it but it at least is
working now...

Thanks,

glenn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top