.tlb file question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i used regasm to make my vb.net control a tlb file...how can i add it to like
my c++ form? i used regasm and made it to a .tlb file but when i try to add
it to the toolbox it gives an error....what am i doing wrong?
 
you use regasm with the /tlb option to create a tlb file which is then added
to the registry.
in your C++ application, add a reference to it by right clicking on your
references item.
you can then select the component in the COM list.

to add it to your toolbox, right-click on the components tab, and select the
control from the COM list.

kind regards,
Bruno.
 
i did that and i got an error saying it waasnt recognized when trying to add
it to the toolbox, and another erro when trying to add a reference...i used
regasm with the /tlb option and have a .tlb file all set
 
i reread your original post, and am a little confused.
did you try to register the control itself, or did you build it into a
managed dll or an ActiveX dll?

you cannot directly register a control itself.
you have to build a dll that contains the control.

you then register the dll, used either regasm if you built a .NET dll, or
regsvr32 if you built an ActiveX dll.

after that you can add a reference to the control as i described earlier.

kind regards,
Bruno.
 
i registered the .net control using the "regasm /tlb" command in the command
prompt. i built a "Visual Basic Control Library" project and when it compiled
into a dll, i used the regasm /tlb command in the command prompt to register
it and create a .tlb file. when i try and use that either by referencing it
or by adding it to the toolbox, i get an error
 
look at the thread 2 messages below this one, titled 'using C# dll as
COM'.
maybe you have to register your component using gacutil before using regasm,
even though i wouldn't know why, because it works without doing that on my
system.
maybe something to do with the actual control or the code behind it?

kind regards,
Bruno.
 
Back
Top