473,287 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

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 ExpandableObjectConverter 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:

// ExpandableProperty.h
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Diagnostics;

public ref class TExpandableProperty : public ExpandableObjectConverter
{
public:
TExpandableProperty();

virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, Attribute^ attributes)
override { return GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties(Object^) override {
return GetProperties(); }
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^) override { return
GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties() override { return
propertyCollection; }

virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override {
return true; }
virtual bool GetPropertiesSupported() override { return true; }

bool AddProperty(PropertyDescriptor ^propertyDescriptor);

private:
PropertyDescriptorCollection ^propertyCollection;
};

// ExpandableProperty.cpp

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

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

TExpandableProperty::TExpandableProperty()
{
propertyCollection = gcnew PropertyDescriptorCollection(nullptr);
}

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

bool TExpandableProperty::AddProperty(PropertyDescripto r^
propertyDescriptor)
{
propertyCollection->Add(propertyDescriptor);
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.com.br
website: www.altoqi.com.br
Nov 17 '05 #1
2 4026
I think if you just override:

virtual PropertyDescriptorCollection^ GetProperties(ITypeDescriptorContext^,
Object^, array<Attribute^>^) override

and

virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override

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

"Adriano Coser" <coser@%removethis%altoqi.com.br> wrote in message
news:Oc*************@TK2MSFTNGP09.phx.gbl...
Hello.

After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjectConverter 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:

// ExpandableProperty.h
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Diagnostics;

public ref class TExpandableProperty : public ExpandableObjectConverter
{
public:
TExpandableProperty();

virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, Attribute^ attributes)
override { return GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties(Object^) override {
return GetProperties(); }
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^) override { return
GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties() override { return
propertyCollection; }

virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override {
return true; }
virtual bool GetPropertiesSupported() override { return true; }

bool AddProperty(PropertyDescriptor ^propertyDescriptor);

private:
PropertyDescriptorCollection ^propertyCollection;
};

// ExpandableProperty.cpp

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

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

TExpandableProperty::TExpandableProperty()
{
propertyCollection = gcnew PropertyDescriptorCollection(nullptr);
}

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

bool TExpandableProperty::AddProperty(PropertyDescripto r^
propertyDescriptor)
{
propertyCollection->Add(propertyDescriptor);
return true;
}

Thanks in advance for any help.

Regards,
Adriano.

AltoQi - Tecnologia Aplicada $B!&(BEngenharia Adriano Coser Departamento de
Desenvolvimento Tel.: (48) 239-7000 ramal: 7069 e-mail:
co***@altoqi.com.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<Attribute^>^' 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.com.br
website: www.altoqi.com.br
"James Park" <jp**********@SpaMMEhotmail.com> escreveu na mensagem
news:%2****************@TK2MSFTNGP09.phx.gbl...
I think if you just override:

virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, array<Attribute^>^)
override

and

virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override

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

"Adriano Coser" <coser@%removethis%altoqi.com.br> wrote in message
news:Oc*************@TK2MSFTNGP09.phx.gbl...
Hello.

After I converted my .net code to the new VC2005 syntax I started to get
C4490 on my ExpandableObjectConverter 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:

// ExpandableProperty.h
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Diagnostics;

public ref class TExpandableProperty : public ExpandableObjectConverter
{
public:
TExpandableProperty();

virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^, Attribute^ attributes)
override { return GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties(Object^) override
{ return GetProperties(); }
virtual PropertyDescriptorCollection^
GetProperties(ITypeDescriptorContext^, Object^) override { return
GetProperties(); }
virtual PropertyDescriptorCollection^ GetProperties() override { return
propertyCollection; }

virtual bool GetPropertiesSupported(ITypeDescriptorContext^) override
{ return true; }
virtual bool GetPropertiesSupported() override { return true; }

bool AddProperty(PropertyDescriptor ^propertyDescriptor);

private:
PropertyDescriptorCollection ^propertyCollection;
};

// ExpandableProperty.cpp

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

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

TExpandableProperty::TExpandableProperty()
{
propertyCollection = gcnew PropertyDescriptorCollection(nullptr);
}

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

bool TExpandableProperty::AddProperty(PropertyDescripto r^
propertyDescriptor)
{
propertyCollection->Add(propertyDescriptor);
return true;
}

Thanks in advance for any help.

Regards,
Adriano.

AltoQi - Tecnologia Aplicada $B!&(BEngenharia Adriano Coser
Departamento de Desenvolvimento Tel.: (48) 239-7000 ramal: 7069 e-mail:
co***@altoqi.com.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
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....
0
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...
2
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...
6
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...
20
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
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...
1
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...
0
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...
0
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.