?
Solved

DCOM and VB6.0 SP3 and NT4.0 SP5

Posted on 1999-12-29
13
Medium Priority
?
850 Views
Last Modified: 2008-03-04
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

0
Comment
Question by:erot
  • 6
  • 4
  • 3
13 Comments
 

Expert Comment

by:brsltd
ID: 2312199
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
 
LVL 7

Expert Comment

by:twol
ID: 2312211

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
 

Author Comment

by:erot
ID: 2312309
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

Author Comment

by:erot
ID: 2312398
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
 

Expert Comment

by:brsltd
ID: 2312439
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
 

Expert Comment

by:brsltd
ID: 2312440
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
 

Author Comment

by:erot
ID: 2312680
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
 

Author Comment

by:erot
ID: 2312694
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
 

Author Comment

by:erot
ID: 2314195
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
 

Accepted Solution

by:
brsltd earned 1200 total points
ID: 2314375
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
 
LVL 7

Expert Comment

by:twol
ID: 2314581
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
 
LVL 7

Expert Comment

by:twol
ID: 2314582
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
 

Author Comment

by:erot
ID: 2326654
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question