HighTechTalks DotNet Forums  

Re: Accessing COM+ object

Dotnet Distributed Applications microsoft.public.dotnet.distributed_apps


Discuss Re: Accessing COM+ object in the Dotnet Distributed Applications forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bernd Junk
 
Posts: n/a

Default Re: Accessing COM+ object - 06-30-2003 , 06:19 AM







LS, Thanks a lot for these hints.
My problem should be solved with that.

"LS" <ls (AT) easysoft (DOT) pt> wrote

Quote:
Hello

See if this helps:

You can test this in thee following way:

1. Add a reference to Microsoft Word Object Library, look
in the COM tab

MSWORD8.olb Office 97
MSWORD9.olb Office 2000
MSWORD10.olb Office 2002 (XP)

then you'll have "Word" in your references
(Interop.Word.dll)

Make sProgID = "Word.Application"
sServer = "" or "YourPCName" to Instanciate a Word
Server in your PC

sServer="RemotePC" to instanciate a Word Server on a
Remote PC

Use DComCnfg.exe on the REMOTE machine to give access and
launch permissions to "Word Document" object

You also need to tell that the User who launchs the
WinWord.exe will be the interactive user not the caller.
This is in DComCnfg.exe, also. Or otherwise give
permissions to the caller user.


Now you only need to run a test, like this

' Local call
dim rw as Word.Application

rw = CType(ZCreateObject("Word.Application", ""),
gettype(Word.Application))

rw.Visible = TRUE



' Remote call

rw = CType(ZCreateObject
("Word.Application", "RemotePCName"), gettype
(Word.Application))
rw.Visible = TRUE



' Create Object and Get error
Public Function ZCreateObject(ByVal sProgID As
String, ByVal sServer As String) As Object

Try
' Call the VB runtime CreateObject function
If IsStrNull(sServer) Then
' Local
ZCreateObject = CreateObject(sProgID)
Else
' Remote
ZCreateObject = CreateObject(sProgID,
sServer)
End If
Catch e As Exception
' return the error with the name of the object
'that could not be created
RaiseExcep("CreateObject Wrapper ProgId: '" &
sProgID & "' Machine: " & sServer & _

vbCrLf & vbCrLf & e.Message, e)
End Try
End Function



LS


-----Original Message-----
Hi NG,

I have a quite simple question for you.
What is the easiest way to connect to a COM+ object on a
remote machine.
Accessing the object on a local system is no problem, by
adding a reference,
but how can I tell the app to look for the object not on
the local, but on
the remote machine.
Is there a special setting that has to be made in the
applications
..conf-file?

Thanks,

Bernd


.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.