PDA

Click to See Complete Forum and Search --> : Calling Dll from Client


Dec 20th, 2000, 04:35 AM
Hi Everybody

I have created Activex dll on my server and deployed in MTS.
I have created package and export it to client machine.
At Client machine I run the package and get the dll in References.

when I start new project and include dll in my project and write following code I get error

public Rsc as dll
set rsc = new dll

At 2nd line i get following error

1.Automation Error
2.Remote Server not Available
3.ActiveX component can't create object.

Pls suggest me on following errors.I will be very thankful to u.

Thanks in Advance

Sajid

Dec 21st, 2000, 07:35 AM
I explane to you the steps of work

1.) install the dll on the MTS- Server
2.) Exporte the Package
3.) Run the Client.exe from the MTS on your Client

How to do



sub Call_MTS_DLL

Dim MyObject as object,RetVal as string

set MyObject=CreateObject("MTSDLLName.ClassName")

Retval=MyObject.GetName()

set MyObject=nothing

End Sub



Important: You can't declare the class as Public Object ore as Module Object. Please use the MTS- classes only in your procedures ore functions, because the featcher of MTS is to make a sharing with the Instances from the dll. That mean you haven't always the same instance ore thread!!!. So it's not possible to hold some data in your MTS- class because you will lost it.

finaly:
1.) don't work in your MTS- Dll with property
2.) don't work in this dll's with Global ore Modul- variables
3.) don't set parameters in Class_Initialize ore Class_Terminate()
4.) don't call functions ore subs in Class_Initialize ore Class_Terminate()
5.) don't hold informatons in your dll (for example an ADO- Recordset some else)

if you have more questions send me a mail to maexchen@kabelnet.at

Dec 22nd, 2000, 12:13 AM
Thanks MaexChen

I Tried the Way u have suggested.But Still Facing a Problem
On this line of code :

set MyObject=CreateObject("MTSDLLName.ClassName")

Error is "Automation Error".

Should I add References to a MTS DLL Which i have registerd on Client Machine, or any other Dll.Or should I Set Dll Property.

And do u know Clireg32.exe.Before using MTS I tried to create DCOM by using this Function.

What I did is,I created a dll with Binary Cpatibility yes,and Remote Server Files Yes.Then I made DLL.
So one .vbr and .tlb files got created with the same name as my Dll name.

Now I want to Make my dll as DCOM, So I Use following Procedue:

1. I run clireg32 .
2. Selected DCOM and there It ask for Network Address, So there I have given full path of my .VBR Files

Eg. "\\Winnt\c\test\Bussiness.vbr"

But There I am getting this Error:

".VBR files can't be open"

Pls Suggest as My Boss want me to finish this by weekend.

Thanks
Bye
Sajid