dcsimg
August 15, 2018
Hot Topics:

Add your AddIn to the VBIDE

  • November 19, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »
This tip helps you to add your add-in to the VBIDE. Here is some simple connect code:

Make sure the startup object is Sub Main.

Global gobjIDEAppInst As Object 

Declare Function_
WritePrivateProfileString_
Lib "kernel32" _
Alias "WritePrivateProfileStringA"_
(ByVal AppName As String, _
ByVal KeyName As String, ByVal_
keydefault As String, ByVal _
FileName As String) 

Declare Function_
GetPrivateProfileString_
Lib "kernel32" Alias _
"GetPrivateProfileStringA"_
(ByVal AppName As String, ByVal _
KeyName As String,_
ByVal keydefault_
As String, ByVal _
returnstring As String,_
ByVal NumBytes As Integer, _
ByVal FileName As String) 

Sub Main() 
'// Change "Project1.class1"_
    to projectname.classname 
'// where the class contains
    AfterClick() 
'// events, etc. 
Dim strSection As String 
Dim returnstring As String 
strSection = "Add-Ins32" 
returnstring = String$(12, Chr$(0)) 
errcode = GetPrivateProfileString_
(strSection, "Project1.class1", _
"NotFound", returnstring,_
Len(returnstring) + 1, "VB.INI") 
If Left(returnstring, errcode) =_
"NotFound" Then 
  errcode = WritePrivateProfileString_
(strSection, "Project1.class1", _
  "0", "VB.INI") 
End If 
End Sub 





Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date