September 1, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

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.

 

 


Sitemap | Contact Us

Rocket Fuel