Click here to Skip to main content
15,891,375 members
Home / Discussions / C#
   

C#

 
GeneralRegistering an ActiveX DLL or OCX Pin
mikasa7-Jan-03 5:12
mikasa7-Jan-03 5:12 
GeneralRe: Registering an ActiveX DLL or OCX Pin
Richard Deeming8-Jan-03 2:40
mveRichard Deeming8-Jan-03 2:40 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 2:52
mikasa8-Jan-03 2:52 
GeneralRe: Registering an ActiveX DLL or OCX Pin
Richard Deeming8-Jan-03 3:12
mveRichard Deeming8-Jan-03 3:12 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 3:43
mikasa8-Jan-03 3:43 
GeneralRe: Registering an ActiveX DLL or OCX Pin
Stephane Rodriguez.8-Jan-03 3:14
Stephane Rodriguez.8-Jan-03 3:14 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 3:20
mikasa8-Jan-03 3:20 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 4:11
mikasa8-Jan-03 4:11 
Well, I've tried it all and it still doesn't work!

The "GetProcAddress" still returns "0" as if it's not even recognizing that there is a function called "DllRegisterServer" which is impossible because if I open the DLL using WordPad I can find that exact text in there.

Here's what I've got so far:

'API Declarations
Private Declare Auto Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As IntPtr) As Integer
Private Declare Ansi Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As IntPtr
<DllImport("kernel32.dll", EntryPoint:="GetProcAddress", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.Cdecl)> _
Private Function GetProcAddress2(ByVal hModule As IntPtr, ByVal lpProcName As String) As IntPtr
End Function
Private Declare Auto Function GetProcAddress Lib "kernel32.dll" (ByVal hModule As IntPtr, ByVal lpProcName As String) As IntPtr
Private Declare Ansi Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA" (ByVal PrevWndFunc As IntPtr, ByVal hWnd As Integer, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer

Public Function Register() As Boolean
Dim hResult As Integer
Dim hLib, hAddress As IntPtr

hLib = Me.LoadLibrary(_Path)
If (hLib.Equals(IntPtr.Zero)) Then Return False 'Failed to Load the Library

Try
'Get the Address of the DllRegisterServer Function
hAddress = Me.GetProcAddress2(hLib, "DllRegisterServer")
If (hAddress.Equals(IntPtr.Zero)) Then Exit Try

'Execute the Function
hResult = CallWindowProc(hAddress, 0, 0, 0, 0)
Catch
Finally
'Free the Library
hResult = FreeLibrary(hLib)
End Try
End Function


Any ideas?
GeneralActive Directory - Change and Adding users Pin
Mauricio Ritter7-Jan-03 1:12
Mauricio Ritter7-Jan-03 1:12 
GeneralRe: Active Directory - Change and Adding users Pin
Mazdak8-Jan-03 7:20
Mazdak8-Jan-03 7:20 
GeneralRe: Active Directory - Change and Adding users Pin
Mauricio Ritter8-Jan-03 7:21
Mauricio Ritter8-Jan-03 7:21 
QuestionHow can build an exe file by VS .NET to execute it on Windows_98? Pin
Behzad Ebrahimi7-Jan-03 0:15
Behzad Ebrahimi7-Jan-03 0:15 
AnswerRe: How can build an exe file by VS .NET to execute it on Windows_98? Pin
Heath Stewart7-Jan-03 3:25
protectorHeath Stewart7-Jan-03 3:25 
GeneralComboBox & Dataset with huge data Pin
jpeg6-Jan-03 23:19
jpeg6-Jan-03 23:19 
GeneralRegister a C# dll in Excel Pin
Donald Blachly6-Jan-03 19:41
Donald Blachly6-Jan-03 19:41 
GeneralObfuscation (or "what MS forgot") Pin
Bog6-Jan-03 19:15
Bog6-Jan-03 19:15 
GeneralRe: Obfuscation (or "what MS forgot") Pin
Wesner Moise6-Jan-03 19:27
Wesner Moise6-Jan-03 19:27 
GeneralRe: Obfuscation (or "what MS forgot") Pin
Victor Vogelpoel7-Jan-03 0:16
Victor Vogelpoel7-Jan-03 0:16 
GeneralRe: Obfuscation (or "what MS forgot") Pin
leppie7-Jan-03 6:06
leppie7-Jan-03 6:06 
GeneralRe: Obfuscation (or "what MS forgot") Pin
Victor Vogelpoel7-Jan-03 11:29
Victor Vogelpoel7-Jan-03 11:29 
QuestionGetting to the raw Socket from an HttpRequest? Pin
Chris Hansson6-Jan-03 17:15
Chris Hansson6-Jan-03 17:15 
AnswerRe: Getting to the raw Socket from an HttpRequest? Pin
Stephane Rodriguez.6-Jan-03 19:19
Stephane Rodriguez.6-Jan-03 19:19 
Questionhow to move the position of selected item in a listbox? Pin
fretre6-Jan-03 15:17
fretre6-Jan-03 15:17 
Generalclock function help Pin
jtmtv186-Jan-03 15:15
jtmtv186-Jan-03 15:15 
QuestionRecursive limit? Pin
leppie6-Jan-03 11:44
leppie6-Jan-03 11:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.