473,587 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VC++ 2005 Beta 2: warning C4490: 'override' : incorrect use of override specifier

Hello.

After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjec tConverter subclass overrides. The GetProperties
method is no longer called by the PropertyGrid when I use my subclass as a
type converter.

Can anyone tell me what has changed? What's the correct way to override
GetProperties method? Here's the code for my class:

// ExpandablePrope rty.h
#pragma once

using namespace System;
using namespace System::Compone ntModel;
using namespace System::Collect ions;
using namespace System::Diagnos tics;

public ref class TExpandableProp erty : public ExpandableObjec tConverter
{
public:
TExpandableProp erty();

virtual PropertyDescrip torCollection^
GetProperties(I TypeDescriptorC ontext^, Object^, Attribute^ attributes)
override { return GetProperties() ; }
virtual PropertyDescrip torCollection^ GetProperties(O bject^) override {
return GetProperties() ; }
virtual PropertyDescrip torCollection^
GetProperties(I TypeDescriptorC ontext^, Object^) override { return
GetProperties() ; }
virtual PropertyDescrip torCollection^ GetProperties() override { return
propertyCollect ion; }

virtual bool GetPropertiesSu pported(ITypeDe scriptorContext ^) override {
return true; }
virtual bool GetPropertiesSu pported() override { return true; }

bool AddProperty(Pro pertyDescriptor ^propertyDescri ptor);

private:
PropertyDescrip torCollection ^propertyCollec tion;
};

// ExpandablePrope rty.cpp

#include "StdAfx.h"
#include ".\expandablepr operty.h"
#using <mscorlib.dll >

//-----------------------------------------------------------

TExpandableProp erty::TExpandab leProperty()
{
propertyCollect ion = gcnew PropertyDescrip torCollection(n ullptr);
}

//-----------------------------------------------------------

bool TExpandableProp erty::AddProper ty(PropertyDesc riptor^
propertyDescrip tor)
{
propertyCollect ion->Add(propertyDe scriptor);
return true;
}

Thanks in advance for any help.

Regards,
Adriano.

AltoQi - Tecnologia Aplicada à Engenharia Adriano Coser Departamento de
Desenvolvimento Tel.: (48) 239-7000 ramal: 7069 e-mail: co***@altoqi.co m.br
website: www.altoqi.com.br
Nov 17 '05 #1
2 4047
I think if you just override:

virtual PropertyDescrip torCollection^ GetProperties(I TypeDescriptorC ontext^,
Object^, array<Attribute ^>^) override

and

virtual bool GetPropertiesSu pported(ITypeDe scriptorContext ^) override

it'll take care of the overloads as well. Also, there isn't a
GetProperties() overload that takes no arguments.

"Adriano Coser" <coser@%removet his%altoqi.com. br> wrote in message
news:Oc******** *****@TK2MSFTNG P09.phx.gbl...
Hello.

After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjec tConverter subclass overrides. The
GetProperties method is no longer called by the PropertyGrid when I use my
subclass as a type converter.

Can anyone tell me what has changed? What's the correct way to override
GetProperties method? Here's the code for my class:

// ExpandablePrope rty.h
#pragma once

using namespace System;
using namespace System::Compone ntModel;
using namespace System::Collect ions;
using namespace System::Diagnos tics;

public ref class TExpandableProp erty : public ExpandableObjec tConverter
{
public:
TExpandableProp erty();

virtual PropertyDescrip torCollection^
GetProperties(I TypeDescriptorC ontext^, Object^, Attribute^ attributes)
override { return GetProperties() ; }
virtual PropertyDescrip torCollection^ GetProperties(O bject^) override {
return GetProperties() ; }
virtual PropertyDescrip torCollection^
GetProperties(I TypeDescriptorC ontext^, Object^) override { return
GetProperties() ; }
virtual PropertyDescrip torCollection^ GetProperties() override { return
propertyCollect ion; }

virtual bool GetPropertiesSu pported(ITypeDe scriptorContext ^) override {
return true; }
virtual bool GetPropertiesSu pported() override { return true; }

bool AddProperty(Pro pertyDescriptor ^propertyDescri ptor);

private:
PropertyDescrip torCollection ^propertyCollec tion;
};

// ExpandablePrope rty.cpp

#include "StdAfx.h"
#include ".\expandablepr operty.h"
#using <mscorlib.dll >

//-----------------------------------------------------------

TExpandableProp erty::TExpandab leProperty()
{
propertyCollect ion = gcnew PropertyDescrip torCollection(n ullptr);
}

//-----------------------------------------------------------

bool TExpandableProp erty::AddProper ty(PropertyDesc riptor^
propertyDescrip tor)
{
propertyCollect ion->Add(propertyDe scriptor);
return true;
}

Thanks in advance for any help.

Regards,
Adriano.

AltoQi - Tecnologia Aplicada $B!&(BEngenha ria Adriano Coser Departamento de
Desenvolvimento Tel.: (48) 239-7000 ramal: 7069 e-mail:
co***@altoqi.co m.br website: www.altoqi.com.br

Nov 17 '05 #2
Thanks for your answer James.

Translating from de old syntax I declared the third parameter as
'Attribute^' instead of 'array<Attribut e^>^' and I just didn't see this
error until your answer.

Regards,
Adriano.

AltoQi - Tecnologia Aplicada à Engenharia Adriano Coser Departamento de
Desenvolvimento Tel.: (48) 239-7000 ramal: 7069 e-mail: co***@altoqi.co m.br
website: www.altoqi.com.br
"James Park" <jp**********@S paMMEhotmail.co m> escreveu na mensagem
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I think if you just override:

virtual PropertyDescrip torCollection^
GetProperties(I TypeDescriptorC ontext^, Object^, array<Attribute ^>^)
override

and

virtual bool GetPropertiesSu pported(ITypeDe scriptorContext ^) override

it'll take care of the overloads as well. Also, there isn't a
GetProperties() overload that takes no arguments.

"Adriano Coser" <coser@%removet his%altoqi.com. br> wrote in message
news:Oc******** *****@TK2MSFTNG P09.phx.gbl...
Hello.

After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjec tConverter subclass overrides. The
GetProperties method is no longer called by the PropertyGrid when I use
my subclass as a type converter.

Can anyone tell me what has changed? What's the correct way to override
GetProperties method? Here's the code for my class:

// ExpandablePrope rty.h
#pragma once

using namespace System;
using namespace System::Compone ntModel;
using namespace System::Collect ions;
using namespace System::Diagnos tics;

public ref class TExpandableProp erty : public ExpandableObjec tConverter
{
public:
TExpandableProp erty();

virtual PropertyDescrip torCollection^
GetProperties(I TypeDescriptorC ontext^, Object^, Attribute^ attributes)
override { return GetProperties() ; }
virtual PropertyDescrip torCollection^ GetProperties(O bject^) override
{ return GetProperties() ; }
virtual PropertyDescrip torCollection^
GetProperties(I TypeDescriptorC ontext^, Object^) override { return
GetProperties() ; }
virtual PropertyDescrip torCollection^ GetProperties() override { return
propertyCollect ion; }

virtual bool GetPropertiesSu pported(ITypeDe scriptorContext ^) override
{ return true; }
virtual bool GetPropertiesSu pported() override { return true; }

bool AddProperty(Pro pertyDescriptor ^propertyDescri ptor);

private:
PropertyDescrip torCollection ^propertyCollec tion;
};

// ExpandablePrope rty.cpp

#include "StdAfx.h"
#include ".\expandablepr operty.h"
#using <mscorlib.dll >

//-----------------------------------------------------------

TExpandableProp erty::TExpandab leProperty()
{
propertyCollect ion = gcnew PropertyDescrip torCollection(n ullptr);
}

//-----------------------------------------------------------

bool TExpandableProp erty::AddProper ty(PropertyDesc riptor^
propertyDescrip tor)
{
propertyCollect ion->Add(propertyDe scriptor);
return true;
}

Thanks in advance for any help.

Regards,
Adriano.

AltoQi - Tecnologia Aplicada $B!&(BEngenha ria Adriano Coser
Departamento de Desenvolvimento Tel.: (48) 239-7000 ramal: 7069 e-mail:
co***@altoqi.co m.br website: www.altoqi.com.br


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1927
by: Ryan | last post by:
My project uses the /ORDER specifier to order functions as specified in file containing the decorated names of packaged functions (COMDATs). I am in the process of upgrading from VC6 to VC.NET 2003. When linking a release build of my project VC.NET 2003, the following warning occurs for each function that is being ordered: ...
0
1059
by: Dilip | last post by:
Vaclav I have taken the liberty to cross-post this microsoft.public.dotnet.languages.vc which has more visibility from MSFT VC++ team. thanks --Dilip Actual post by Vaclav Haisman originally posted at
2
2279
by: um | last post by:
When the POSIX pthreads library for w32 release 2-2-0 (http://sources.redhat.com/pthreads-win32/) is compiled with VC++6 then it compiles and passes all the benchmark tests in the subdirectory "tests". Also, VC++ 2005 beta 1 compiles the tests fine, but here the following tests fail in execution: # semaphore1.pass \ # condvar2.pass \...
6
5003
by: John Gabriel | last post by:
I have been obtaining the following error in the output window of the IDE: 1>mt.exe:general error c101008d:Failed to write the updated manifest to the resource of file "..\debug\test.exe". The process cannot access the file because it is being used by another process. 1>Project : error PRJ0002 : Error result 31 returned from 'C:\Program...
20
2392
by: Nemanja Trifunovic | last post by:
Something I don't get it: Say we have: ref class Base { virtual void SomeVirtualFunction() {Console::WriteLine(L"Base");} public: void SomeAccessibleFunction() {SomeVirtualFunction();}
0
1099
by: Adriano Coser | last post by:
Hello. I have an ExpandableObjectConverter subclass that I associate to the 'Converter' of a custom property descriptor. After I changed my .net code to the new syntax (VC 2005), the GetProperties method of my converter class is not called anymore by the PropertyGrid. Now my expandable properties always show a property 'Length' with...
1
1762
by: Peted | last post by:
Hi, sorry if this isnt the correct newsgroups for this questions but im using vc++ 2005 express edition beta2 for learning to program vc++ ..net, as in winforms applications and i was wondering if can anyone point me to some sample code for writing to connect to a existing telnet server I just want to be able to establish a connection,...
0
3580
by: Mart | last post by:
Hi, I have just written (my first) VB.net app using MS Visual Basic 2005 Express Edition Beta. It is fairly simple, it reads some configuration data from an XML file then opens a new window containing a WebBrowser object. This all works fine and I'm happy with my app so I want to 'publish' to a setup file so that others can install it,...
0
1067
by: qpwang | last post by:
Dear All, I got a problem and need your help. After I converted my project (Embedded VC++ 3.0 for Pocket PC) to .NET 2005 Framework I can compile it without any error or warning. Then I ran it on iPAQ got an error "The parameter is incorrect". After debug I found the following line caused the error message:. CTime t1(1970, 1, 1, 0, 0, 0); ...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.