473,320 Members | 1,535 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,320 software developers and data experts.

Abstract interfaces and classes - Urgent Help

Hi,

I have an OCX I need to use in an implementation and always gets a
protection level error saying:
I get an error message saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

The OCX module has basically the following structure:

Namespace OCXmodule
{
public abstract interface Interface_A : _Interface_B, Interface_C
{
}

public abstract Interface _Interface_B
{
public abstract new void method1();
}

public abstract interface _Interface_C
{
public abstract new void method2();
public abstract new void method3();
}

public class InterfaceClass
{
public virtual new void Method2()
{
}

public virtual new void method3()
{
}
}
}

I am trying to create an instance of InterfaceClass Class to use the base
code.

I tried the following 2 approaches:

Attempt 1:
using System;
using OCXReference;

NameSpace MySpace
{
Public class _MyClass : OCXReference.InterfaceClass
{
public void Method2()
{
base.Method2();
}

public void method3()
{
base.Method3();
}
}
}

I get an error message saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

Attempt 2:
using System;
using OCXReference;

NameSpace MySpace
{
Public class _MyClass : OCXReference.Interface_A
{
private OCXReference.InterfaceClass oClass = new
CXReference.InterfaceClass();

public void Method1()
{
oClass.Method2();
}

public void Method2()
{
oClass.Method2();
}

public void method3()
{
oClass.Method3();
}
}
}

I get same error message when creating the new CXReference.InterfaceClass()
saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

How can I call the code contained in the Class to use the base code?

I will appreciate any help.

Carlos Lozano
www.caxonline.net
Nov 17 '05 #1
2 1819
please post the actual code you're trying to compile, because this
definately isn't it at all...

- first interfaces are abstract anyway, so you can't use the abstract
keyword on them
- your casing in both keywords and interface naming differs

most probably the
"public class InterfaceClass"

is actually declared as
"private/protected/internal class InterfaceClass"

which means they're not allowing access from other classes/assemblies.

Wiebe

Carlos Lozano wrote:
Hi,

I have an OCX I need to use in an implementation and always gets a
protection level error saying:
I get an error message saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

The OCX module has basically the following structure:

Namespace OCXmodule
{
public abstract interface Interface_A : _Interface_B, Interface_C
{
}

public abstract Interface _Interface_B
{
public abstract new void method1();
}

public abstract interface _Interface_C
{
public abstract new void method2();
public abstract new void method3();
}

public class InterfaceClass
{
public virtual new void Method2()
{
}

public virtual new void method3()
{
}
}
}

I am trying to create an instance of InterfaceClass Class to use the base
code.

I tried the following 2 approaches:

Attempt 1:
using System;
using OCXReference;

NameSpace MySpace
{
Public class _MyClass : OCXReference.InterfaceClass
{
public void Method2()
{
base.Method2();
}

public void method3()
{
base.Method3();
}
}
}

I get an error message saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

Attempt 2:
using System;
using OCXReference;

NameSpace MySpace
{
Public class _MyClass : OCXReference.Interface_A
{
private OCXReference.InterfaceClass oClass = new
CXReference.InterfaceClass();

public void Method1()
{
oClass.Method2();
}

public void Method2()
{
oClass.Method2();
}

public void method3()
{
oClass.Method3();
}
}
}

I get same error message when creating the new CXReference.InterfaceClass()
saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

How can I call the code contained in the Class to use the base code?

I will appreciate any help.

Carlos Lozano
www.caxonline.net

Nov 17 '05 #2
Hi Wiebe,

I have already resolved the problem. You may want to refer to the following
thread for more details.

Microsoft Community Notification - Re: Creating a COM object
http://msdn.microsoft.com/newsgroups...1-bf6a72c7116e

Thank you,

Carlos Lozano
www.caxonline.net
"Wiebe Tijsma" wrote:
please post the actual code you're trying to compile, because this
definately isn't it at all...

- first interfaces are abstract anyway, so you can't use the abstract
keyword on them
- your casing in both keywords and interface naming differs

most probably the
"public class InterfaceClass"

is actually declared as
"private/protected/internal class InterfaceClass"

which means they're not allowing access from other classes/assemblies.

Wiebe

Carlos Lozano wrote:
Hi,

I have an OCX I need to use in an implementation and always gets a
protection level error saying:
I get an error message saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

The OCX module has basically the following structure:

Namespace OCXmodule
{
public abstract interface Interface_A : _Interface_B, Interface_C
{
}

public abstract Interface _Interface_B
{
public abstract new void method1();
}

public abstract interface _Interface_C
{
public abstract new void method2();
public abstract new void method3();
}

public class InterfaceClass
{
public virtual new void Method2()
{
}

public virtual new void method3()
{
}
}
}

I am trying to create an instance of InterfaceClass Class to use the base
code.

I tried the following 2 approaches:

Attempt 1:
using System;
using OCXReference;

NameSpace MySpace
{
Public class _MyClass : OCXReference.InterfaceClass
{
public void Method2()
{
base.Method2();
}

public void method3()
{
base.Method3();
}
}
}

I get an error message saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

Attempt 2:
using System;
using OCXReference;

NameSpace MySpace
{
Public class _MyClass : OCXReference.Interface_A
{
private OCXReference.InterfaceClass oClass = new
CXReference.InterfaceClass();

public void Method1()
{
oClass.Method2();
}

public void Method2()
{
oClass.Method2();
}

public void method3()
{
oClass.Method3();
}
}
}

I get same error message when creating the new CXReference.InterfaceClass()
saying:
OCXReference.InterfaceClass is inaccessible due to its protection level

How can I call the code contained in the Class to use the base code?

I will appreciate any help.

Carlos Lozano
www.caxonline.net

Nov 17 '05 #3

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

Similar topics

8
by: Vishal Gandhi | last post by:
Hi , Please help me by advising an real life scenario where Abstract Classes should be used over Interfaces or vice versa . Whats the basic difference between Abstract Class and interface other...
9
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
12
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
18
by: Bradley | last post by:
I'm trying to determine if there's a general rule for when an Interface should used vs. an Abstract Class. Is there any design advantage to using one or the other? Brad
9
by: Sean Kirkpatrick | last post by:
To my eye, there doesn't seem to be a whole lot of difference between the two of them from a functional point of view. Can someone give me a good explanation of why one vs the other? Sean
6
by: Steve | last post by:
I am designing a new class hierarchy and I've already run into a bit of a bump in the road. I have this structure so far; class CodeGen class CodeGenHeader : CodeGen class CodeGenProtocolHeader...
7
by: jason | last post by:
In the microsoft starter kit Time Tracker application, the data access layer code consist of three cs files. DataAccessHelper.cs DataAcess.cs SQLDataAccessLayer.cs DataAcccessHelper appears...
6
by: Miguel Guedes | last post by:
Hello, I recently read an interview with Bjarne Stroustrup in which he says that pure abstract classes should *not* contain any data. However, I have found that at times situations are when it...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I am actually a VB.Net guy, but I have worked somewhat with C++ and C#. I just want to ask about the relationship between Abstract Classes and Interfaces. My first question is if...
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...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.