Click to See Complete Forum and Search --> : Active X EXE


awakener
July 31st, 2002, 04:05 AM
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
aoakey@blueprint.net

DSJ
July 31st, 2002, 02:11 PM
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.

DSJ
August 1st, 2002, 01:58 PM
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

nicepat
November 10th, 2003, 05:02 PM
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.