Solved

using RegisterPropertyInCategory

Posted on 2003-11-13
10
352 Views
Last Modified: 2008-03-17
hi all,

i would like to create properties in a category in component i created. but fails.

i am going to create some properties in category "LogType". but fails. but nothing is changed evn i have compile so many times. Are there steps i am missing thx

i am using D7 in win2000

below is code segment.. pls advise....

uses
  SysUtils,
  Classes,
  DesignIntf;

procedure Register;

procedure Register;
begin
  RegisterPropertyInCategory('LogType', TXYZLog, 'Debug Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Error Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Warn Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Info Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Audit Log');
  RegisterComponents('XYZ', [TXYZLog]);
end;
0
Comment
Question by:lamtl354
  • 4
  • 2
  • 2
10 Comments
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 25 total points
ID: 9745472
I do not know anything about it, but i would do the RegisterComponents first.
If this does not help i will have a look at the JediVCL to see how it is handled there.
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9745876
Yes robert_marquardt is right....If you dont register the component first how do the RegisterPropertyInCategory assign the property to the component?

change it to

 Question Title: using RegisterPropertyInCategory
Author: lamtl354
Points: 50
Date: 11/14/2003 05:11AM CET
 


hi all,

i would like to create properties in a category in component i created. but fails.

i am going to create some properties in category "LogType". but fails. but nothing is changed evn i have compile so many times. Are there steps i am missing thx

i am using D7 in win2000

below is code segment.. pls advise....

uses
  SysUtils,
  Classes,
  DesignIntf;

procedure Register;

procedure Register;
begin
  RegisterComponents('XYZ', [TXYZLog]);
  RegisterPropertyInCategory('LogType', TXYZLog, 'Debug Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Error Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Warn Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Info Log');
  RegisterPropertyInCategory('LogType', TXYZLog, 'Audit Log');
end;  

Don't accept this comment as an answer: it's jus an addition to the above

F68 ;-)
 

0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9745880
Sorry....pasted too much lines :)))
0
 

Author Comment

by:lamtl354
ID: 9760708
i code like this in the very beginning,

RegisterComponents('XXX', [TXXXLog]);
RegisterPropertyInCategory('LogType', TXXXLog, 'DebugLog');

but not work. so i revese th order to see whether it works or not.
btw, other propoerty such as boolean text works fine.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 11

Expert Comment

by:robert_marquardt
ID: 9761589
Try RegisterPropertiesInCategory.
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9762244
it seems that you've note declared the type for LogType....try this solution:

interface

uses
  DsgnIntf, Classes;

type
  TLogType = class (TPropertyCategory)
    class function Name: string; override;
    class function Description: string; override;
  end;

procedure Register;

implementation

class function TLogType.Name: string;
begin
  Result:= 'CategoryName';
end;

class function TLogType.Description: string;
begin
  Result := 'CategoryDescription;
end;

procedure Register;
begin
  RegisterComponents('XXX', [TXXXLog]);
  RegisterPropertyInCategory(TLogType, TXXXLog, 'DebugLog');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Error Log');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Warn Log');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Info Log');
  RegisterPropertyInCategory(TLogType, TXXXLog, 'Audit Log');
end;

If this work this post should be accepted as an answer:)))

F68 ;-)

0
 

Author Comment

by:lamtl354
ID: 9776946
it's not work
0
 
LVL 22

Assisted Solution

by:Ferruccio Accalai
Ferruccio Accalai earned 25 total points
ID: 9777131
RegisterPropertiesInCategory(TLogType, TXXXLog,
                                [ DebugLog', 'Error Log', 'Warn Log', Info Log', 'Audit Log'] );

BTW maybe there's some wrong code in your source files....send me your whole code by email (ferruccio@afsoftware.it) and i'll look into it....

F68 ;-)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now