By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Challenge for interop Champions

P: n/a
hello all,

i have created a windows control in VB.NET... i want to
use this control as an activex control in an activex
container.
now here is the scenario until now.

I Updated the project properties so that your assembly is
registered for COM interop by setting register for com
interop option checked.
i created the register and unregister methods inside the
control class. the code is given below:
-----------------------------------------------------------
<ComRegisterFunction()> Public Shared Sub AxRegister(ByVal
RegKey As String)
Dim sb As New StringBuilder(RegKey)
sb.Replace("HKEY_CLASSES_ROOT\", "")
Dim k As RegistryKey
k = Registry.ClassesRoot.OpenSubKey(sb.ToString,
True)
Dim ctrl As RegistryKey
ctrl = k.CreateSubKey("control")
ctrl.Close()
End Sub
<ComUnregisterFunction()> Public Shared Sub
AxUnregister(ByVal RegKey As String)
Dim sb As New StringBuilder(RegKey)
sb.Replace("HKEY_CLASSES_ROOT\", "")
Dim k As RegistryKey
k = Registry.ClassesRoot.OpenSubKey(sb.ToString,
True)
k.DeleteSubKey("control", False)
Dim inprocServer32 As RegistryKey
inprocServer32 = k.OpenSubKey("inprocServer32",
True)
k.DeleteSubKey("CodeBase", False)
k.Close()
End Sub
-----------------------------------------------------------
the project compiled successfully, and the dll was
created.

after that i copied the dll generated thus, into another
machine and registered the dll file using regasm.exe /tlb
on another machine. and the tlb file was generated and
registered successfully.

so far so good. now theoretically, i should be able to see
my control in the list of controls in project->components
window. but i can't. i can see it in project-> references
window, which is a list of non control activex components
(duh!). but i can't see it in the project->components
window.

what am i missing and where...?

this is an emergency and i am running out of time...

please help...

regards,

Nilotpal

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.