Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
You are compiling a project that include an ocx an...
Author:
kegham
E-mail:
Click to e-mail author
Website:
http://www.vbdotlb.connect.to
Submitted:
10/28/2002
Version:
VB5
Compatibility:
VB5, VB6
Category:
ActiveX
Views:
12479
You are compiling a project that include an ocx and then suddenly you forget that some users of your application dont have or actually know how should they register this ocx control in regedit so here is s small code that will register on runtime your application without givin any error to the user :)
Declarations:
Add a module to your project named "modMain" --------------------------------------------- Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Code:
Add a text box and a timer ---------------------------- text box text for example your ocx name "comdlg32.ocx" timer1 interval = "5000" The code ---------- Private Sub Form_Load()Timer1.Enabled = True End Sub Private Sub Form_Unload(Cancel As Integer) Cancel = 1 End Sub Private Sub Timer1_Timer() ShellExecute Me.hwnd, "Open", "regsvr32.exe", Text1.Text, 0, 1 Timer1.Enabled = False End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement