Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I add an icon to an ActiveX control in Delphi?

Posted on 2001-07-03
5
Medium Priority
?
287 Views
Last Modified: 2010-04-06

Should be easy for someone who knows:

How do I change the icon image for an ActiveX control that I am trying to build in Delphi 5?

By default it comes up as those funny 3d shapes.

I know how to do it when creating custom VCL components (ie you create the .dcr file using image editor), but it doesn't seem to work on ActiveX components.

0
Comment
Question by:JLANE
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 6249394
- Start Delphi's image editor.
- Create a new dcr-file.
- Add a new 24x24 Bitmap to the content.
- The name should be like TMyActiveX
- Edit the image
- Save it with the same name as the .pas file except that it must be .dcr now.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6249415
Forget the above. When you import the ActiveX Control into delphi, the .dcr file is created automatically in the imports directory. Just edit that one.

(Delphi 5)
0
 

Author Comment

by:JLANE
ID: 6249481
Epsylon:
I don't really want to ask all of my customers to edit the icon every time they import my activex control! Anyway, this doesn't work for VB users etc.

There must be a simple way to change the icon that is compiled into the .ocx file.
0
 
LVL 17

Accepted Solution

by:
inthe earned 900 total points
ID: 6249965
edit the bitmap from the .res file and rebuild the project to get the new icon in your activex ready for deployment.

1. Open you ActiveX projects .res file ( Your projectname.res in the same
dir as  your project ) in the image editor.
2. Edit the Bitmap 1 to your image.
3. Close the Bitmap editor.
4. Save  the Res File and exit.
5. Open your ActiveX project and then do a Build All.
6. Remove the ActiveX control from the associated package file and compile
the package file. You should then get a message saying "This control is no
longer registered.. ".
7. Import the ActiveX Control back into the package and recompile the
package. You should then get a message indicating a new control has been
registerd.
0
 

Author Comment

by:JLANE
ID: 6251715
Don't know why it didn't work the first 10 times I tried.

Maybe the Build All...

0

Featured Post

Technology Partners: 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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

885 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