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

Method not found in the Com Object

hi,
I have created one Component using C#. it have once
class name is BusinessObject. In this class i have one
method "CreatedRecords". When i make the build it created
ComponentName.dll file in the obj\Debug and bi\Debug
directory.
Then i have executed gacutil /i ComponentName.dll
It displayed message saying that Cache successfully added.

In my Web application I have selected this dll reference.
(i tried both obj\debug\Compnentname.dll and
bin\Debug\Componentname.dll)

when i create the instance i have used following statment.
CompnentName.BusinessObject myTest = new
CompnentName.BusinessObject();

But when i try to access CreateRecords method by using
following statment
myTest.CreateRecords();
it is not able to list the method name. In the component
services also CreateRecords method not listed. I have
created this method using "Public" key word in Component.
So it should list this method name when i use instance of
this object. Can any body knows about this problem.?

-Ramesh

Thanks
Ramesh

Nov 15 '05 #1
1 3108
Hi Ramesh,

I have written a demo for you. You may have try and let me know the result.

[Client]
using System;
namespace ConsoleApplication6
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
ClassLibrary3.Class1 o = new ClassLibrary3.Class1();
Console.WriteLine(o.testMethod(10));
}
}
}

[Component]
using System;
namespace ClassLibrary3
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Class1
{
public int testMethod(int nCount)
{
return nCount*nCount;
}
}
}
Did I misunderstand your meaning?
Please feel free to let me know if you have related question.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Ramesh" <jr*****@hotmail.com>
Sender: "Ramesh" <jr*****@hotmail.com>
Subject: Method not found in the Com Object
Date: Tue, 2 Sep 2003 22:05:12 -0700
Lines: 33
Message-ID: <06****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNx2PQzZ7ZigjuJTJuJ8fc2sg31kg==
Newsgroups: microsoft.public.dotnet.languages.csharp
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:181758
NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

hi,
I have created one Component using C#. it have once
class name is BusinessObject. In this class i have one
method "CreatedRecords". When i make the build it created
ComponentName.dll file in the obj\Debug and bi\Debug
directory.
Then i have executed gacutil /i ComponentName.dll
It displayed message saying that Cache successfully added.

In my Web application I have selected this dll reference.
(i tried both obj\debug\Compnentname.dll and
bin\Debug\Componentname.dll)

when i create the instance i have used following statment.
CompnentName.BusinessObject myTest = new
CompnentName.BusinessObject();

But when i try to access CreateRecords method by using
following statment
myTest.CreateRecords();
it is not able to list the method name. In the component
services also CreateRecords method not listed. I have
created this method using "Public" key word in Component.
So it should list this method name when i use instance of
this object. Can any body knows about this problem.?

-Ramesh

Thanks
Ramesh


Nov 15 '05 #2

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

Similar topics

4
by: Ruud de Jong | last post by:
The question I have is: how safe / future proof / portable is the use of the __subclasses__ method that exists for new-style classes? Background: I thought I had found an easy-to-understand...
10
by: lkrubner | last post by:
I killed last night and a good chunk of today trying to figure out this one particular attempt to get a class and initialize it. My code is using a class method called getObject to include() a file...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
12
by: Rubbrecht Philippe | last post by:
Hi there, According to documentation I read the ArrayList.IndexOf method uses the Object.Equals method to loop through the items in its list and locate the first index of an item that returns...
4
by: Trapulo | last post by:
I've an exe that creates an object with reflection using Createinstance. All ok. Then I call method in this object, that returns a user-defined control. This code is executed. I've very strange...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
4
by: ddtl | last post by:
Hello everybody. Consider the following code: class A(object): def met(self): print 'A.met' class B(A): def met(self):
1
by: Jan | last post by:
When I use Type.InvokeMember from my remoting server object I get a MissingMethodException: "Method '<namenot found.". My code works when the code is called normally, but not when executed from...
7
by: heavyone | last post by:
I am trying to write a removeFirst method for an ArrayList of the generic type. The removeFirst method is supposed to do a few things: 1) If the list is empty it throws an error. 2) It stores the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
jinu1996
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...
0
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...
0
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...

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.