Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Including Extra Registry Settings when Registering an OCX

Posted on 2003-11-26
4
Medium Priority
?
245 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 750 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

618 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