G
Guest
Good afternoon. I need some basic help with VB. I haven't really used VB
since v6 and now I am using VS 2005 and I see a few things have changed (so
please excuse me if I am rusty).
I need to call a Windows API (RemoveControlByName - OCCACHE.DLL). So far, I
have followed http://msdn2.microsoft.com/en-us/library/172wfck9(VS.80).aspx
but keep getting the error "Name RemoveControlByName is not declared".
In VB, I have a CLASS of:
--------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic
Public Class Class1
Public Declare Auto Function RemoveControlByName Lib "OCCACHE.DLL" Alias
"RemoveControlByName" ( _
ByVal lpszFile As DWORD, _
ByVal lpszCLSID As DWORD, _
ByVal lpszTypeLibID As DWORD, _
ByVal dwIsDistUnit As DWORD _
) As Long
End Class
--------------------------------------------------------------------------------------
For testing, my main form (Load) is:
--------------------------------------------------------------------------------------
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim RetVal As Integer
RetVal = RemoveControlByName("ActiveX Control", "CLSID" , , False,
True)
End
End Sub
End Class
--------------------------------------------------------------------------------------
When the form loads, I want the app to remove an ActiveX control called
"ActiveX Control". However, in the form I am given an error that the
RemoveControlByName statement is not declared. It used to be that I could
declare shared functions in modules attached to the project but I don't see
modules anymore.
Any help would be appreciated,
Thanks,
UCG
since v6 and now I am using VS 2005 and I see a few things have changed (so
please excuse me if I am rusty).
I need to call a Windows API (RemoveControlByName - OCCACHE.DLL). So far, I
have followed http://msdn2.microsoft.com/en-us/library/172wfck9(VS.80).aspx
but keep getting the error "Name RemoveControlByName is not declared".
In VB, I have a CLASS of:
--------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic
Public Class Class1
Public Declare Auto Function RemoveControlByName Lib "OCCACHE.DLL" Alias
"RemoveControlByName" ( _
ByVal lpszFile As DWORD, _
ByVal lpszCLSID As DWORD, _
ByVal lpszTypeLibID As DWORD, _
ByVal dwIsDistUnit As DWORD _
) As Long
End Class
--------------------------------------------------------------------------------------
For testing, my main form (Load) is:
--------------------------------------------------------------------------------------
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim RetVal As Integer
RetVal = RemoveControlByName("ActiveX Control", "CLSID" , , False,
True)
End
End Sub
End Class
--------------------------------------------------------------------------------------
When the form loads, I want the app to remove an ActiveX control called
"ActiveX Control". However, in the form I am given an error that the
RemoveControlByName statement is not declared. It used to be that I could
declare shared functions in modules attached to the project but I don't see
modules anymore.
Any help would be appreciated,
Thanks,
UCG