Passing a dotnet control as generic object causes problem???

  • Thread starter Thread starter Nazimuddin Tajuddin Basha
  • Start date Start date
N

Nazimuddin Tajuddin Basha

Hi All,

I have written a VB activex dll component, which exposes a method say
MethodA that takes one of the arguments as object (generic) type. The
method looks like this:

Public Sub MethodA(ByRef ctrl As Object, ByVal categoryID As
FontCategoriesEnum, Optional ByVal resID As Long)

When i use this dll within the VB projects, works fine. When i use
this in dotnet, i have to convert the control as object type and pass
it. But it gives me InvalidCastException......anybody have come across
or have the answer for this, plz drop in few lines??. Bcoz this is
very imp step in my project.
 

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

Back
Top