473,406 Members | 2,345 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,406 software developers and data experts.

Return type of function not CLS-compliant

Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.

Aug 1 '07 #1
8 7993
Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.
Aug 1 '07 #2
"Bill McCarthy" <Bi**@NOSPAM.comschrieb:
I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't be CLS compliant, both VB and C# support them as of 2005.
I thought unsigned types became CLS compiliant since .NET 2.0.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 1 '07 #3

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:eM**************@TK2MSFTNGP05.phx.gbl...
"Bill McCarthy" <Bi**@NOSPAM.comschrieb:
>I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't be CLS compliant, both VB and C# support them as of 2005.

I thought unsigned types became CLS compiliant since .NET 2.0.
Nope. Generics are, but UInt16, UInt32 and UInt64 remain non compliant.

Aug 1 '07 #4
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:
Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.
Aug 4 '07 #5
Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:
>Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.
Aug 6 '07 #6
Hi Bill:

"all assemblies are marked with CLS compliant"

I added this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

Is that what you mean?
--
Doug.

"Bill McCarthy" wrote:
Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:
Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.


Aug 7 '07 #7
Hi Doug,

Yep. And make sure the dll's you are referencing, especially the one that
contains the Enum is also marked with the same attribute
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:6B**********************************@microsof t.com...
Hi Bill:

"all assemblies are marked with CLS compliant"

I added this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

Is that what you mean?
--
Doug.

"Bill McCarthy" wrote:
>Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But
yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:

Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote
in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I
have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on
the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.


Aug 7 '07 #8
Will Do, thanks!

--
Doug.

"Bill McCarthy" wrote:
Hi Doug,

Yep. And make sure the dll's you are referencing, especially the one that
contains the Enum is also marked with the same attribute
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:6B**********************************@microsof t.com...
Hi Bill:

"all assemblies are marked with CLS compliant"

I added this to the AssemblyInfo:

<Assembly: CLSCompliant(True)>

Is that what you mean?
--
Doug.

"Bill McCarthy" wrote:
Hi Doug,

You shouldn't be if all assemblies are marked with CLS compliant. But
yeh,
nothing to worry about anyway really ;)

"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote in
message news:C6**********************************@microsof t.com...
Hi Bill:

Ok, so I won't worry about it -- it just bugs me that I am getting the
warning.

thx!

--
Doug.

"Bill McCarthy" wrote:

Hey Doug,

I wouldn't worry about it. The underlying type is Int32 (implied)
And even if you used an unsigned int as the underlying type, which
wouldn't
be CLS compliant, both VB and C# support them as of 2005.
"Douglas Marquardt" <Do**************@discussions.microsoft.comwrote
in
message news:CC**********************************@microsof t.com...
Using VB.Net 2005.

I have my interfaces and enums defined in a DLL. For example, I
have
this
enum:
Public Enum OpStatusTypes
Normal
InProgress
Paused
End Enum
In another DLL I reference that DLL and expose a property based on
the
enum:

Public ReadOnly Property OpStatus() As OpStatusTypes
Get
Return m_OpStatus
End Get
End Property

The compiler gives me the subject warning -- why?
What concerns should I have about this?
'
--
Doug.

Aug 8 '07 #9

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

Similar topics

5
by: Murat Tasan | last post by:
so i have a situation that i know cannot be solved directly, and i've already worked around it, but i was hoping to find an explanation as to why this behavior is as it is... i have an abstract...
12
by: David Sobey | last post by:
Hi everyone I'm having huge difficulties overriding a virtual function with a function that returns a covariant type. I'd be grateful if someone could show me some code where this is done: - A...
2
by: PengYu.UT | last post by:
I have the following sample program, which can convert function object with 1 argument into function object with 2 arguments. It can also do + between function object of the same type. The last...
31
by: CeZaR | last post by:
Hi, How can i specify the return type of a function returning a managed array of chars. If i try to write: "char __gc func()" i get an error! How can i do that? Thanks!
3
by: C++ | last post by:
According to Thinking in C++ "You cannot modify the return type of a virtual function during overriding.but there is a special case in which you can slightly modify the return type. If you¡¯re...
5
by: PsiX | last post by:
Hi, does the return type specifier const for functions for built-in types ever make sense? Like in: const void DoSth(); const int DoSth();
8
by: WakeBdr | last post by:
I'm writing a class that will query a database for some data and return the result to the caller. I need to be able to return the result of the query in several different ways: list, xml,...
1
by: PengYu.UT | last post by:
Hi, Are there any walkaround to enable functions in the derived class with the same function name but different return type? In the following example, D1 and D2 are B's derived class. I want...
2
by: Sebastian Schucht | last post by:
Hi, I have a templateclass with virtual member-functions, so i can't create instances ... but for returning the result i would like use one. So i replaced the A<TTypefrom the baseclass with the...
18
by: Carl Forsman | last post by:
there are 2 ways to return a value from a function ==================== 1) passing a reference as parameter - the following will return time void Table::Get(char* FieldName, *SYSTEMTIME time) {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.