I am trying to figure out how to make ActiveX component in C++ to be used in ASP.NET with VB.
Basically, what can I do to make this (from C++):
class MathX {
int Add(int a,int b);
}
useable like this (in VB in an .aspx file):
Sub Page_Load(sender as Object, e as EventArgs)
Dim oMathX=Server.CreateObject("Extra.MathX") 'or something similar
End Sub
So far, all I know is that I need the C++ compiled into a DLL. What specifically else do I need to do? Register with the registry or something? How? I tried searching for the answers but I kept coming up with irrelevant results.
Thanks, and sorry about the bad grammar in the original post (lack of sleep and an edit button...). MSDN says that to register with regsvr32.exe, I need to implement the DllRegisterServer function in my DLL. Can you point me to an example of the implementation?
The
docs don't have a very good description.
jtmerchant
Member
95 Points
19 Posts
COM Object In C++
Aug 20, 2006 05:32 AM|LINK
I am trying to figure out how to make ActiveX component in C++ to be used in ASP.NET with VB.
Basically, what can I do to make this (from C++):
class MathX {
int Add(int a,int b);
}
useable like this (in VB in an .aspx file):
Sub Page_Load(sender as Object, e as EventArgs)
Dim oMathX=Server.CreateObject("Extra.MathX") 'or something similar
End Sub
So far, all I know is that I need the C++ compiled into a DLL. What specifically else do I need to do? Register with the registry or something? How? I tried searching for the answers but I kept coming up with irrelevant results.
vcsjones
All-Star
34842 Points
4424 Posts
Moderator
MVP
Re: COM Object In C++
Aug 20, 2006 04:46 PM|LINK
jtmerchant
Member
95 Points
19 Posts
Re: COM Object In C++
Aug 21, 2006 09:14 PM|LINK
Mikhail Arkh...
All-Star
33139 Points
6083 Posts
Microsoft
Re: COM Object In C++
Nov 10, 2006 05:04 AM|LINK
There is a lot to do if you want to turn C++ class into a COM object. Basic steps are
1. Define an interface in IDL file
2. Implement interface in the class according to COM rules
3. Register component in the registry.
You can try using ATL Project or MFC ActiveX control in the New | Project | Visual C++.
------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.