Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: enum in a dll...


Message #1 by "Gonzalo Martin Bianchi" <gbianchi@a...> on Mon, 2 Dec 2002 15:47:10 -0300
No, as far as I know.

To access an enum from a dll, the enum type must be declared Public in
a class (not module) that is public as well. I have a lot of dlls
with public enum declarations in classes instanciated as 5 (multiuse)
and I can use the enum MyDll.MyEnum (I always prefer to
specify from which module the type is declared, to be safe)
It should  work also with  globalmultiuse classes.

Anything declared in a bas module is private to the dll (i.e. to the
local project)

Marco

> The Enum definition must be GLOBALLY scoped. Place it in a code module, 
then
it works.
This problem is corrected in VB.NET with which you can define the enum in
the module where it is used and exposed externally.


  Return to Index