Solved

Including Extra Registry Settings when Registering an OCX

Posted on 2003-11-26
4
241 Views
Last Modified: 2010-04-05
I have made an OCX, and I need it to include extra registry settings when the OCX is registered.

For example

This is the default when I register my OCX:

[OCX.NAME]
  [CLSID]
    (Default) = {A408E0E2-B087-4EF7-8B46-34AE6B3C71D4}

This is what I want it to be after registation

[OCX.NAME]
  [CLSID]
    (Default) = {A408E0E2-B087-4EF7-8B46-34AE6B3C71D4}
  [shell]
    [open]
      [command]
        (default) = "iexplore.exe" "%1"

I also need to add entries under the MIME/Content Type key.

I'm not looking for a solution that updates the registry when the OCX is opened/loaded as there will permission issues.




 
0
Comment
Question by:StayGreedy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
DeerBear earned 250 total points
ID: 9824561
Hi,

I stated some time ago in this site how to do it.
Have a look at the COM demos, there's an UpdateRegistry method
somewhere <g>( I don't remember *where*, but I'm sure there's one :-) ),
that you can override and integrate to add your registry settings.

HTH,

Andrew
0
 
LVL 1

Author Comment

by:StayGreedy
ID: 9873820
After a lot of hard work, I final solved my problem

For any of you out there that may need this:

Unit MyActiveForm

...

Implementation

type
  TmyActiveFormFactory= class(TActiveFormFactory)
  public
    procedure UpdateRegistry(Register: Boolean); override;
  end; //}

procedure TmyActiveFormFactory.UpdateRegistry(Register: Boolean);
begin
  if Register then
  begin
    inherited UpdateRegistry(Register);
    with TRegistry.Create do
    try
      // Add my Registry Setting
    finally
      Free;
    end;
  end
  else
  begin
    with TRegistry.Create do
    try
      // Remove my Registry Setting
    finally
      Free;
    end;
    inherited UpdateRegistry(Register);
  end;
end;

...

initialization
  TmyActiveFormFactory.Create(
    ComServer,
    TActiveFormControl,
    TSimpleTiffViewer,
    Class_SimpleTiffViewer,
    1,
    '',
    OLEMISC_SIMPLEFRAME or OLEMISC_ACTSLIKELABEL, tmApartment);
end.


0
 
LVL 5

Expert Comment

by:DeerBear
ID: 9873914
Hi,

I told you there was UpdateRegistry :-)

Yet, I'm wondering what "hard work" was necessary since you may
have found it on the help file( which I hadn't available ) very quickly.

Andrew
0
 
LVL 1

Author Comment

by:StayGreedy
ID: 9876007
The examples you pointed me to are for COM not for ActiveForms, and as I am new to ActiveX programming, it took me lots of trial and error to get it to work.

However, I am extremely grateful for you pointing me in the right direction.

Cheers.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question