I have a unit wich defines TBla and the following code in the initialize section:
initialization
RegisterClass(TBla);
showMessage('registered');
This unit is inside a package. ok.
In a button click on my app I have the following code:
LoadPackage('C:\temp\testes_packs\pack1\Package1.bpl');
pc := GetClass('TBla');
if pc = nil then
ShowMessage('didnt work');
When I click the button the 'registered' message shows up. But, 'didnt work' shows too. Which indicates that the initialization wass called but the register class for some reason didn't work.
Ok, to prove that the LoadPackage was the problem, I included my unit (that contains TBla class) directly into my project and removed the loadPackage line and, tada the 'registered' message shows and the getClass works.
Any ideas?