Link to home
Start Free TrialLog in
Avatar of Ron_de_Weijze
Ron_de_Weijze

asked on

Error "Exception EClassNotFound" in component TadpMRU

Hello Experts,

Has one of you have ever used or tried the TadpMRU Delphi component? I implemented the About/Zarko Gajic' adaptation of it and it works beautifully, however setting the registrypath to HKEY_CURRENT_USER causes errmsg

"Exception EClassNotFound in module ApplicationName.exe at 001CCFA. Class TMRUMenuItem not found."

Any idea what might cause this or do you know a workaround?

Thanks!

http://delphi.about.com/library/weekly/aa112503a.htm
Avatar of Mike Littlewood
Mike Littlewood
Flag of United Kingdom of Great Britain and Northern Ireland image

It just sounds like you are missing a delphi package of components somewhere.
TMRUMenuItem must be in a 3rd party set of components you don't have installed.
did a google search and found this link

http://delphi.about.com/library/code/ncaa112503a.htm

seems it might just be a class of TMenuItem

type
  TMRUMenuItem = class(TMenuItem);
Avatar of Ron_de_Weijze
Ron_de_Weijze

ASKER

Indeed Mike, I used that code as-is, including the type declaration. It surprises me that it is in the implementation part of the pas file though.
It is basically put there because it shouldnt be needed in any other units/forms I guess.
If it was put in the interface part, then other units could use the type definition as well.
Are you saying I should move it there? It results into the same errormsg..
hmm I don't see why you should need to move it there to get it to work.
That whole code creates and registers a component.
Are you saying just copying that code into a new unit and compiling that it doesnt work?

If so Ill have a look at it tomorrow, dont have delphi on me at the moment.
That is what I did, Mike.
Installed it into package c:\program files\borland\delphi7\Lib\dclusr.dpk,
imported the pas file,
created an instance onto my main file's Form, and
linked it to a menu item.
ASKER CERTIFIED SOLUTION
Avatar of Mike Littlewood
Mike Littlewood
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wonderful Mike!! You solved my problem.
The logic however, of  ' *therefore* you do not need this', escapes me.

Thanks!
Oh now I see.. You mean *they* already used the root key, so my using it would double that and cause the error!..
Glad I could help.
Just found out that the errormessage returns after a cold restart. The compiled version still works. Must be some path setting somewhere (such as 'Classpath' in Tools - Environment options - Environment variables)..

What used to work (as a workaround), was delete the adpMRU1 instance from the form and replace it for a new one, however that doesn't work any more.

What does make it work again now though, is in design mode deleting the MRUMenuItems from the menu, that were created upon loading new files. The MRU menu items are added as subitems to the 'Reopen' menu item again during runtime.
Sounds like you have copied the code for the component to a directory, opened the file and compiled/installed, but then not added the path to the folder with the components code in to the enviroment options > library path
Selected menus: Component, Install component
Field: Unit file name C:\Program Files\Borland\Delphi7\Lib\adpMRU.pas
Field: Package file name C:\Program Files\Borland\Delphi7\Lib\dclusr.dpk
Compile!
Feedback: Application error, errormessage "Exception EClassNotFound in module ApplicationName.exe at 001CCFA. Class TMRUMenuItem not found."

Beats me..