473,387 Members | 1,517 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,387 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 2729

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.