Hi~
I have two .cs files:
Class1.cs -
namespace ClassLibrary1
-
{
-
public class Class1
-
{
-
...
-
}
-
-
public class Class3
-
{
-
...
-
}
-
-
}
-
Class2.cs -
namespace ClassLibrary1
-
{
-
public class Class3
-
{
-
...
-
}
-
}
-
Also I set [assembly: ComVisible(true )] and check the "Register for COM interop" on the project property.
The problem is that the .tlb file created by Visual Studio 2005(and tlbexp.exe) has only interfaces and coclasses have been defined in Class1.cs file.
i.e., Class1 and Class3 are shown in the .tlb file, but Class2 is not shown in the .tlb file.
What did I wrong?
10 1486
Hi~
I have two .cs files:
Class1.cs -
namespace ClassLibrary1
-
{
-
public class Class1
-
{
-
...
-
}
-
-
public class Class3
-
{
-
...
-
}
-
-
}
-
Class2.cs -
namespace ClassLibrary1
-
{
-
public class Class3
-
{
-
...
-
}
-
}
-
Also I set [assembly: ComVisible(true )] and check the "Register for COM interop" on the project property.
The problem is that the .tlb file created by Visual Studio 2005(and tlbexp.exe) has only interfaces and coclasses have been defined in Class1.cs file.
i.e., Class1 and Class3 are shown in the .tlb file, but Class2 is not shown in the .tlb file.
What did I wrong?
because there is actually no class 2?
you have defined class 3 twice in both the files!!
if its a typo...i havent touched what you are trying to do, good luck
because there is actually no class 2?
you have defined class 3 twice in both the files!!
if its a typo...i havent touched what you are trying to do, good luck
It's a typo.
The below is the corrected code.
Class2.cs -
namespace ClassLibrary1
-
{
-
-
class Class2
-
{
-
...
-
}
-
}
-
Thank you anyway^^
Frinavale 9,735
Recognized Expert Moderator Expert
It's a typo.
The below is the corrected code.
Class2.cs -
namespace ClassLibrary1
-
{
-
-
class Class2
-
{
-
...
-
}
-
}
-
Thank you anyway^^
Was the typo the problem?
Or are you still having problems?
Was the typo the problem?
Or are you still having problems?
I still have the problem.
Sorry for the confusion.
Plater 7,872
Recognized Expert Expert
What kind of project is this? A library/dll project?
What kind of project is this? A library/dll project?
It is a Class Library project.
Thanks.
Plater 7,872
Recognized Expert Expert
So I made a class library.
I set COM visible to (true)
I have the following:
Class1.cs -
namespace mytemplib
-
{
-
public class Class1
-
{
-
public int class1INT = 0;
-
}
-
public class Class3
-
{
-
public int class3INT = 0;
-
}
-
}
-
Class2.cs -
namespace mytemplib
-
{
-
public class Class2
-
{
-
public int class2INT = 0;
-
}
-
}
-
And after a build, I add the DLL as a reference to another project.
I can then get at: -
mytemplib.Class1;
-
mytemplib.Class2;
-
mytemplib.Class3;
-
just fine.
If you are trying to use them as COM objects, I think you need to create more GUIDs for them maybe? I'm not real clear on how to use them as COM (never really done it) so I don't know
So I made a class library.
I set COM visible to (true)
I have the following:
Class1.cs -
namespace mytemplib
-
{
-
public class Class1
-
{
-
public int class1INT = 0;
-
}
-
public class Class3
-
{
-
public int class3INT = 0;
-
}
-
}
-
Class2.cs -
namespace mytemplib
-
{
-
public class Class2
-
{
-
public int class2INT = 0;
-
}
-
}
-
And after a build, I add the DLL as a reference to another project.
I can then get at: -
mytemplib.Class1;
-
mytemplib.Class2;
-
mytemplib.Class3;
-
just fine.
If you are trying to use them as COM objects, I think you need to create more GUIDs for them maybe? I'm not real clear on how to use them as COM (never really done it) so I don't know
Thank you.
But the problem is going on.
Plater 7,872
Recognized Expert Expert
Can you see all your classes in a managed code environment?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Zeng |
last post by:
Hello,
If I have an object that exposes many methods which don't change anything
about the object (at least I'm not aware in terms of implementation of the
..net class). The methods are called by many threads at the same time. What
sort of things that I need to do to make sure the methods and the class are
multi-thread safe? I thought I...
|
by: Sparhawk |
last post by:
Hi,
my company is going to migrate a large VC++ application to .NET to
make use of Windows Forms (the old class library is not updated any
more). We are not planning to migrate the rest of the code which works
well.
I understand the basic concept: our code is unmanaged, Windows Forms
is Managed and Unmanaged may not call Managed code. I...
|
by: jsale |
last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app
i have made is running on IIS v6 and consists of a number of pages that allow
the user to read information from the database into classes, which are used
throughout the application. I have made class collections which, upon reading
from the DB, create an instance of...
|
by: darrel |
last post by:
This is a follow up to a semi-regular question I've had off and on.
The main question is how to get one set of variables from an XML file so
that various usercontrols on the page can all use them.
I've been playing with different options...using an interface, a function,
passing variables between controls, etc.
But it just occured to me...
|
by: dee |
last post by:
OleDbCommand class like many .NET classes has the following description in
its help file:
"Thread Safety
Any public static (Shared in Visual Basic) members of this type are safe for
multithreaded operations. Any instance members are not guaranteed to be
thread safe."
I have 2 questions:
1. I thought dynamic variables are thread-safe...
| |
by: jbzdak |
last post by:
Recently, I have been learning Java (it is one of laboratories on my
department), well I know Java is awfully slow, but it is not the point
that I'm interested.
Java has a keyword "interface. (and if you know what it is skip this
paragraph), that is an abstract class, whose every function is public
and purely virtual, and every field is...
|
by: google |
last post by:
Is it possible to add a class, coded within a separate .cs file, that
is available only within the project?
I hope that is clear. In more detail - I want to write a DLL for
distribution that exposes one public class. I have some utilities
classes that I would like to use in my public class but not expose to
the end user. I was hoping...
|
by: Chris Lasher |
last post by:
A friend of mine with a programming background in Java and Perl places
each class in its own separate file in . I informed him that keeping
all related classes together in a single file is more in the Python
idiom than one file per class. He asked why, and frankly, his valid
question has me flummoxed.
I tried to rationalize this Python...
|
by: fgh.vbn.rty |
last post by:
Hi,
I'm not sure if i'm asking the question correctly but anyway here it
is.
Say I have 3 classes - class A, class B, class R.
1) A and B are the building blocks and R is like a repository that
stores objects of A and B.
2) A is at the lowest level and should "know about" only other As. B
should know only about As and other Bs.
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
| |
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...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |