Home » Community » Newbie corner » Extending an existing widget... 
	
		
		
			| Extending an existing widget... [message #50673] | 
			Mon, 03 December 2018 04:33   | 
		 
		
			
				
				
				
					
						  
						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    | 
		 
		
			| 
				
	 | 
 
	
		Hi Peter, 
 
Silly guess: The EditValue (and everything else in U++   ) 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
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 08:36:11 CET 2025 
 Total time taken to generate the page: 0.06061 seconds 
 |