Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Extending an existing widget...
Extending an existing widget... [message #50673] Mon, 03 December 2018 04:33 Go to next message
ptkacz is currently offline  ptkacz
Messages: 89
Registered: March 2017
Member
Hi All,

I'm attempting to extend EditValue, based on how a class like EditString is defined, found listed within the EditCtrl.h header file. The definition looks like:

class ExtendedEdit : public EditValue<WString, ConvertString> {
public:
	typedef ExtendedEdit CLASSNAME;
        ...

Unfortunately, the error error: expected template-name before '<' token results in being generated. If EditCtrl.h is included, a whole slew of compilation errors result. Since EditCtrl.h's parent file is, CtrlLib.h that's included instead.

How is it that
class EditString : public EditValue<WString, ConvertString> {...}
is defined, but does not receive the error, error: expected template-name before '<' token?


Peter


PS: It's a shame that there are header files that include some useful functions or methods, and when included, bomb because they are dependant on other libraries being included prior. From a software design perspective, shouldn't each library file stand on it's own with the expected includes?

[Updated on: Mon, 03 December 2018 04:37]

Report message to a moderator

Re: Extending an existing widget... [message #50674 is a reply to message #50673] Mon, 03 December 2018 06:57 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Peter,

Silly guess: The EditValue (and everything else in U++ Smile ) is defined in namespace Upp. Your code snippet doesn't mention this, so maybe you forgot to use the namespace: Upp::EditValue<Upp:WString, Upp::convertString>? Or wrap the whole thing in namespace Upp { ... }, but that would define your ExtendedEdit in Upp namespace as well, which might not be exactly what you want.

Best regards,
Honza
Re: Extending an existing widget... [message #50683 is a reply to message #50674] Wed, 05 December 2018 04:26 Go to previous message
ptkacz is currently offline  ptkacz
Messages: 89
Registered: March 2017
Member
Hi Honza. Intriguing. I didn't include the namespace and when did (i.e. using namespace Upp;), the application was able to compile! Thanks for the suggestion!


Peter
Previous Topic: Conditional compilation
Next Topic: Sigh, SetData / GetData...
Goto Forum:
  


Current Time: Sat Apr 20 06:20:39 CEST 2024

Total time taken to generate the page: 0.05305 seconds