

limelect
-
Content Count
924 -
Joined
-
Last visited
-
Days Won
1
Posts posted by limelect
-
-
-
@Mahdi Safsafi i would like to elaborate a little.
It all started with this
So dave helped a lot and i have what i needed
But during the use of the tool i had what you fixed.
But then i found that some components i do not show and
this is where the last problem stand
-
@Mahdi Safsafi you are wrong. Unless I did not understand you.
We are talking about components being on the component/Pallet. Once
you register it I should see it inside the package. simple.
I have made along time ago BPL analyzer and more. It scans all the bpl in the Delphi directory
and analyzes them. see the pictures.
Your component is in the bpl.(the package). The program
should be able to read the package simple.
In my case, it does not. Something happens that Delphi did not foresee. Maybe I am wrong.
So now I am looking for a DIFFERENT way to read the packages.
-
I guess you did not understand the situation.
1. I install a new component.
2. it is on the list
3. package full with component
4. Close program Delphi.
5. open Delphi.
6. rerun my program.
7. see component on a pallet
8. package empty
-
---------dockingformpackage.bpl
Empty no component INSIDE
In my case, some installed packages show empty although they have components inside
and that is the problem
and this is the stament
if PackageServices.GetComponentCount(PackageCounter) = 0 then
-
Use my last demo because the old one are not perfect
You will get a list of similar txt
This is an empty package ---------xxxxxx.bpl
-
-
@Kas Ob. I am too professional to leave this point.
After installing and seeing the component I close the Delphi program
and reopen. This is when the package is empty.
P.S I have a new demo with a button to initialize.
The problem is that restart Delphi the packages are empty. !!!
If you want I can put here the source it is 2 more lines.
See my last comment
-
I have created a text file of the components and there
packeges.
Where there is no component in the package see ---------zcontrols_d.bpl
and more.
if PackageServices.GetComponentCount(PackageCounter) = 0 then
s.Add('---------'+PackageServices.PackageNames[PackageCounter]);
But one can see in the component tab the components and also on the pallet
So i am trying to investigate but i am almost at the end.
-
@Mahdi Safsafi and others
Well, I just installed a new component on my D10.2.3, and
after closing the Delphi program and reopening it does not show on
my list !!. Although it is on the pallet.
So it is the Delphi program. !!!!
So now for the questions
1. is there another way to get the component list?
beside PackageServices := BorlandIDEServices as IOTAPackageServices;
and for PackageCounter := 0 to PackageServices.PackageCount - 1 do
2. is there a max quantity for components? I have many.
P.S @Mahdi Safsafi I just installed your ZControl and it too disappeared
-
Oh no not again . Restart Delphi stop showing in the list the component.
I will manege.
-
OK to sum it .
I do not understand the IDE. I recompiled and reinstaled
the component and now it shows on the list. Even it was on the pallet it did not show.
Not my fault.
As for my first problem the @Mahdi Safsafi solution helped a lot. Thanks
-
Sorry for the bother but it mite be me
Thanks for any help
-
I hop i do not bother someone but this buffels me
https://github.com/digao-dalpiaz/Dam
this is not on the list although it is on the pallet
And if this is the case may be some other components too.
procedure GetAllClass; //
var
Coreide: THandle;
Delphicoreide: THandle;
LGlobalPackagesPtr: Pointer;
LDesignPackages: TDesignPackages;
LIDEDesignPackage: TIDEDesignPackage;
LRegModule: TRegModule;
LRegClass: TRegClass;
LIDEDesignPackageCount: Integer;
LRegModuleCount: Integer;
LIndex: Integer;
I: Integer;
J: Integer;
PackageServices: IOTAPackageServices;
PackageCounter: Integer;
s: TStringList;
begin
s := TStringList.Create;
// Result.Clear;
PackageServices := BorlandIDEServices as IOTAPackageServices;
Assert(Assigned(PackageServices));{ --- Move me outside --- }
// adapt 260 suffix according to your Delphi version.
Coreide := GetModuleHandle('coreide250.bpl');
Delphicoreide := GetModuleHandle('delphicoreide250.bpl');
LGlobalPackagesPtr := GetProcAddress(Coreide, '@Pakmgr@Packages');
DesignPackagesGetPackages := GetProcAddress(Coreide,
'@Pakmgr@TDesignPackages@GetPackages$qqri');
IDEDesignPackageGetCount := GetProcAddress(Delphicoreide,
'@Pascpppakmgr@TIDEDesignPackage@GetCount$qqrv');
IDEDesignPackageGetModules := GetProcAddress(Delphicoreide,
'@Pascpppakmgr@TIDEDesignPackage@GetModules$qqri');
RegModuleGetCount := GetProcAddress(Coreide,
'@Pakmgr@TRegModule@GetCount$qqrv');
RegModuleGetClasses := GetProcAddress(Coreide,
'@Pakmgr@TRegModule@GetClasses$qqri');Assert(Assigned(LGlobalPackagesPtr), 'LGlobalPackagesPtr not assigned');
Assert(Assigned(DesignPackagesGetPackages),
'DesignPackagesGetPackages not assigned');
Assert(Assigned(IDEDesignPackageGetCount),
'IDEDesignPackageGetCount not assigned');
Assert(Assigned(IDEDesignPackageGetModules),
'IDEDesignPackageGetModules not assigned');
Assert(Assigned(RegModuleGetCount), 'RegModuleGetCount not assigned');
Assert(Assigned(RegModuleGetClasses), 'RegModuleGetClasses not assigned');
{ --- End Move outside --- }if Assigned(LGlobalPackagesPtr) then
begin
for PackageCounter := 0 to PackageServices.PackageCount - 1 do
begin
if PackageServices.GetComponentCount(PackageCounter) > 0 then
begin
LDesignPackages := TObject(PPointer(LGlobalPackagesPtr)^);
LIDEDesignPackage := DesignPackagesGetPackages(LDesignPackages,
PackageCounter);
LIDEDesignPackageCount := IDEDesignPackageGetCount(LIDEDesignPackage);
LIndex := 0; // Compeginonent Index.for I := 0 to LIDEDesignPackageCount - 1 do
begin
LRegModule := IDEDesignPackageGetModules(LIDEDesignPackage, I);
LRegModuleCount := RegModuleGetCount(LRegModule);
for J := 0 to LRegModuleCount - 1 do
begin
// if LIndex = ComponentIndex then
begin
LRegClass := RegModuleGetClasses(LRegModule, J);
s.Add(TClass(PPointer(PByte(LRegClass) + 4)^).ClassName);
// exit;
end;
Inc(LIndex);
end;
end;
end;
end;
end;
s.SaveToFile('c:\tst.txt');
s.Free;
end;
can some one install and help ?
just add above to my test package and in Initilize just call GetAllClass;
-
-
@Mahdi Safsafi Just for general knowledge why there is a difference between
the getting of the component from the toolbar and from the package.
Since every component is going from a search through the bpl again and again
which is time-consuming.
I guess I can leave most of the initialization outside of GetClass2
but still a lot of iterations.
So again why the difference? in nil
In the package the class is different?
-
Thank i will try yours again
-
I have made a very simple DEMO reading from the component bar (it does not have to show)
In the end, it saves components to a txt file.
Very simple. See how many components are NIL !!!!!
And that is my problem
The same problem with Tool Pallet although there is a discrepancy between the two
-
I am preparing a very simple test
-
First I am using D10.2.3. All "Normal components are read"
But try to install the above component and am i wrong?
Further more try to do if xx<>nil then
qqqqq....
else
<<<< catch here and see
I did catch by InstalledComponentName := PackageServices.ComponentNames[PackageCounter,
ComponentCounter];and lastly I xx := GetClass(InstalledComponentName);
where xx: TPersistentClass;
The class name is not the problem
-
Well, not good news.
I have used your suggestion it does not work in my case.
Well, let me explain.
I am using this guy component.
https://github.com/digao-dalpiaz/Dam
It worked great and I have no complaint BUT it represents a section of
components that reading them from the IDE get nil for classes.
They seem to register OK and show on the pallet and are usable.
So that is the problem.
in your case, I used TPersistentClass(LClass); like that.
Maybe this is the problem.?
Since I have to use TPersistentClass as I am taking an old program
and making it an EXPERT.
So the question is if TPersistentClass is the problem as I am using GetClass or
your Lclass.
Any idea?
Maybe I can tackle my problem differently.
at the end I use this RegisterClasses(MyArray);
where MyArray is TPersistentClass. This is why the above
Hold my question something fishy
Ok I return to my basic question
1. Reading from component toolbar NO DAM
2. Reading from tool pallet YES DAM
in this case still DAM shows nil !!!
DAM can be used from both
Crazy IDE ????
-
I have an expert that gets all the classes from the IDE.
var
xx: TPersistentClass;
xx := GetClass(PackageServices.ComponentNames[PackageCounter,
ComponentCounter]);
some components show xx as nil although they are on the pallet and can be usedi cannot read xx.ClassName for that
Any idea why?
P.S It seems that components from ToolPalette do not have that problem
I just checked it on ToolPalette it has the same problem
xx := GetClass on some names are nil
-
@DanielIt took a while to investigate.
I downloaded the demo Docking form
It has all as per your suggestion.
However
When I dock the form it works. While the IDE is open it works.
Changing a project it works.
BUT closing Delphi d10.2.3 and reopening it did not
save the position (it wasn't docked any more) and I had to redock.
Saving the desktop did not help.
Is it suppose to be like that?
Any suggestion?
Well docking to the right mite work. To the left NO.
Docking to the left and reopening Delphi it docks to the right.
Funny Delphi IDE it docks to the right this is why I thought it dose
not work.
I had to dock twice. dock close dock.
Now it works on the left too. Very unreliable.
-
@Uwe Raabe It mite work thanks xx:TPersistentClass;
xx:=GetClass(PackageServices.ComponentNames[PackageCounter,
ComponentCounter]);
Some components show class =nil
in Delphi IDE and APIs
Posted
@Mahdi Safsafi
Reading your comment again a question.
If a component is on the pallet it is loaded, right?