Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Instantiating object of dll in user account. Windows Server 2008 1

Status
Not open for further replies.

Dilemma1980

Programmer
Sep 7, 2010
12
US
We have a server using Windows Server 2008. It has one admin account and other user accounts. Each user connects to the server using terminal services (using thin clients), which allows them to have their own desktop in the environment. This is a continuation of a previous question I had, but this is what I'm trying to do:

We have a set of COM dlls that were registered using the admin account. We also have custom VBA code that would utilize the dlls to perform tasks. When we try this on a standalone machine, it works fine. In this particular scenario we can not seem to get the dlls to become available under the user accounts. We tried giving the user complete access to the relevant directories, registering the dlls under the user accounts (gives error), and even changing the user account into an admin account. No luck. Here is the code:

Code:
Option Explicit
Option Private Module

Sub test()

Dim oTemp4 As Object


Dim Send_String As String
Dim TOKEN As String
Dim Diff As Integer
Dim RETURNED As String

ChDrive ("C")
ChDir ("C:\Program Files (x86)\GRC Tools\User\GRC Database Information\GRCToolsDLL")
Set oTemp4 = CreateObject("grccountry.grccountry")

            oTemp4.Init
            oTemp4.GRCCOUNTRYINIT
           
            Send_String = "ANZENGRUBERGASSE 4-4" & "|" & "" & "|" & "" & "|" & _
                            "WIEN" & "|" & _
                            "" & "|" & _
                            "1050" & "|" & "DE"
                           
            oTemp4.grccountry Send_String, 15, _
                                True, True, True, True, False, False, True, _
                                1, TOKEN, Diff, RETURNED
                               
            Debug.Print RETURNED
           
oTemp4.GRCCOUNTRYCLOSE
           
oTemp4.ReduceMemory

Set oTemp4 = Nothing
           
End Sub

The error happens at:
Code:
Set oTemp4 = CreateObject("grccountry.grccountry")

The error is: Run-time error '-2147467259 (80004005) Unspecified error Automation error

I did some research, and this error seems to be non-specific. Can someone help? We can't seem to figure out what we're doing wrong. Thanks so much.
 
This sounds like a job for the VBScript forum, as opposed to the VBA forums.
 
Mainly because the guys there have so much more experience with having to run various applications from code. They may just be able to point you in the right direction, even if VBA may not be their area of expertise.
 
>Mainly because the guys there have so much more experience with having to run various applications from code

???

On what do you base that assertion?

>Anyone?

Have you tried contacting the author, Graham Rhind? I have a feeling that GRCTools was never tested under Terminal Server, and certainly not under W2k8 Server ...
 
I realize that what I'm trying to do is a relatively new concept with GRCTools, but I wanted to try and solve it myself. Also, I don't think the problem is with his dlls. The instantiating works fine in an admin account but doesn't seem to work on a user account on the same machine. To me that's a little beyond the scope of his responsibility and more of an OS issue. I was just hoping that someone tried this before.
 
To me that's a little beyond the scope of his responsibility and more of an OS issue."

I agree. Which is why it is not likely a VBA issue. VBA is not generally concerned with installing or accessibng DLL. It is assumed the libraries are there to be used.

Technically, yes, you can use VBA to fire regsvr32 to set up DLL, but it sure is not a common thing to do.

"registering the dlls under the user accounts (gives error), and even changing the user account into an admin account. No luck."

This seems very strange. "gives error"...WHAT error?


unknown
 
This is the error:

The module "C:\Program Files (x86)\GRC Database Information\GRCToolsDLL\grccountry.dll" was loaded but the call to DllRegisterServer failed with error code 0x80004005
 
Ah, one of those overtly meraningful error messages.


unknown
 
But is not a DLL registered to the OS? Are there DLL registered to a specific user? I can understand registering requiring Admin access, as you are registering an executable piece of code. Fine. But once it is registered to the OS... is it not registered?


unknown
 
That's what I thought fumei, but I'll try using Gruuuu's method.
 
I tried running cmd.exe as an administrator and register the dlls that way, but I got the same error.
 
>Are there DLL registered to a specific user?

They can be, yes.

 
Right now the dlls are registered under the admin account.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top