473,670 Members | 2,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.d ll file in the obj\Debug and bi\Debug
directory.
Then i have executed gacutil /i ComponentName.d ll
It displayed message saying that Cache successfully added.

In my Web application I have selected this dll reference.
(i tried both obj\debug\Compn entname.dll and
bin\Debug\Compo nentname.dll)

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

But when i try to access CreateRecords method by using
following statment
myTest.CreateRe cords();
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 3118
Hi Ramesh,

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

[Client]
using System;
namespace ConsoleApplicat ion6
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
ClassLibrary3.C lass1 o = new ClassLibrary3.C lass1();
Console.WriteLi ne(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*****@hotmai l.com>
Sender: "Ramesh" <jr*****@hotmai l.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: AcNx2PQzZ7Zigju JTJuJ8fc2sg31kg ==
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
Path: cpmsftngxa06.ph x.gbl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1817 58
NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.d ll
It displayed message saying that Cache successfully added.

In my Web application I have selected this dll reference.
(i tried both obj\debug\Compn entname.dll and
bin\Debug\Comp onentname.dll)

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

But when i try to access CreateRecords method by using
following statment
myTest.CreateRe cords();
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
7081
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 application for metaclasses: making classes instantly aware of their subclasses. The context was that I needed a class hierarchy, and I wanted to be able to instantiate subclasses by calling the root class. Which exact subclass would be instantiated...
10
1653
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 and then initialize the class in that file (one class per file, each file has the same name as the class). This code has been working fine for 8 months, and now is dying on this one line. Oddly, it is dying on the last return of this method. ...
28
5205
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(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I don't know at runtime what the child class is? I'm using Activator.CreateInstance() to load the...
12
6730
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 True. Therefore, overriding the Equals method in the class definition of the items I put in the ArrayList should make the IndexOf method use my version of the Equals method?!
4
5431
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 problem in the user-defined control constructor. Some code is executed. This calls mybase.new, initializecomponent, and sets some property on contained panels. Then the constructor calls an internal sub (public or private is the same, I've tried...
18
4730
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 class where only the "searched" property has a value. I expected to get the index into the arraylist where I could then get the entire class instance. However, the 'indexof' is never calling my overloaded, overrides Equals method. Here is the...
4
1716
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
3121
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 the remoting server object. Yesterday I had it working but then I removed a security attribute from my code because I didn't thing it was necessary (it came from an example I found). The attribute was set on both server and client main-method...
7
3815
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 data in a node pointed to by head. 3) Set the head to head's next. 4) decrement the size. 5) returns the data. I can do 1,4, and 5 but I am stuck on 2 and 3. Here is the code I have so far. Please take a look and give me a hint or suggestion:...
0
8386
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8592
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7421
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6216
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4213
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4393
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1795
bsmnconsultancy
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.