I don't know where to begin 
Author Message
 I don't know where to begin

Okay, I'm totally lost in my current endeavor.  I've written a program that
exports data off our legacy unix database and imports it into a SQL server.
Right now, it runs as one program and there are several points of failure.

I've already split out the export and import processes into seperate
programs that run as activex exe's.  What I would like to do is create a
console type application that would control/monitor it.  In addition to
being able to open the console, and have the console instantiate the
servers, I want to run the servers, and then open the console and have it
tell me what's going on.

I guess that brings me to the point of the post.  How do I go about
connecting to servers that are already running?  Like Set MyObject =
Server.ExistingSession?

The best example I can think of is Outlook.  Outlook exposes itself with its
methods, properties, and events.  And you can either create a new session,
or connect to one if outlook is already open.

ANY help would be appreciated.  I don't know what questions to ask so its
very difficult to search for help.  Thanks for your time and sorry for the
long post!!

JT Autry



Sat, 08 May 2004 11:59:29 GMT  
 I don't know where to begin
Create two classes in your EXE server. Make the first class Multiuse and
implement a property that returns reference to single instance of the server
class from a global variable:

' client code

Dim oConnector As New Connector
Dim oServer As Server
Set oServer = oConnector.Server

' server code in modMain

Public g_oServer As Server

' server code in Connector class

Public Property Get Server() as Server
  If g_oServer Is Nothing Then Set g_oServer = New Server
  Set Server = g_oServer
End Property

Needless to say that ActiveX EXE must be single-threaded to ensure that only
one instance of global variable exists.

If you are familiar with VC++ programming, you can override
IClassFactory::CreateInstance to achieve complete transparancy, so that
client apps will always get the same object instance from CreateObject
function.

Regards,
Dmitriy Zakharov.
Brainbench MVP for Visual Basic
http://www.brainbench.com


Quote:
> Okay, I'm totally lost in my current endeavor.  I've written a program
that
> exports data off our legacy unix database and imports it into a SQL
server.
> Right now, it runs as one program and there are several points of failure.

> I've already split out the export and import processes into seperate
> programs that run as activex exe's.  What I would like to do is create a
> console type application that would control/monitor it.  In addition to
> being able to open the console, and have the console instantiate the
> servers, I want to run the servers, and then open the console and have it
> tell me what's going on.

> I guess that brings me to the point of the post.  How do I go about
> connecting to servers that are already running?  Like Set MyObject =
> Server.ExistingSession?

> The best example I can think of is Outlook.  Outlook exposes itself with
its
> methods, properties, and events.  And you can either create a new session,
> or connect to one if outlook is already open.

> ANY help would be appreciated.  I don't know what questions to ask so its
> very difficult to search for help.  Thanks for your time and sorry for the
> long post!!

> JT Autry



Mon, 10 May 2004 03:54:55 GMT  
 I don't know where to begin


Quote:
> Okay, I'm totally lost in my current endeavor.  I've written a program
that
> exports data off our legacy unix database and imports it into a SQL
server.
> Right now, it runs as one program and there are several points of failure.

> I've already split out the export and import processes into seperate
> programs that run as activex exe's.  What I would like to do is create a
> console type application that would control/monitor it.  In addition to
> being able to open the console, and have the console instantiate the
> servers, I want to run the servers, and then open the console and have it
> tell me what's going on.

> I guess that brings me to the point of the post.  How do I go about
> connecting to servers that are already running?  Like Set MyObject =
> Server.ExistingSession?

> The best example I can think of is Outlook.  Outlook exposes itself with
its
> methods, properties, and events.  And you can either create a new session,
> or connect to one if outlook is already open.

> ANY help would be appreciated.  I don't know what questions to ask so its
> very difficult to search for help.  Thanks for your time and sorry for the
> long post!!

> JT Autry

Make a interface to expose the object you want to connect to.
Set oServer = new ServerConnect
Set  oObject = oServer.GetReference

In the Server class exposed by the ActiveX server
Public Function GetReference() as CExistingSession
    'Sett a reference to a existing object stored in a local variable
    Set GetReference = goExisitingSession
End Function

Be aware of sircular references.

Regards
Staale Flock



Sat, 08 May 2004 23:50:11 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help-don't know what i'm missing

2. Don't know if i'm in the right newsgroup

3. Don't Know How to Publicly Declare Variable

4. Microsoft Windows 95 don't know calculation

5. Migration to VS 2003 worked though I don't know why

6. Don't tell me no one knows the answer

7. does anybody know why this code don't work

8. Importing files-don't know please help.

9. Don't know how to print Invoice with DATAreport

10. I don't know what happen....

11. I don't know how to print

12. I don't know why..

 

 
Powered by phpBB® Forum Software