CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Active X EXE

  1. #1
    Join Date
    May 2002
    Location
    London
    Posts
    10

    Question Active X EXE

    I need to be able to reference and object whose instance is running
    within another application(in VB6 I would use an ActiveX EXE).

    To explain better. I have a DLL that is called by the trigger in MSMQ.
    This needs to use an object called Restaurant. Therefore an instance
    of Restaurant needs to be in memory at all times. To do this we are
    attempting to write a Windows Service that holds the instance of the
    Restaurant object. We will then use GetObject (or the .NET equivelant)
    to reference the Restaurant object. The problem I am having is that
    GetObject returns an error saying it can't find an instance of the
    object, and can find no help in MSDN for any .NET equivelants.

    Does anybody know how to do this in VB.NET?

    Cheers

    Andy
    [email protected]

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    I'm having the same problem. I think I've found a solution with object pooling, but haven't gotten it to work yet, so don't have an example. One was included with .NET but I can't get it to work either. Anyway, read up on the Object Pooling stuff and see if you have any luck.

  3. #3
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    I finally got a simple example to work, this process will start with the first application that requests it and end when the last reference to it is lost. It returns the same shared object to all Callers:

    Imports System.EnterpriseServices
    Imports System
    Imports System.Windows.Forms
    Imports System.Reflection
    'Sets the assembly Name
    <Assembly: ApplicationName("Svr1")>

    '***** KEY TO Out-of-Process
    'Tells it this is an out-of-Process server
    'The other option is Library with means create in-process
    <Assembly: ApplicationActivation(Activationoption.Server)>
    'Key pair used to sign the assembly
    <Assembly: AssemblyKeyFile("c:\net\svr\Svr1.snk")>

    Public Class SvrCls
    Inherits ServicedComponent
    Shared m_Var As String
    Shared Sub New()

    End Sub
    Public Property VarValue() As String
    Get
    VarValue = m_Var
    End Get
    Set(ByVal Value As String)
    m_Var = Value
    End Set
    End Property
    End Class

  4. #4
    Join Date
    Apr 2002
    Location
    WA
    Posts
    34

    of cause it seems working but ...

    under any working environment condition, we may not have IIS server. I install MSMQ component, but running time requires local IIS server. and this appplication looks like that. If I am wrong, please correct me. I am looking for MSMQ sample under .NET Framework without IIS server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured