ozwombat
asked on
Writing simple component - gives "Class not found" error
Hi,
Trying to write a verysimple component. I want to have a panel within a panel.
So my derived T..Panel creates a "sub panel" when it is created and sets its parent to be the original panel.
Seems to work ok at design time, I can drop it onto a form and it looks ok.
But when I build and run a test app it crashes with "TPanel" class not found?
Trying to write a verysimple component. I want to have a panel within a panel.
So my derived T..Panel creates a "sub panel" when it is created and sets its parent to be the original panel.
Seems to work ok at design time, I can drop it onto a form and it looks ok.
But when I build and run a test app it crashes with "TPanel" class not found?
uses
SysUtils, Classes, Controls, ExtCtrls;
type
TsExpandPanel = class(TPanel)
private
{ Private declarations }
FSubPanel : TPanel;
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
end;
procedure Register;
implementation
constructor TsExpandPanel.Create(AOwner: TComponent);
begin
inherited;
FSubPanel := TPanel.Create( Self.Owner );
if Assigned( FSubPanel ) then
begin
FSubPanel.Parent := Self;
FSubPanel.Left := 0;
FSubPanel.Top := 0;
FSubPanel.Height := Height div 2;
FSubPanel.Width := Width;
end;
end;
destructor TsExpandPanel.Destroy;
begin
if ( Assigned( FSubPanel ) ) then
begin
FreeAndNil( FSubPanel );
end;
inherited;
end;
procedure Register;
begin
RegisterComponents('Test', [TsExpandPanel]);
end;
end.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks rtwoolf.
Im using BDS 2006. I wanted the "sub" panel to be owned by the form, hence the "self.owner".
When I tried it again this morning it ran without error. Must be either a delphi glitch or i need to close and reopen the bds to get it to link properly (ie a delphi glitch :) I think it is a link error as when it was faulting I found that if i dropped a plain TPanel on the app as well as the TExpandPanel then it ran fine.
Im using BDS 2006. I wanted the "sub" panel to be owned by the form, hence the "self.owner".
When I tried it again this morning it ran without error. Must be either a delphi glitch or i need to close and reopen the bds to get it to link properly (ie a delphi glitch :) I think it is a link error as when it was faulting I found that if i dropped a plain TPanel on the app as well as the TExpandPanel then it ran fine.
ASKER
Ahh...
Spoke too soon. It worked only because I forgot I had pulled out the sub-panel last night.
This is the debug trace of the error. But I really think it is a link error. The test app has nothing but the expandpanel - and it fails. If I add a TPanel to the test app, it works. Maybe I need to switch to newer Delphi?
This is the code of the failing test app.
++++++++++++++++++++++++++ ++++++++++ ++
unit Unit70;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, sExpandPanel;
type
TForm70 = class(TForm)
sExpandPanel1: TsExpandPanel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form70: TForm70;
implementation
{$R *.dfm}
end.
+++++++++++++++++++++
this is the code of a working test app
++++++++++++++++++++++
unit Unit70;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, sExpandPanel;
type
TForm70 = class(TForm)
sExpandPanel1: TsExpandPanel;
Panel1: TPanel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form70: TForm70;
implementation
{$R *.dfm}
end.
++++++++++++++++++++++
EurekaLog 6.0.17
Application:
-------------------------- ---------- ---------- --------
1.1 Start Date : Mon, 4 May 2009 12:49:15 +1000
1.2 Name/Description: Project69.exe
1.3 Version Number :
1.4 Parameters :
1.5 Compilation Date: Mon, 4 May 2009 12:49:13 +1000
1.6 Up Time : 0 second
Exception:
-------------------------- ---------- ---------- ------
2.1 Date : Mon, 4 May 2009 12:49:15 +1000
2.2 Address : 0041989D
2.3 Module Name : Project69.exe
2.4 Module Version:
2.5 Type : EClassNotFound
2.6 Message : Class TPanel not found.
2.7 ID : 8585
2.8 Count : 1
2.9 Status : New
2.10 Note :
User:
-------------------------- ---------- ---------- ---------
3.1 ID : Jack
3.2 Name : jack
3.3 Email :
3.4 Company : home
3.5 Privileges: SeChangeNotifyPrivilege - ON
SeSecurityPrivilege - OFF
SeBackupPrivilege - OFF
SeRestorePrivilege - OFF
SeSystemtimePrivilege - OFF
SeShutdownPrivilege - OFF
SeRemoteShutdownPrivilege - OFF
SeTakeOwnershipPrivilege - OFF
SeDebugPrivilege - OFF
SeSystemEnvironmentPrivile ge - OFF
SeSystemProfilePrivilege - OFF
SeProfileSingleProcessPriv ilege - OFF
SeIncreaseBasePriorityPriv ilege - OFF
SeLoadDriverPrivilege - ON
SeCreatePagefilePrivilege - OFF
SeIncreaseQuotaPrivilege - OFF
SeUndockPrivilege - ON
SeManageVolumePrivilege - OFF
SeImpersonatePrivilege - ON
SeCreateGlobalPrivilege - ON
SeTcbPrivilege - OFF
Active Controls:
-------------------------- --------
4.1 Form Class : Shell_TrayWnd
4.2 Form Text :
4.3 Control Class:
4.4 Control Text :
Computer:
-------------------------- ---------- ---------- ---------- ---------- ----
5.1 Name : DEVMAN
5.2 Total Memory : 1047 Mb
5.3 Free Memory : 557 Mb
5.4 Total Disk : 20 Gb
5.5 Free Disk : 3.7 Gb
5.6 System Up Time: 12 hours, 14 minutes, 7 seconds
5.7 Processor : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
5.8 Display Mode : 1676 x 926, 32 bit
5.9 Display DPI : 96
5.10 Video Card : VMware SVGA II (driver 11.4.3.1 - RAM 21 MB)
5.11 Printer : Polestar Virtual Printer (driver 6.0.6001.22116)
Operating System:
-------------------------- ----------
6.1 Type : Microsoft Windows XP
6.2 Build # : 2600
6.3 Update : Service Pack 3
6.4 Language: English
6.5 Charset : 0
Network:
-------------------------- -------
7.1 IP Address: 010.010.010.004
7.2 Submask : 255.255.255.000
7.3 Gateway : 010.010.010.001
7.4 DNS 1 : 010.010.010.001
7.5 DNS 2 : 000.000.000.000
7.6 DHCP : ON
Call Stack Information:
-------------------------- ---------- ---------- ---------- ---------- -------
|Address |Module |Unit |Class|Procedure/Method |Line |
-------------------------- ---------- ---------- ---------- ---------- -------
|Running Thread: ID=3288; Priority=0; Class=; [Main] |
|------------------------- ---------- ---------- ---------- ---------- ------|
|7E429E5A|USER32.dll | | |IsWindowVisible | |
|7E429E66|USER32.dll | | |IsWindowVisible | |
|7C90D988|ntdll.dll | | |NtQueryVirtualMemory | |
|7C80BA57|kernel32.dll | | |VirtualQueryEx | |
|7C80BA40|kernel32.dll | | |VirtualQueryEx | |
|7C80BA81|kernel32.dll | | |VirtualQuery | |
|774FF066|ole32.dll | | |CoInitializeEx | |
|00543FDF|Project69.exe|Pr oject69.dp r| | |12[2]|
|7C90DCB8|ntdll.dll | | |ZwSetInformationThread| |
-------------------------- ---------- ---------- ---------- ---------- -------
Modules Information:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
|Handle |Name |Description |Version |Size |Modified |Path |
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
|00400000|Project69.exe | | |1554432|2009-05-04 12:49:14|C:\Documents and Settings\Jack\My Documents\Borland Studio Projects |
|01560000|TortoiseSVN.dll |TortoiseSVN shell extension client |1.5.3.13783 |749568 |2008-08-30 22:02:40|C:\Program Files\TortoiseSVN\bin |
|01630000|Normaliz.dll |Unicode Normalization DLL |6.0.5441.0 |23552 |2006-06-29 08:05:44|C:\WINDOWS\system 32 |
|05940000|TortoiseStub.dll |TortoiseSVN shell extension client |1.5.3.13783 |44032 |2008-08-30 22:01:06|C:\Program Files\TortoiseSVN\bin |
|05960000|TortoiseOverlays .dll|Torto iseSVN overlay handler shim |1.0.4.11886 |80384 |2008-01-16 17:52:50|C:\Program Files\Common Files\TortoiseOverlays |
|10000000|intl3_tsvn.dll |LGPLed libintl for Windows NT/2000/XP and Windows 95/98/ME|0.14.4.0 |57856 |2008-08-30 21:03:20|C:\Program Files\TortoiseSVN\bin |
|5AD70000|uxtheme.dll |Microsoft UxTheme Library |6.0.2900.5512 |218624 |2008-04-25 19:41:40|C:\WINDOWS\system 32 |
|5D090000|comctl32.dll |Common Controls Library |5.82.2900.5512 |617472 |2008-04-14 10:11:52|C:\WINDOWS\system 32 |
|6EE60000|libaprutil_tsvn. dll |Apache Portable Runtime Library |1.2.12.0 |157184 |2008-08-30 21:56:44|C:\Program Files\TortoiseSVN\bin |
|6EEC0000|libapr_tsvn.dll |Apache Portable Runtime Library |1.2.12.0 |118272 |2008-08-30 21:56:32|C:\Program Files\TortoiseSVN\bin |
|71A50000|MSWSOCK.dll |Microsoft Windows Sockets 2.0 Service Provider |5.1.2600.5625 |245248 |2008-06-21 03:46:58|C:\WINDOWS\system 32 |
|71AA0000|WS2HELP.dll |Windows Socket 2.0 Helper for Windows NT |5.1.2600.5512 |19968 |2008-04-14 10:12:10|C:\WINDOWS\system 32 |
|71AB0000|WS2_32.dll |Windows Socket 2.0 32-Bit DLL |5.1.2600.5512 |82432 |2008-04-14 10:12:10|C:\WINDOWS\system 32 |
|71AD0000|wsock32.dll |Windows Socket 32-Bit DLL |5.1.2600.5512 |22528 |2008-04-14 10:12:10|C:\WINDOWS\system 32 |
|73000000|winspool.drv |Windows Spooler Driver |5.1.2600.5512 |146432 |2008-04-14 10:12:46|C:\WINDOWS\system 32 |
|74720000|MSCTF.dll |MSCTF Server DLL |5.1.2600.5512 |297984 |2008-04-14 10:11:58|C:\WINDOWS\system 32 |
|755C0000|msctfime.ime |Microsoft Text Frame Work Service IME |5.1.2600.5512 |177152 |2008-04-14 10:10:06|C:\WINDOWS\system 32 |
|76380000|msimg32.dll |GDIEXT Client DLL |5.1.2600.5512 |4608 |2008-04-14 10:12:00|C:\WINDOWS\system 32 |
|76390000|IMM32.DLL |Windows XP IMM32 API Client DLL |5.1.2600.5512 |110080 |2008-04-14 10:11:54|C:\WINDOWS\system 32 |
|76600000|CSCDLL.dll |Offline Network Agent |5.1.2600.5512 |101888 |2008-04-14 10:11:52|C:\WINDOWS\System 32 |
|76780000|SHFOLDER.dll |Shell Folder Service |6.0.2900.5512 |25088 |2008-04-14 10:12:06|C:\WINDOWS\system 32 |
|76BF0000|PSAPI.DLL |Process Status Helper |5.1.2600.5512 |23040 |2008-04-14 10:12:04|C:\WINDOWS\system 32 |
|76F60000|WLDAP32.dll |Win32 LDAP API DLL |5.1.2600.5512 |172032 |2008-04-14 10:12:10|C:\WINDOWS\system 32 |
|76FD0000|CLBCATQ.DLL | |2001.12.4414.700|498688 |2008-04-14 10:11:50|C:\WINDOWS\system 32 |
|77050000|COMRes.dll | |2001.12.4414.700|792064 |2008-04-14 10:11:52|C:\WINDOWS\system 32 |
|77120000|oleaut32.dll | |5.1.2600.5512 |551936 |2008-04-14 10:12:02|C:\WINDOWS\system 32 |
|773D0000|comctl32.dll |User Experience Controls Library |6.0.2900.5512 |1054208|2008-04-14 10:12:52|C:\WINDOWS\WinSxS \x86_Micro soft.Windo ws.Common- Controls_6 595b64144c cf1df_6.0. 2600.5512_ x-ww_35d4c e83|
|774E0000|ole32.dll |Microsoft OLE for Windows |5.1.2600.5512 |1287168|2008-04-14 10:12:02|C:\WINDOWS\system 32 |
|77920000|SETUPAPI.dll |Windows Setup API |5.1.2600.5512 |985088 |2008-04-14 05:42:06|C:\WINDOWS\system 32 |
|77A20000|cscui.dll |Client Side Caching UI |5.1.2600.5512 |326656 |2008-04-14 10:11:52|C:\WINDOWS\System 32 |
|77B40000|apphelp.dll |Application Compatibility Client Library |5.1.2600.5512 |125952 |2008-04-14 10:11:50|C:\WINDOWS\system 32 |
|77C00000|version.dll |Version Checking and File Installation Libraries |5.1.2600.5512 |18944 |2008-04-14 10:12:08|C:\WINDOWS\system 32 |
|77C10000|msvcrt.dll |Windows NT CRT DLL |7.0.2600.5512 |343040 |2008-04-14 10:12:02|C:\WINDOWS\system 32 |
|77DD0000|ADVAPI32.dll |Advanced Windows 32 Base API |5.1.2600.5755 |617472 |2009-02-09 22:10:48|C:\WINDOWS\system 32 |
|77E70000|RPCRT4.dll |Remote Procedure Call Runtime |5.1.2600.5512 |584704 |2008-04-14 10:12:04|C:\WINDOWS\system 32 |
|77F10000|GDI32.dll |GDI Client DLL |5.1.2600.5698 |286720 |2008-10-23 22:36:14|C:\WINDOWS\system 32 |
|77F60000|SHLWAPI.dll |Shell Light-weight Utility Library |6.0.2900.5512 |474112 |2008-04-14 10:12:06|C:\WINDOWS\system 32 |
|77FE0000|Secur32.dll |Security Support Provider Interface |5.1.2600.5753 |56832 |2009-02-04 05:59:08|C:\WINDOWS\system 32 |
|78000000|iertutil.dll |Run time utility for Internet Explorer |7.0.6000.16825 |268288 |2009-02-21 04:09:38|C:\WINDOWS\system 32 |
|78050000|WININET.dll |Internet Extensions for Win32 |7.0.6000.16827 |826368 |2009-03-03 10:18:26|C:\WINDOWS\system 32 |
|78480000|MSVCP90.dll |Microsoft® C++ Runtime Library |9.0.30729.1 |572928 |2008-07-29 08:05:08|C:\WINDOWS\WinSxS \x86_Micro soft.VC90. CRT_1fc8b3 b9a1e18e3b _9.0.30729 .1_x-ww_6f 74963e |
|78520000|MSVCR90.dll |Microsoft® C Runtime Library |9.0.30729.1 |655872 |2008-07-29 08:05:08|C:\WINDOWS\WinSxS \x86_Micro soft.VC90. CRT_1fc8b3 b9a1e18e3b _9.0.30729 .1_x-ww_6f 74963e |
|7C800000|kernel32.dll |Windows NT BASE API Client DLL |5.1.2600.5781 |989696 |2009-03-22 00:06:58|C:\WINDOWS\system 32 |
|7C900000|ntdll.dll |NT Layer DLL |5.1.2600.5755 |714752 |2009-02-09 22:10:48|C:\WINDOWS\system 32 |
|7C9C0000|shell32.dll |Windows Shell Common Dll |6.0.2900.5622 |8461312|2008-06-18 05:02:20|C:\WINDOWS\system 32 |
|7E410000|USER32.dll |Windows XP USER API Client DLL |5.1.2600.5512 |578560 |2008-04-14 10:12:08|C:\WINDOWS\system 32 |
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
Processes Information:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
|ID |Name |Description |Version |Memory |Priority|Threads|Path |
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
|4 |System |System.dll |1.1.4322.2407 |245760 |Normal |57 | |
|208 |ctfmon.exe |CTF Loader |5.1.2600.5512 |3833856 |Normal |1 |C:\WINDOWS\system32 |
|568 |smss.exe | | |430080 |Normal |3 |\SystemRoot\System32 |
|640 |winlogon.exe | | |4743168 |High |18 |C:\WINDOWS\system32 |
|684 |services.exe |Services and Controller app |5.1.2600.5755 |3571712 |Normal |14 |C:\WINDOWS\system32 |
|696 |lsass.exe |LSA Shell (Export Version) |5.1.2600.5512 |6713344 |Normal |22 |C:\WINDOWS\system32 |
|856 |svchost.exe |Generic Host Process for Win32 Services|5.1.2600.5512 |5066752 |Normal |15 |C:\WINDOWS\system32 |
|896 |TSVNCache.exe |TortoiseSVN status cache |1.5.3.13783 |13725696|Normal |7 |C:\Program Files\TortoiseSVN\bin |
|996 |Explorer.EXE |Windows Explorer |6.0.2900.5512 |35581952|Normal |14 |C:\WINDOWS |
|1032|svchost.exe |Generic Host Process for Win32 Services|5.1.2600.5512 |30355456|Normal |73 |C:\WINDOWS\System32 |
|1404|LEXBCES.EXE |LexBce Service |8.29.0.0 |3235840 |Normal |7 |C:\WINDOWS\system32 |
|1436|spoolsv.exe |Spooler SubSystem App |5.1.2600.5512 |7073792 |Normal |15 |C:\WINDOWS\system32 |
|1488|svchost.exe |Generic Host Process for Win32 Services|5.1.2600.5512 |3616768 |Normal |8 |C:\WINDOWS\System32 |
|1708|HsExeHook.exe | |1.8.31.1155 |13869056|Normal |4 |C:\Code\InStall\Station |
|1744|inetinfo.exe |Internet Information Services |5.1.2600.5512 |17195008|Normal |25 |C:\WINDOWS\system32\inets rv |
|1768|nuServ.exe | | |327680 |Normal |4 |C:\Program Files\KidMoses\NetUpdate |
|1932|VMwareService.exe|VM ware Tools Service |7.2.4.45731 |2879488 |High |3 |C:\Program Files\VMware\VMware Tools |
|2020|Project69.exe | | |8687616 |Normal |3 |C:\Documents and Settings\Jack\My Documents\Borland Studio Projects|
|2660|NOTEPAD.EXE |Notepad |5.1.2600.5512 |4059136 |Normal |1 |C:\WINDOWS\system32 |
|2956|bds.exe |Borland® Developer Studio for Windows |10.0.2445.40105|23785472| Normal |16 |C:\Program Files\Borland\BDS\4.0\Bin |
|3440|bds.exe |Borland® Developer Studio for Windows |10.0.2445.40105|16719872| Normal |11 |C:\Program Files\Borland\BDS\4.0\Bin |
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
Assembler Information:
-------------------------- ---------- ---------- ---------- ---------- ------
; Classes.ClassNotFound (Line=0 - Offset=0)
; -------------------------- ---------- -----
0041987B lea eax, [ebp-$08]
0041987E push eax
0041987F push $00
00419881 lea edx, [ebp-$0C]
00419884 mov eax, dword ptr [$552FE0]
00419889 call Project69.System.LoadResSt ring
0041988E mov ecx, [ebp-$0C]
00419891 mov dl, $01
00419893 mov eax, dword ptr [Classes.Classes]
00419898 call SysUtils.Exception.CreateF mt
0041989D call Project69.System._RaiseExc ept ; <-- EXCEPTION
004198A2 xor eax, eax
004198A4 pop edx
004198A5 pop ecx
004198A6 pop ecx
004198A7 mov fs:[eax], edx
004198AA push $004198BF ; '[9å]ÃU9ìQS9Ø¡àrU'
004198AF lea eax, [ebp-$0C]
004198B2 call Project69.System._LStrClr
004198B7 ret
Registers:
-------------------------- ---
EAX: 00B9DFA0 EDI: 00000000
EBX: 00BA6D80 ESI: 00BA6D80
ECX: 00000000 ESP: 0013FA14
EDX: 004198A2 EIP: 0041989D
Stack: Memory Dump:
------------------ -------------------------- ---------- ---------- ---------- ---------- ---------
0013FA14: 0013FA48 0041989D: E8 7A B1 FE FF 33 C0 5A 59 59 64 89 10 68 BF 98 .z...3.ZYYd..h..
0013FA18: 004048F8 004198AD: 41 00 8D 45 F4 E8 F1 B7 FE FF C3 E9 BB AF FE FF A..E............
0013FA1C: 0013FA30 004198BD: EB F0 5B 8B E5 5D C3 55 8B EC 51 53 8B D8 A1 E0 ..[..].U..QS....
0013FA20: 00B0C580 004198CD: 72 55 00 E8 7F FC FF FF 33 C0 55 68 0A 99 41 00 rU......3.Uh..A.
0013FA24: 00000000 004198DD: 64 FF 30 64 89 20 8B D3 A1 E0 72 55 00 E8 C5 FA d.0d. ....rU....
0013FA28: 00BA6D80 004198ED: FF FF 89 45 FC 33 C0 5A 59 59 64 89 10 68 11 99 ...E.3.ZYYd..h..
0013FA2C: 00BA6D0B 004198FD: 41 00 A1 E0 72 55 00 E8 03 FD FF FF C3 E9 69 AF A...rU........i.
0013FA30: 0013FA60 0041990D: FE FF EB EE 8B 45 FC 5B 59 5D C3 53 56 8B F0 8B .....E.[Y].SV...
0013FA34: 004202F2 0041991D: C6 E8 A1 FF FF FF 8B D8 85 DB 75 07 8B C6 E8 28 ..........u....(
0013FA38: 00000000 0041992D: FF FF FF 8B C3 5E 5B C3 8D 40 00 55 8B EC 53 8B .....^[..@.U..S.
0013FA3C: 004216E0 0041993D: D8 A1 E0 72 55 00 E8 0C FC FF FF 33 C0 55 68 9D ...rU......3.Uh.
0013FA40: 0041887C 0041994D: 99 41 00 64 FF 30 64 89 20 EB 1D 8B D3 A1 E0 72 .A.d.0d. ......r
0013FA44: 0041E6B5 0041995D: 55 00 E8 FC FB FF FF 3B 1D 3C 7D 41 00 74 19 8B U......;.<}A.t..
0013FA48: 0013FA6C 0041996D: C3 E8 FD A6 FE FF 8B D8 8B D3 A1 E0 72 55 00 E8 ............rU..
0013FA4C: 00404A8F 0041997D: F7 FB FF FF 84 C0 74 D3 33 C0 5A 59 59 64 89 10 ......t.3.ZYYd..
0013FA50: 0013FA60 0041998D: 68 A4 99 41 00 A1 E0 72 55 00 E8 70 FC FF FF C3 h..A...rU..p....
Spoke too soon. It worked only because I forgot I had pulled out the sub-panel last night.
This is the debug trace of the error. But I really think it is a link error. The test app has nothing but the expandpanel - and it fails. If I add a TPanel to the test app, it works. Maybe I need to switch to newer Delphi?
This is the code of the failing test app.
++++++++++++++++++++++++++
unit Unit70;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, sExpandPanel;
type
TForm70 = class(TForm)
sExpandPanel1: TsExpandPanel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form70: TForm70;
implementation
{$R *.dfm}
end.
+++++++++++++++++++++
this is the code of a working test app
++++++++++++++++++++++
unit Unit70;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, sExpandPanel;
type
TForm70 = class(TForm)
sExpandPanel1: TsExpandPanel;
Panel1: TPanel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form70: TForm70;
implementation
{$R *.dfm}
end.
++++++++++++++++++++++
EurekaLog 6.0.17
Application:
--------------------------
1.1 Start Date : Mon, 4 May 2009 12:49:15 +1000
1.2 Name/Description: Project69.exe
1.3 Version Number :
1.4 Parameters :
1.5 Compilation Date: Mon, 4 May 2009 12:49:13 +1000
1.6 Up Time : 0 second
Exception:
--------------------------
2.1 Date : Mon, 4 May 2009 12:49:15 +1000
2.2 Address : 0041989D
2.3 Module Name : Project69.exe
2.4 Module Version:
2.5 Type : EClassNotFound
2.6 Message : Class TPanel not found.
2.7 ID : 8585
2.8 Count : 1
2.9 Status : New
2.10 Note :
User:
--------------------------
3.1 ID : Jack
3.2 Name : jack
3.3 Email :
3.4 Company : home
3.5 Privileges: SeChangeNotifyPrivilege - ON
SeSecurityPrivilege - OFF
SeBackupPrivilege - OFF
SeRestorePrivilege - OFF
SeSystemtimePrivilege - OFF
SeShutdownPrivilege - OFF
SeRemoteShutdownPrivilege - OFF
SeTakeOwnershipPrivilege - OFF
SeDebugPrivilege - OFF
SeSystemEnvironmentPrivile
SeSystemProfilePrivilege - OFF
SeProfileSingleProcessPriv
SeIncreaseBasePriorityPriv
SeLoadDriverPrivilege - ON
SeCreatePagefilePrivilege - OFF
SeIncreaseQuotaPrivilege - OFF
SeUndockPrivilege - ON
SeManageVolumePrivilege - OFF
SeImpersonatePrivilege - ON
SeCreateGlobalPrivilege - ON
SeTcbPrivilege - OFF
Active Controls:
--------------------------
4.1 Form Class : Shell_TrayWnd
4.2 Form Text :
4.3 Control Class:
4.4 Control Text :
Computer:
--------------------------
5.1 Name : DEVMAN
5.2 Total Memory : 1047 Mb
5.3 Free Memory : 557 Mb
5.4 Total Disk : 20 Gb
5.5 Free Disk : 3.7 Gb
5.6 System Up Time: 12 hours, 14 minutes, 7 seconds
5.7 Processor : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
5.8 Display Mode : 1676 x 926, 32 bit
5.9 Display DPI : 96
5.10 Video Card : VMware SVGA II (driver 11.4.3.1 - RAM 21 MB)
5.11 Printer : Polestar Virtual Printer (driver 6.0.6001.22116)
Operating System:
--------------------------
6.1 Type : Microsoft Windows XP
6.2 Build # : 2600
6.3 Update : Service Pack 3
6.4 Language: English
6.5 Charset : 0
Network:
--------------------------
7.1 IP Address: 010.010.010.004
7.2 Submask : 255.255.255.000
7.3 Gateway : 010.010.010.001
7.4 DNS 1 : 010.010.010.001
7.5 DNS 2 : 000.000.000.000
7.6 DHCP : ON
Call Stack Information:
--------------------------
|Address |Module |Unit |Class|Procedure/Method |Line |
--------------------------
|Running Thread: ID=3288; Priority=0; Class=; [Main] |
|-------------------------
|7E429E5A|USER32.dll | | |IsWindowVisible | |
|7E429E66|USER32.dll | | |IsWindowVisible | |
|7C90D988|ntdll.dll | | |NtQueryVirtualMemory | |
|7C80BA57|kernel32.dll | | |VirtualQueryEx | |
|7C80BA40|kernel32.dll | | |VirtualQueryEx | |
|7C80BA81|kernel32.dll | | |VirtualQuery | |
|774FF066|ole32.dll | | |CoInitializeEx | |
|00543FDF|Project69.exe|Pr
|7C90DCB8|ntdll.dll | | |ZwSetInformationThread| |
--------------------------
Modules Information:
--------------------------
|Handle |Name |Description |Version |Size |Modified |Path |
--------------------------
|00400000|Project69.exe | | |1554432|2009-05-04 12:49:14|C:\Documents and Settings\Jack\My Documents\Borland Studio Projects |
|01560000|TortoiseSVN.dll |TortoiseSVN shell extension client |1.5.3.13783 |749568 |2008-08-30 22:02:40|C:\Program Files\TortoiseSVN\bin |
|01630000|Normaliz.dll |Unicode Normalization DLL |6.0.5441.0 |23552 |2006-06-29 08:05:44|C:\WINDOWS\system
|05940000|TortoiseStub.dll
|05960000|TortoiseOverlays
|10000000|intl3_tsvn.dll |LGPLed libintl for Windows NT/2000/XP and Windows 95/98/ME|0.14.4.0 |57856 |2008-08-30 21:03:20|C:\Program Files\TortoiseSVN\bin |
|5AD70000|uxtheme.dll |Microsoft UxTheme Library |6.0.2900.5512 |218624 |2008-04-25 19:41:40|C:\WINDOWS\system
|5D090000|comctl32.dll |Common Controls Library |5.82.2900.5512 |617472 |2008-04-14 10:11:52|C:\WINDOWS\system
|6EE60000|libaprutil_tsvn.
|6EEC0000|libapr_tsvn.dll |Apache Portable Runtime Library |1.2.12.0 |118272 |2008-08-30 21:56:32|C:\Program Files\TortoiseSVN\bin |
|71A50000|MSWSOCK.dll |Microsoft Windows Sockets 2.0 Service Provider |5.1.2600.5625 |245248 |2008-06-21 03:46:58|C:\WINDOWS\system
|71AA0000|WS2HELP.dll |Windows Socket 2.0 Helper for Windows NT |5.1.2600.5512 |19968 |2008-04-14 10:12:10|C:\WINDOWS\system
|71AB0000|WS2_32.dll |Windows Socket 2.0 32-Bit DLL |5.1.2600.5512 |82432 |2008-04-14 10:12:10|C:\WINDOWS\system
|71AD0000|wsock32.dll |Windows Socket 32-Bit DLL |5.1.2600.5512 |22528 |2008-04-14 10:12:10|C:\WINDOWS\system
|73000000|winspool.drv |Windows Spooler Driver |5.1.2600.5512 |146432 |2008-04-14 10:12:46|C:\WINDOWS\system
|74720000|MSCTF.dll |MSCTF Server DLL |5.1.2600.5512 |297984 |2008-04-14 10:11:58|C:\WINDOWS\system
|755C0000|msctfime.ime |Microsoft Text Frame Work Service IME |5.1.2600.5512 |177152 |2008-04-14 10:10:06|C:\WINDOWS\system
|76380000|msimg32.dll |GDIEXT Client DLL |5.1.2600.5512 |4608 |2008-04-14 10:12:00|C:\WINDOWS\system
|76390000|IMM32.DLL |Windows XP IMM32 API Client DLL |5.1.2600.5512 |110080 |2008-04-14 10:11:54|C:\WINDOWS\system
|76600000|CSCDLL.dll |Offline Network Agent |5.1.2600.5512 |101888 |2008-04-14 10:11:52|C:\WINDOWS\System
|76780000|SHFOLDER.dll |Shell Folder Service |6.0.2900.5512 |25088 |2008-04-14 10:12:06|C:\WINDOWS\system
|76BF0000|PSAPI.DLL |Process Status Helper |5.1.2600.5512 |23040 |2008-04-14 10:12:04|C:\WINDOWS\system
|76F60000|WLDAP32.dll |Win32 LDAP API DLL |5.1.2600.5512 |172032 |2008-04-14 10:12:10|C:\WINDOWS\system
|76FD0000|CLBCATQ.DLL | |2001.12.4414.700|498688 |2008-04-14 10:11:50|C:\WINDOWS\system
|77050000|COMRes.dll | |2001.12.4414.700|792064 |2008-04-14 10:11:52|C:\WINDOWS\system
|77120000|oleaut32.dll | |5.1.2600.5512 |551936 |2008-04-14 10:12:02|C:\WINDOWS\system
|773D0000|comctl32.dll |User Experience Controls Library |6.0.2900.5512 |1054208|2008-04-14 10:12:52|C:\WINDOWS\WinSxS
|774E0000|ole32.dll |Microsoft OLE for Windows |5.1.2600.5512 |1287168|2008-04-14 10:12:02|C:\WINDOWS\system
|77920000|SETUPAPI.dll |Windows Setup API |5.1.2600.5512 |985088 |2008-04-14 05:42:06|C:\WINDOWS\system
|77A20000|cscui.dll |Client Side Caching UI |5.1.2600.5512 |326656 |2008-04-14 10:11:52|C:\WINDOWS\System
|77B40000|apphelp.dll |Application Compatibility Client Library |5.1.2600.5512 |125952 |2008-04-14 10:11:50|C:\WINDOWS\system
|77C00000|version.dll |Version Checking and File Installation Libraries |5.1.2600.5512 |18944 |2008-04-14 10:12:08|C:\WINDOWS\system
|77C10000|msvcrt.dll |Windows NT CRT DLL |7.0.2600.5512 |343040 |2008-04-14 10:12:02|C:\WINDOWS\system
|77DD0000|ADVAPI32.dll |Advanced Windows 32 Base API |5.1.2600.5755 |617472 |2009-02-09 22:10:48|C:\WINDOWS\system
|77E70000|RPCRT4.dll |Remote Procedure Call Runtime |5.1.2600.5512 |584704 |2008-04-14 10:12:04|C:\WINDOWS\system
|77F10000|GDI32.dll |GDI Client DLL |5.1.2600.5698 |286720 |2008-10-23 22:36:14|C:\WINDOWS\system
|77F60000|SHLWAPI.dll |Shell Light-weight Utility Library |6.0.2900.5512 |474112 |2008-04-14 10:12:06|C:\WINDOWS\system
|77FE0000|Secur32.dll |Security Support Provider Interface |5.1.2600.5753 |56832 |2009-02-04 05:59:08|C:\WINDOWS\system
|78000000|iertutil.dll |Run time utility for Internet Explorer |7.0.6000.16825 |268288 |2009-02-21 04:09:38|C:\WINDOWS\system
|78050000|WININET.dll |Internet Extensions for Win32 |7.0.6000.16827 |826368 |2009-03-03 10:18:26|C:\WINDOWS\system
|78480000|MSVCP90.dll |Microsoft® C++ Runtime Library |9.0.30729.1 |572928 |2008-07-29 08:05:08|C:\WINDOWS\WinSxS
|78520000|MSVCR90.dll |Microsoft® C Runtime Library |9.0.30729.1 |655872 |2008-07-29 08:05:08|C:\WINDOWS\WinSxS
|7C800000|kernel32.dll |Windows NT BASE API Client DLL |5.1.2600.5781 |989696 |2009-03-22 00:06:58|C:\WINDOWS\system
|7C900000|ntdll.dll |NT Layer DLL |5.1.2600.5755 |714752 |2009-02-09 22:10:48|C:\WINDOWS\system
|7C9C0000|shell32.dll |Windows Shell Common Dll |6.0.2900.5622 |8461312|2008-06-18 05:02:20|C:\WINDOWS\system
|7E410000|USER32.dll |Windows XP USER API Client DLL |5.1.2600.5512 |578560 |2008-04-14 10:12:08|C:\WINDOWS\system
--------------------------
Processes Information:
--------------------------
|ID |Name |Description |Version |Memory |Priority|Threads|Path |
--------------------------
|4 |System |System.dll |1.1.4322.2407 |245760 |Normal |57 | |
|208 |ctfmon.exe |CTF Loader |5.1.2600.5512 |3833856 |Normal |1 |C:\WINDOWS\system32 |
|568 |smss.exe | | |430080 |Normal |3 |\SystemRoot\System32 |
|640 |winlogon.exe | | |4743168 |High |18 |C:\WINDOWS\system32 |
|684 |services.exe |Services and Controller app |5.1.2600.5755 |3571712 |Normal |14 |C:\WINDOWS\system32 |
|696 |lsass.exe |LSA Shell (Export Version) |5.1.2600.5512 |6713344 |Normal |22 |C:\WINDOWS\system32 |
|856 |svchost.exe |Generic Host Process for Win32 Services|5.1.2600.5512 |5066752 |Normal |15 |C:\WINDOWS\system32 |
|896 |TSVNCache.exe |TortoiseSVN status cache |1.5.3.13783 |13725696|Normal |7 |C:\Program Files\TortoiseSVN\bin |
|996 |Explorer.EXE |Windows Explorer |6.0.2900.5512 |35581952|Normal |14 |C:\WINDOWS |
|1032|svchost.exe |Generic Host Process for Win32 Services|5.1.2600.5512 |30355456|Normal |73 |C:\WINDOWS\System32 |
|1404|LEXBCES.EXE |LexBce Service |8.29.0.0 |3235840 |Normal |7 |C:\WINDOWS\system32 |
|1436|spoolsv.exe |Spooler SubSystem App |5.1.2600.5512 |7073792 |Normal |15 |C:\WINDOWS\system32 |
|1488|svchost.exe |Generic Host Process for Win32 Services|5.1.2600.5512 |3616768 |Normal |8 |C:\WINDOWS\System32 |
|1708|HsExeHook.exe | |1.8.31.1155 |13869056|Normal |4 |C:\Code\InStall\Station |
|1744|inetinfo.exe |Internet Information Services |5.1.2600.5512 |17195008|Normal |25 |C:\WINDOWS\system32\inets
|1768|nuServ.exe | | |327680 |Normal |4 |C:\Program Files\KidMoses\NetUpdate |
|1932|VMwareService.exe|VM
|2020|Project69.exe | | |8687616 |Normal |3 |C:\Documents and Settings\Jack\My Documents\Borland Studio Projects|
|2660|NOTEPAD.EXE |Notepad |5.1.2600.5512 |4059136 |Normal |1 |C:\WINDOWS\system32 |
|2956|bds.exe |Borland® Developer Studio for Windows |10.0.2445.40105|23785472|
|3440|bds.exe |Borland® Developer Studio for Windows |10.0.2445.40105|16719872|
--------------------------
Assembler Information:
--------------------------
; Classes.ClassNotFound (Line=0 - Offset=0)
; --------------------------
0041987B lea eax, [ebp-$08]
0041987E push eax
0041987F push $00
00419881 lea edx, [ebp-$0C]
00419884 mov eax, dword ptr [$552FE0]
00419889 call Project69.System.LoadResSt
0041988E mov ecx, [ebp-$0C]
00419891 mov dl, $01
00419893 mov eax, dword ptr [Classes.Classes]
00419898 call SysUtils.Exception.CreateF
0041989D call Project69.System._RaiseExc
004198A2 xor eax, eax
004198A4 pop edx
004198A5 pop ecx
004198A6 pop ecx
004198A7 mov fs:[eax], edx
004198AA push $004198BF ; '[9å]ÃU9ìQS9Ø¡àrU'
004198AF lea eax, [ebp-$0C]
004198B2 call Project69.System._LStrClr
004198B7 ret
Registers:
--------------------------
EAX: 00B9DFA0 EDI: 00000000
EBX: 00BA6D80 ESI: 00BA6D80
ECX: 00000000 ESP: 0013FA14
EDX: 004198A2 EIP: 0041989D
Stack: Memory Dump:
------------------ --------------------------
0013FA14: 0013FA48 0041989D: E8 7A B1 FE FF 33 C0 5A 59 59 64 89 10 68 BF 98 .z...3.ZYYd..h..
0013FA18: 004048F8 004198AD: 41 00 8D 45 F4 E8 F1 B7 FE FF C3 E9 BB AF FE FF A..E............
0013FA1C: 0013FA30 004198BD: EB F0 5B 8B E5 5D C3 55 8B EC 51 53 8B D8 A1 E0 ..[..].U..QS....
0013FA20: 00B0C580 004198CD: 72 55 00 E8 7F FC FF FF 33 C0 55 68 0A 99 41 00 rU......3.Uh..A.
0013FA24: 00000000 004198DD: 64 FF 30 64 89 20 8B D3 A1 E0 72 55 00 E8 C5 FA d.0d. ....rU....
0013FA28: 00BA6D80 004198ED: FF FF 89 45 FC 33 C0 5A 59 59 64 89 10 68 11 99 ...E.3.ZYYd..h..
0013FA2C: 00BA6D0B 004198FD: 41 00 A1 E0 72 55 00 E8 03 FD FF FF C3 E9 69 AF A...rU........i.
0013FA30: 0013FA60 0041990D: FE FF EB EE 8B 45 FC 5B 59 5D C3 53 56 8B F0 8B .....E.[Y].SV...
0013FA34: 004202F2 0041991D: C6 E8 A1 FF FF FF 8B D8 85 DB 75 07 8B C6 E8 28 ..........u....(
0013FA38: 00000000 0041992D: FF FF FF 8B C3 5E 5B C3 8D 40 00 55 8B EC 53 8B .....^[..@.U..S.
0013FA3C: 004216E0 0041993D: D8 A1 E0 72 55 00 E8 0C FC FF FF 33 C0 55 68 9D ...rU......3.Uh.
0013FA40: 0041887C 0041994D: 99 41 00 64 FF 30 64 89 20 EB 1D 8B D3 A1 E0 72 .A.d.0d. ......r
0013FA44: 0041E6B5 0041995D: 55 00 E8 FC FB FF FF 3B 1D 3C 7D 41 00 74 19 8B U......;.<}A.t..
0013FA48: 0013FA6C 0041996D: C3 E8 FD A6 FE FF 8B D8 8B D3 A1 E0 72 55 00 E8 ............rU..
0013FA4C: 00404A8F 0041997D: F7 FB FF FF 84 C0 74 D3 33 C0 5A 59 59 64 89 10 ......t.3.ZYYd..
0013FA50: 0013FA60 0041998D: 68 A4 99 41 00 A1 E0 72 55 00 E8 70 FC FF FF C3 h..A...rU..p....
ASKER
I found that if I drop the component onto the form, it fails at runtine.
However, if I build the component at time of form create, it runs ok.
( eg)
procedure TForm70.FormCreate(Sender: TObject);
begin
FPanel := TsExpandPanel.Create( Self );
FPanel.Parent := Self;
end;
Is there something wrong in the way I am trying to install my component perhaps?
However, if I build the component at time of form create, it runs ok.
( eg)
procedure TForm70.FormCreate(Sender:
begin
FPanel := TsExpandPanel.Create( Self );
FPanel.Parent := Self;
end;
Is there something wrong in the way I am trying to install my component perhaps?
Hi ozwombat
When the code worked for me, I am using BDS 2006, same as you.
The call stack doesn't make it clear to me which line generates the error.
Don't you want to put Showmessage on every few lines until you isolate the error?
Sorry I can't be of more help
When the code worked for me, I am using BDS 2006, same as you.
The call stack doesn't make it clear to me which line generates the error.
Don't you want to put Showmessage on every few lines until you isolate the error?
Sorry I can't be of more help
ASKER
Hi rfwoolf
I really appreciate your help. I tried debugging it - it does not break on any line in my code. It happens after the component.create finishes and before the Application.Run. If I debug thru line - by - line, the next line after the "end:" of the component.create is in the exceptionlog module.
Ive given up on it - im just going to create the component in the code. I know it should work, but I cant figure it.
By the way - does my code still work for you if you drop the component on a blank form and run it?
I really appreciate your help. I tried debugging it - it does not break on any line in my code. It happens after the component.create finishes and before the Application.Run. If I debug thru line - by - line, the next line after the "end:" of the component.create is in the exceptionlog module.
Ive given up on it - im just going to create the component in the code. I know it should work, but I cant figure it.
By the way - does my code still work for you if you drop the component on a blank form and run it?
uses
...
yourunit;
var
mypanel : tsexpandpanel;
begin
mypanel :=.tsexpandpanel.Create(fo
it successfully created the panel and its subpanel at runtime.
Perhaps you need to check your code some more, or come back with a specific line where this error is being generated, by using debugging techniques or putting in'Showmessage('1') in several places until you can ascertain the problematic line.
Another thing I found interesting is that in your Create constructor you say:
FSubPanel := TPanel.Create( Self.Owner );
Why don't you make the owner just 'self' instead of 'self.owner'. This refers to your SUBpanel, not your original panel. By saying 'self' the original panel would be the owner. By saying self.owner you would be referring to the form or whatever the owner may be.
I guess it may not make a difference, especially if you clean it up nicely in your destructor method.
Good luck