DCOM and VB6.0 SP3 and NT4.0 SP5

I have created a DLL with VISUAL BASIC 6.0 SP3 and registered it within MTS (Microsoft Transaction Server).

Then I have created an EXE project in VB and called the methods in the DLL above like this:
dim xDll as object
set xDll = CreateObject  
           ("PubsMTS.Authors")
call xDll.GetAuthorInfo("12")

which work great... :-)

Now I want to run the DLL on the NT-Server from the EXE-program created above. But this time I want to run the EXE program on a client computer (Windows 95) and use the DLL/Method on the Server with DCOM technology.

Have found two articles describing how to do this on the following URL's
http://support.microsoft.com/support/kb/articles/
and then Q161/8/37.asp and Q191/7/66.asp

but my problem is that both this articles deals with VB5.0 and the description on how to setup the client does not work for my VB6.0

Can anyone give me a step by step instruction on how to create installation files that can be installed on the client computer so it will work???? or a reference to an articel on Internet that does?????

Happy new year

Erot

erotAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

brsltdCommented:
All you need to do is Export the MTS package that you added the DLL to.  This will create a subdirectory called \clients from the path of the package.

In here, MTS will create an exe file (You name it when you export it) which you need to browse to FROM THE CLIENT PC, and then double-click.

This will make the necessary registry entries for you and all should be well.
0
twolCommented:

As long as you've already installed the dll on the server, just do the following:


dim xDll as object
CreateObject("PubsMTS.Authors","servername")
call xDll.GetAuthorInfo("12")


....where servername is the name of your server. Does the GetAuthorInfo return anything?

if so....let's say it returns a recordset, you can code like you normally would..

dim rsSet as adodb.recordset
..
..
..
rsset = xDll.GeteAuthorInfo("12")




0
erotAuthor Commented:
To twol!!!!
I did what you said but when I try to run the VB-EXE file...the procedure that actually makes a call to the DLL on the SErver I get the following error:

Run time error '463'.
Class not registered on local machine

erot
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

erotAuthor Commented:
to brsltd   !!

I did what you said but:
When I try to export I get the following error message after hitting the Export buttong in the Export dialog box:

An error occured accessing components in the system package on this computer.
Error code was 80110422. Make sure that:
Microsoft Transaction server is installed correctly.
If you have set a spesific identity for the system package, check that the user account and password are correct, and user is a member of the local NT Administrators group.

????

erot
 
 
0
brsltdCommented:
That error can be caused if there is security set on the system package (How MTS controls itself).  

Have a look in MTS, under Computers\My Computer\Packages Installed     you should see the system package.

Click on it, then right click on it and select properties.  Go to the Identity tab and see what the settings are.  If "This User" is checked, make sure the ID and password are correct; otherwise select the "Interactive User" checkbox.  It's also probably worthwhile making sure the "Enable Authorisation Checking" checkbox is NOT checked on the Security tab.

If you're still getting that error, have a word with your support guys as it could require MTS to be reinstalled.

Hope that helps.
0
brsltdCommented:
That error can be caused if there is security set on the system package (How MTS controls itself).  

Have a look in MTS, under Computers\My Computer\Packages Installed     you should see the system package.

Click on it, then right click on it and select properties.  Go to the Identity tab and see what the settings are.  If "This User" is checked, make sure the ID and password are correct; otherwise select the "Interactive User" checkbox.  It's also probably worthwhile making sure the "Enable Authorisation Checking" checkbox is NOT checked on the Security tab.

If you're still getting that error, have a word with your support guys as it could require MTS to be reinstalled.

Hope that helps.
0
erotAuthor Commented:
Now I manage to export but:

When I Export I choose to export to
a:\PubsMTS-Client

Then the Export facility creates two files:
PubsMTS-Client.MSI
PubsMTS-Client.MSI.cab

There in no subdirs created at the Package in the MTS called /Clients...

No exe-file is created... ???
Any suggestions...
0
erotAuthor Commented:
Forgot to tell that if I extract the cab-file then I get two files: one .MSI file and one .INF file...

the .inf file contains:
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Setup Hooks]
hook1=hook1
[hook1]
run=msiexec.exe /i "%EXTRACT_DIR%\PubsMTS-Client.MSI"

This really does not tell me much
0
erotAuthor Commented:
I have now finally made it work.
I did manage to export the package, but I have not found out how to install the exported package on the client!!!

However... the method described by twol
did work but????

At first I got the error message that the Class was not registered on the local machine...

Then i used regsvr32.exe to register the DLL on the remote server. Which worked... I can also see that the DLL is running through the MTS because the round Icon with the green cross is spinning....

BUT is this the right way to
A) Register the DLL with regsvr32.exe ??
B) To use DCOM???
Will this handle multiple simultanous users using the same DLL????

Erot
0
brsltdCommented:
I'm glad it worked at last, although the MSI files are something new to me....possibly due to it being removable media.  Normally you'd export it to the same place as the DLL resides.

To register the DLL via the exported exe, browse to it from your client machine (as above) then double click it.  It will do all the DCOm settings for you.  There's nothing too wrong with using regsvr32, except that I'd only use it for client side components that don't have tlb's and don't run remotely.  

The code you have is ok for pooling via MTS, but you won't be able to use transactions unless you use Set Myobj =ObjectContext.CreateInstance("Classname").
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
twolCommented:
I'm glad you got it to work...A good book that will help round out your knowledge of both COM and some MTS is VB Comm by Thomas Lewis.
0
twolCommented:
I'm glad you got it to work...A good book that will help round out your knowledge of both COM and some MTS is VB Comm by Thomas Lewis.
0
erotAuthor Commented:
Thanks a lot ....
I wish I could split the points in two and give them to both of you....

Since BRLSTD was first out and his answer worked then he gets the points..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.