Solved

Properties don't work when I import ActiveForm into Delphi as ActiveX

Posted on 2001-07-02
11
325 Views
Last Modified: 2010-05-18
Please tell me what I am doing wrong!

I am attempting to create some general purpose ActiveX controls, using Delphi ActiveForms.

I add lots of properties and events, and they appear correctly when I use them inside VB, IE etc.

However, when I import one as an ActiveX control to use in Delphi itself (I know you wouldn't normally do that), the properties appear in the object inspector list ok, but are not saved when the form is saved. (i.e. all of the published properties in the _TLB file have "stored false" next to them). Oddly, the assigned events get saved ok.

This means that the poor delphi programmer has to programmatically set the properties before he can use my ActiveX control.

I give lots of points for this, because I just need someone to try doing the same thing to see if they can make it work, or if Delphi is just being rubbish in not supporting its own standard.

I know I could create my controls as VCL components, convert to ActiveX and then publish both .ocx and .bpl versions of my controls.

But I don't want to do this because:
a) ActiveForms are much easier and quicker for me to create
b) I don't want to publish two different versions of my software, depending on the platform.

Any help most appreciated.
0
Comment
Question by:JLANE
  • 3
  • 2
  • 2
  • +4
11 Comments
 
LVL 6

Expert Comment

by:edey
ID: 6245481
Following

GL
Mike
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 6245549
Why are the properties set to "stored false"? As far as I undertant it, it tells Delphi not to safe these properties to disk. So it would make perfect sense why you can see and modify them but they are not saved. I think the solution will lie somewhere in the declaration of your ActiveX control.
0
 

Author Comment

by:JLANE
ID: 6249251
AvonWyss:
If I knew why I get "stored false" my problem would be solved!

This is the information that I seek: how do I configure my ActiveX control such that when it is imported into Delphi I get "stored true" instead of "stored false" next to all of my properties.


0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 14

Expert Comment

by:AvonWyss
ID: 6249393
Open then Delphi Help Index, and enter: "ActiveX-Controls", scroll down until you get something like "Declaring properties as published", and open this page (since I have an international version of Delphi, I don't know the exact terms used). Therte are some explanations regarding the nonpersitance. However, I'm not sure it's going to help you, but who knows; check it out.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6261806
You need to implement the IPersistPropertyBag methods. Search on Google for 'Delphi IPersistPropertyBag'.
0
 

Author Comment

by:JLANE
ID: 6265023
Epsylon:
Thanks for the reply.

I tried to implement IPersistPropertyBag as you suggested. I did everything in the examples, but it needed to me to implement "GetClassId" which wasn't described anywhere.
I implemented it as follows:

function TMyControlX.GetClassId(out classID: TCLSID): HResult;
begin
  classID := ActiveFormControl.Factory.ClassID;
  Result := S_OK;
end;

My control still does not persist in Delphi.

As I was looking through the VCL source, I noticed that TActiveForm.ActiveFormControl already implements IPersistPropertyBag. It enumerates through all of the controls in the form saving and loading them (as you might expect).

When looking through the net, it seemed to me that the orriginal problem was in Delphi 3 and subsequently resolved with a patch. I'm using Delphi 5 so I'm not sure that your advice is correct.

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6265089
First I have to tell that I have never done it...

As far as I know TActiveForm.ActiveFormControl only takes care of the default properties, events, etc. Not the custom ones.
0
 

Author Comment

by:JLANE
ID: 6265170

Yes, it is odd the way it remembers all of the events but not the custom properties.





0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 6932044
Hopefully you've already been helped with this question, but thought you'd appreciate knowing this.  It would be great if you could bring this question to a conclusion, awarding the experts above who helped you with points or a comment to them on your status today.

WindowsUpdate has new updates for .NET users; Details follow - Microsoft .NET Framework
The .NET Framework is a new feature of Windows. Applications built using the .NET Framework are more reliable and secure. You need to install the .NET Framework only if you have software that requires it.

For more information about the .NET Framework, see http://www.microsoft.com/net. (This site is in English.)

System Requirements
The .NET Framework can be installed on the following operating systems:
Windows 98
Windows 98 Second Edition (SE)
Windows Millennium Edition (Windows Me)
Windows NT 4.0® (Workstation or Server) with Service Pack 6.0a
Windows 2000 with the latest service pack installed (Professional, Server, Datacenter Server, or Advanced Server)
Windows XP (Home Edition and Professional)
You must be running Internet Explorer version 5.01 or later for all installations of the .NET Framework.

To install the .NET Framework, your computer must meet or exceed the following software and hardware requirements:

Software requirements for server operating systems:
MDAC 2.6
Hardware requirements:
For computers running only a .NET Framework application, Pentium 90 mHz CPU with 32 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 mHz CPU with 128 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
Recomended software:
MDAC 2.7 is recommended.
Recommended hardware: For computers running only a .NET Framework application, Pentium 90 MHz CPU with 96 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 MHz CPU with 256 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.

How to use -> Restart your computer to complete the installation. No other action is required to run .NET Framework applications. If you are developing applications using the .NET Framework, you can use the command-line compilers or you can use a development environment, such as Visual Studio .NET, that supports using the .NET Framework.

How to uninstall
To uninstall the .NET Framework: Click Start, point to Settings, and then click Control Panel (In Windows XP, click Start and then click Control Panel.).
Click Add/Remove Programs.
Click Microsoft .NET Framework (English) v1.0.3705 and then click Change/Remove.
More here  http://www.microsoft.com/net/

The .NET topic is being considered for addition to our All Topics link soon, so this may interest you as well:
http://www.experts-exchange.com/newtopics/Q.20276589.html

EXPERTS POINTS are waiting to be claimed here:  http://www.experts-exchange.com/commspt/Q.20277028.html

":0)
Asta


0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8701520
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To be PAQ/Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 8816874
PAQ'ed and points not refunded,

PashaMod
Community Support Moderator @Experts Exchange
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 131
Reconfigure Delphi Install? 2 51
Press three keys together and trigger a function 3 56
FMX and jaudiotracker playing memory stream 29 79
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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