473,320 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

windows control library with activex...

don
hello all,

msdn says this about using a dotnet windows control library in activex
environment...

You have to write one relatively small piece of code to make your .NET
control accessible to ActiveX hosts. ActiveX controls make several
registry entries that standard COM servers don't, so you have to add
this functionality to your .NET control. The CLR contains
prefabricated functions that will make and remove these entries. These
go by the names Control.ActiveXRegister and Control.ActiveXUnregister.
You need to provide two external functions in your control class
marked with attributes that tell the .NET COM registration utility to
call them during the registration process. These functions need to
delegate to ActiveXRegister and ActiveXUnregister.
------------------------------------------------------------------
.NET Registration as an ActiveX Control
Public Shared Sub <System.Runtime.InteropServices.ComRegisterFunctio n()>
_
AxRegister(ByVal regKey As String)
Dim foo As New Control1()
ActiveXRegister(foo.GetType)
End Sub

Public Shared Sub <System.Runtime.InteropServices.ComUnregisterFunct ion()>
_
AxUnregister(ByVal regkey As String)
Dim foo As New Control1()
ActiveXUnregister(foo.GetType)
End Sub
------------------------------------------------------------------
That's the only extra piece of code that you have to write today, and
I wouldn't be surprised if it moved into the base class in some future
version.

now i did it... and it wouldn't work. first it was giving me a compile
time error saying identifier expected. so i moved the attribute tags
before public like this...

------------------------------------------------------------------
<System.Runtime.InteropServices.ComRegisterFunctio n()> _
Public Shared Sub AxRegister(ByVal regKey As String)
Dim foo As New QueryControl()
ActiveXRegister(foo.GetType)
End Sub
<System.Runtime.InteropServices.ComUnregisterFunct ion()> _
Public Shared Sub AxUnregister(ByVal regkey As String)
Dim foo As New QueryControl()
ActiveXUnregister(foo.GetType)
End Sub
-------------------------------------------------------------------
now the identifier expected error went away... but new errors popped
up...

Name 'ActiveXRegister' is not declared.
Name 'ActiveXUnregister' is not declared.

now what is that supposed to mean...it is not able to identify the
methods activexRegister and activexunregister for some reason... am i
missing something...?

regards,

Nilotpal
Jul 19 '05 #1
0 2726

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
5
by: andy.g.ward | last post by:
I keep getting this when trying to create an MFC activex control in a c# windows service - anyone got any ideas what the missing module could be??? Exception thrown :...
3
by: fumihiko | last post by:
Hi, I created an activex control (C++), and it uses another COM dll (C++). This COM dll links with a static library that dose some calculation. (both are debug multithreaded dll) I created a...
2
by: Miky | last post by:
Hi, I have the following problem: I have a .CFM web page and I have to populate, from VB, two textboxes on it. I was thinking using sendkeys (even if I don't like it too much) but when I...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
0
by: don | last post by:
hello all, msdn says this about using a dotnet windows control library in activex environment... You have to write one relatively small piece of code to make your .NET control accessible to...
7
by: Jarod_24 | last post by:
I just downloaded a activex control that was written in C# and tried to view it on my PDA's Internet Explorer. At my regular PC it displayed just fine, but nothing showed up on the pda. Do...
2
by: Iwan Budihalim | last post by:
Dear All, I try to create Windows Control Library and embedded it to my web project. after successfull creating the windows control library and put the control to my web all the control show...
2
by: =?Utf-8?B?Sm9obiBG?= | last post by:
Hello All, I have a question about using an ActiveX control with a Windows Servce in C#. I believe it is not possible to properly setup an ActiveX control in a windows service as the particular...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.