Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Invoke an ActiveX Control

Status
Not open for further replies.

Dalel23

Programmer
Jun 5, 2007
16
US
I hope someone can shed some light on this issue I am facing.

I desined an ActiveXControl in VB 6.
Now I want to call/invoke my ActiveX control from my asp page . When user clicks on a button I want my ActiveX Control Program to Display in a browser. I am still unable to find any helpful resouces.

Any help will be greatly appreciated.

Thank you

 
If you want to embed the control in the page so that the computer where the web browser is running will create an instance of it then use the <OBJECT> tag.

If you want to create an instance in memory on the web server then wrap it in an ActiveX DLL project and use Server.CreateObject.

 
Do you have any example please to create an instance in memory on the web server then wrap it in an ActiveX DLL project and use Server.CreateObject

My ActiveX Control (Dll) has a use interface.

 
When you create it in memory on the server the user interface will not be visible. The only way to make it visible to the user is to have an instance of it created by the browser... so the user will need to be using Internet Explorer and they will get a popup window asking if it is OK to download the control.


Anyway, supposing that you do just want to create it in memory on the server, take these steps:
1. Make a new VB6 ActiveX DLL project
2. Add a form to the project
3. Add your control to the form
4. In the class module, add code to load the form. Don't bother calling Form.Show... just load it.
5. Now make some public functions or subs in the class module that interact with the control.
6. Compile as DLL
7. In ASP, use Set ob = Server.CreateObject("ProjectName.ClassName")
8. Now call the public functions/sub of the object.
 
Thank you Sheco for your help.

My ActiveX control (Which is going to be compiled into a dll) provide user with functionality. That is there will be a lot of user's interaction.
Is it possible upon clicking a button on my asp page the ActiveX Control is invoked in a browser window? Maybe I am not getting the whole picture because I have never done it. Or maybe I should be using a different approach.

Any help will be greatly appreciated.

Thank you

 
If you wish for the user to be able to see and click the control then it will need to be downloaded to the IE browser using the <OBJECT> tag.
 
I am sorry again can you show an example?

Thank you
 
After you package with internet package type, use the "deploy" button and then you can have it do a file deploy that is fine, it will make a folder with an .HTM and a .CAB archive. You can look inside the .HTM to see how the OBJECT tag uses your control's GUID to refer to the object so the machine can find the info needed to create it in the system registry and then it also specifies the .CAB archive so the browser can download it if it isnt already installed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top