Click here to Skip to main content
15,900,725 members
Home / Discussions / C#
   

C#

 
GeneralCombobox: leaving on enter-key Pin
Nachte8-Jan-03 2:41
Nachte8-Jan-03 2:41 
GeneralRe: Combobox: leaving on enter-key Pin
mikasa8-Jan-03 2:57
mikasa8-Jan-03 2:57 
GeneralBrowser Helper Object Pin
Boris Yankov7-Jan-03 16:12
Boris Yankov7-Jan-03 16:12 
GeneralWindows XP fast user switching Pin
Alex Korchemniy7-Jan-03 13:51
Alex Korchemniy7-Jan-03 13:51 
GeneralString formatting Pin
Le centriste7-Jan-03 9:38
Le centriste7-Jan-03 9:38 
GeneralRe: String formatting Pin
leppie7-Jan-03 9:51
leppie7-Jan-03 9:51 
GeneralRe: String formatting Pin
Le centriste7-Jan-03 11:14
Le centriste7-Jan-03 11:14 
GeneralRe: String formatting Pin
John Burton8-Jan-03 4:26
John Burton8-Jan-03 4:26 
GeneralRe: String formatting Pin
leppie8-Jan-03 6:12
leppie8-Jan-03 6:12 
GeneralHICON's .NET Equivilent Pin
Nnamdi Onyeyiri7-Jan-03 6:29
Nnamdi Onyeyiri7-Jan-03 6:29 
GeneralRe: HICON's .NET Equivilent Pin
leppie7-Jan-03 7:49
leppie7-Jan-03 7:49 
Generala tree copying Pin
misiek7-Jan-03 6:06
misiek7-Jan-03 6:06 
GeneralRe: a tree copying Pin
leppie7-Jan-03 8:30
leppie7-Jan-03 8:30 
GeneralRe: a tree copying Pin
misiek7-Jan-03 22:33
misiek7-Jan-03 22:33 
GeneralRich Text Box Edit Cursor Pin
KenBloke7-Jan-03 5:35
KenBloke7-Jan-03 5:35 
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 
This is what I ended up doing but I had hoped someone could tell me why the following Code will not work!? I had code to do this and it works great in VB6! However, for some reason, .NET cannot get the "Address" of the Entry point for "DllRegisterServer" in my DLL (even though I know it is there)...it ALWAYS Returns "0". I will not know the name of the DLL ahead of time, so although I like your idea, it won't work in this situation.

Below is my code, taken from the API Guide example. The MSDN Help shows a different example (do a Search on "Register") of the Source Code of "Regsvr32.exe" but that does not work either, instead it just GPFs on me. However, even that code works in VB6.

Sorry for the VB references but it is what I had before and I am trying to convert it to C#.

'Declarations
Private Declare Auto Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Integer) As Integer
Private Declare Ansi Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Integer
Private Declare Auto Function GetProcAddress Lib "kernel32" (ByVal hModule As Integer, ByVal lpProcName As String) As IntPtr
Private Declare Ansi Function CallWindowProc Lib "user32" 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 Sub RegisterFile(ByVal File As String)
Dim hLib, hResult As Integer
Dim hAddress As IntPtr

hLib = Me.LoadLibrary(_Path)
hAddress = Me.GetProcAddress(hLib, "DllRegisterServer")
hResult = Me.CallWindowProc(hAddress, 0, 0, 0, 0)
hResult = Me.FreeLibrary(hLib)
End Sub
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 
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 

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.