Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dllregisterserver doing what it can in C++

Status
Not open for further replies.

Horrid

Programmer
May 20, 1999
373
Does anyone know how to get the dllregisterserver command to allow for custom registry entries to be added when a dll is registered like it does in C++?
Failing that what is an easy way to make entries into the registry from a web installer?

Thanks
 
My solution was to put a AddReg command in the setup.inf in the cab file. Made the cab with package and deployment wizard, edited it with a zip package called ZipWrangler.

here is the demo code from MSDN
[DefaultInstall]
AddReg = RegSettings
[Strings]
reg_path = Software\Company\AppName

[RegSettings]
HKLM,%reg_path%,,0x00000000,alpha ; <default> = &quot;alpha&quot;
HKLM,%reg_path%,test,0x00010001,3 ; Test = 3
HKLM,%reg_path%\new,another,0x00010001,6; New\another = 6
 
Code:
Attribute VB_Name = &quot;Module1&quot;
'How to register and un-register ActiveX Controls

'This tip describes how ActiveX controls can be registered and unregistered directly
'from Visual Basic. Every ActiveX control contains two functions that can be called that
'will instruct the OCX to either register or un-register itself with the system. These
'functions are DLLRegisterServer and DLLUnregisterServer. The following tip demonstrates
'how to register and un-register the Microsoft Common Controls OCX, ComCtl32.OCX.

'Declarations

'Copy the following code into the declarations section of your projects.

Declare Function RegComCtl32 Lib &quot;ComCtl32.OCX&quot; _
Alias &quot;DllRegisterServer&quot; () As Long
Declare Function UnRegComCtl32 Lib &quot;ComCtl32.OCX&quot; _
Alias &quot;DllUnregisterServer&quot; () As Long
Const ERROR_SUCCESS = &H0

'Code

'To register the Microsoft Common Controls, use this code:

If RegComCtl32 = ERROR_SUCCESS Then
    MsgBox &quot;Registration Successful&quot;
Else
    MsgBox &quot;Registration Unsuccessful&quot;
End If

If UnRegComCtl32 = ERROR_SUCCESS Then
    MsgBox &quot;UnRegistration Successful&quot;
Else
    MsgBox &quot;UnRegistration Unsuccessful&quot;
End If
'Note: Each DLL function call may take up to 5 seconds.
bluenote@uyuyuy.com
(excuse my english)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top