You can implement a interface (IHello) to your Hello component
(ServicedComponent) :

using System;
using System.EnterpriseServices;
using System.Reflection;
using System.Runtime.CompilerServices;
 
[assembly: AssemblyKeyFile(@"..\..\hello.snk")]

[assembly: ApplicationName("MyHello")]
[assembly: ApplicationActivation(ActivationOption.Server)]


public interface IHello //interface
{
        string HelloWorld();
}

[ObjectPooling(true,3,30)]
[Transaction(TransactionOption.Disabled)]
public class Hello  : ServicedComponent, IHello
{
        public string HelloWorld()
        {
                return "Hello, World!";
        }
}

In VB6, you can use the interface:

  Private Sub Form_Load()

    Dim x As IHello 'interface

    Set x = New Hello

    MsgBox x.HelloWorld()

    Set x = Nothing

  End Sub

Ok,

Fabio Galuppo

-----Original Message-----
From: Brooke Philpott [mailto:[EMAIL PROTECTED]] 
Sent: terça-feira, 28 de maio de 2002 16:29
To: [EMAIL PROTECTED]
Subject: [DOTNET] using enterpriseservices based components in vb6

I have successfully created a component in c# that uses
EnterpriseServices for object pooling, however I noticed that when I
tried to call the object from vb6 I was not able to use intellisense.
Upon further inspection it seems that the the test method was not
exported to the .tlb

 

The method I was testing is:

 

public string HelloWorld() { return "Hello World!"; }

 

Is there anything "special" I have to do to get these to export?

 

Thanks,

-Brooke

 

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to