We help IT Professionals succeed at work.

Delphi 7 :: Compiler error "Unit Themes was compiled with different version of UxThemes.BP_PushButton"

Marius0188
Marius0188 asked
on
Dear Experts,

I have installed a component in Delphi 7.
The component name: "Dynamic DBTreeView v.1.3 Beta_dbtreeview"

It was all bugy and would not run the demo project of the component etc...
After I returned back to my project and want to compile I receive the fatal error compiler message.
(See message title).

I have repaired my installation of Delphi 7 but did not work.
I actually deleted the "themes.pas", uthemes.pas" and dcu's from Borland directory then
run installation again. It did replaced that files again but the problem still exists.

I am really mad because I am loosing valuable development time, as a result.

Please help.

Thanks in advance!
Comment
Watch Question

Top Expert 2007
Commented:
well, usually, the fast solution of deleting all dcu files of the components related to the issue fixes the problem.
so just delete all dcus from all possible places (see the search path on the environment and the project properties)
Top Expert 2007

Commented:
NOTE: beware of deleting cdus from units that you do not have sources for :) (like shareware stuff)

Author

Commented:
I have deleted the dcu's for themes and uthemes but still not working.
How can I determine which dcu's to delete?
Top Expert 2007

Commented:
well, you trace back the used classes. you will need to remove every single themes.dcu from any instance of its installation. same goes for UxThemes.dcu
keep in mind that since this is a beta, you will probably have the non-beta on the search path as well. a workaround would be to remove it from the search path but that is not a very certain solution.
btw, search path, as I said, it's from the environment and project settings:

- tools-environment options-library-library path and browsing path
- project-options-directories/conditionals-unit output directory, search path and debug source path

if there are too many directories there to search for, then just do a file search with some file manager for *theme*.dcu and you should get all dcus. hopefully :)

Author

Commented:
I have done just that.
Still the error.

Will re-installation of Delphi 7 help?
Ooh I am loosing so much as time, just as result of stupid component.
Top Expert 2007

Commented:
it might but there is no need to. you still have some dcu somewhere. 100%. if the component has uninstaller, uninstall it (se its readme as well). uninstall ALL versions you have.
Tomas Helgi JohannssonDatabase Administrator / Software Engineer
Commented:
  Hi!

I had the same problem installing Dynamic DBTreeView (probably the same version you mention) on D7 Enterprice Edition.
The only solution I found was to reinstall Delphi 7 :(
However there is a newer version 1.6 of the same component
and also a similar component in the Delphi JEDI-VCL component library that works quite well.

Regards,
  Tomas Helgi
Tomas Helgi JohannssonDatabase Administrator / Software Engineer

Commented:
I forgot to mention that I haven't tried/tested the version 1.6 of Dynamic DBTreeView.

Regards,
  Tomas Helgi

Author

Commented:
Ok but now I got another compiler error:
"File not found: 'UxTheme.dcu' ".

What should I do now?
Top Expert 2007

Commented:
well, you should compile the component :) the right one ;)
Commented:

Hi,

It only means that Delphi don't know where is located the compiled unit UxTheme.dcu (it's the compiled unit produced when uxTheme.pas was compiled and installed).

In your project, add the path to the folder containing the missing uxTheme.dcu (dialog box Projects ->Options ...).

If the unit uxTheme.pas is included in a package, see in the folder where the package is located to find the dcu file. Note thant you maybe need to recompile the whole package if you have deleted the dcu files.

Hope this help,


Author

Commented:
I don't want the component anymore.
I have removed it and it wish to compile my project to continue as normall.


But I think I am going to re-install Delphi.
I am loosing too much time. I know it's the easy way out but for now it's what I need to do.

Thanks for help.

Commented:

Hi,

It's a radical solution.  

Before uninstalling Delhi, did you try to delete the res file of your project (make a backup before if needed) but il normally will be recreated at runtime.

And at least, did you try to create a new project from scratch including in this new project each unit your inital project used.

Did you test if compiling a blank project gives the same error. Maybe a re-install isn't required.




Top Expert 2007

Commented:
I never reinstalled when had such problems. always deleting the right dcus and recompiling did the job. but then again I don't say that I've been through all possible situations that generate this kinf of error :)
Top Expert 2007
Commented:
>"File not found: 'UxTheme.dcu' "
Silly question, but are you sure you've deleted "UxTheme" (or whatever) from the uses clause of all of your project's units?
Top Expert 2007

Commented:
tname, that is only needed when you remove a unit from the project and don't want to use it anymore. at the stage he got that error, he was still trying the "delete dcu" thingie. but your suggestion comes in handy if he gets the error after reinstalling which I believe he should have finished by now :)
Top Expert 2007

Commented:
>tname, that is only needed when you remove a unit from the project and don't want to use it anymore
I had the impression this is exactly what Marius did at some point.
>at the stage he got that error, he was still trying the "delete dcu" thingie
I'm not so sure about that, but maybe I'm misreading the thread's plot ;)
Wim ten BrinkSelf-employed developer
Commented:
I once had to deal with a component that didn't want to install correctly. I choose the simplest solution: dump it and find another alternative. ;-)

Not sure why you want to use this specific treeview component but I think you'll find several other alternatives that might save you the time on development that you're wasting now by trying this one to work. As a rule of thumb, NO component should require re-installing Delphi over again. (Especially since that means you'll lose the updates of your Delphi version too.) Unless you have the source, you might not even be able to ever solve this problem since this seems a DCU version conflict.

Btw, never delete *.pas files, only *.dcu files. In case of emergencies you can always rebuild those DCU files using the PAS files. You could e.g try to delete themes.dcu but keep themes.pas in your library path so Delphi can recompile it if need be. That *might* solve the problem.