Solved

Create Object problem

Posted on 2002-07-30
14
191 Views
Last Modified: 2013-11-13
I have Nt Server and there i run the server side programe  which handles the database read write ( seperate functions). How can i execute those functions in my client computer.

any one with a complete example pls.

Myserver name is KGMSERVER
0
Comment
Question by:ackid32
  • 6
  • 4
  • 2
  • +2
14 Comments
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7187765
Maybe look into using WINSOCK
One event using WINSOCK is DataArrival
Get Client side program to send function name to server side program

Have a Select Case staement in your Server side program in the DataArrival event which calls functions

Select Case

 Case "Function1Called"
0
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7187770
At the following link there is an example of using WINSOCK for client server apps

http://www.dcs.napier.ac.uk/~bill/vb_winsock.htm
0
 
LVL 4

Expert Comment

by:gencross
ID: 7187774
Is this a COM component(DLL, EXE)?  If so, why not just register the component on the client machine, then you can use the public functions in it.

Please let me know if I am off base, or you need more information.
0
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7187776
You can also use DataArrival event in your client program to call those functions on your client computer.
For example I have a server program that talks to a client app on my client computer to give an alert.

The client app in the DataAriival event checks for a certain string like "ServerMalfunction"
and then it calls a function which plays a siren.wav file on my client computer
0
 
LVL 4

Expert Comment

by:Nazdor
ID: 7187884
Sounds like DCOM is going to be more usefull than Winsock - but it depends on where the client/server machines are located.

If on the same lan, go with DCOM (as mention by gencross), if over the internet, then you'll need Winsock.

There's not much point giving more detailed information until ackid32 gives us more information.

0
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 7187900
Nazdor/gencross
Yes I agree if on same LAN - DCOM is good
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 7188137
first you need to get vbr and tlb files for your client pc.
Just compile your activex component with remote files checked.
After that you need to use Clireg32 to register them.
And use createobject(”progid.classid”,”servername”) to access your object
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:rkot2000
ID: 7188159
try this sample with all details :

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q161837

p.s you need to send a disconnected recordsets from server to client .

0
 

Author Comment

by:ackid32
ID: 7190029
Gencross,

Yes, how i register the component on the client machine? Please in Detail.
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 7190473
for activex dll you need to run RegSvr32 with path to your dll
like : RegSvr32 c:\winnt\my.dll

for activex exe you need to dbl-click on it.

or you can use setup wizard for this job.



0
 
LVL 5

Expert Comment

by:rkot2000
ID: 7190599
p.s you don’t need to register the physical component on a client machine.
You need to register some information about server component on the client pc.


This article details a method that can be used to ensure that your client application correctly traps for and resolves error 429 at run-time if the ActiveX DLL is present on the machine but not correctly registered.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q173407

This article demonstrates how to use the CLIREG32.EXE utility to manually register remote Visual Basic components on the client machine.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q194636
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 7190604
one more if you have an activex dll you need to use mts or com+ to host it.
0
 
LVL 4

Accepted Solution

by:
gencross earned 300 total points
ID: 7190870
Sorry I did not get back with you, I have been out...

ackid32,

rkot2000 is providing good information, although it is getting a little too complicated.

Register the component on the client machine using regsvr32 as rkot2000 stated above.  This is all that must be done to use the component on the client.

On the server you should use MTS (NT 4.0) or Component Services (Win 2000) to host the component.  This will make life much easier.  To do this in Win 2000 just open Component Services and follow the directions on installing a new package.  This will run the component in a separate process, allowing you to take it in and out of memory, for example if an error occurs in the component the only way to get it out of memory is to reboot the server if you don't use these.
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 7190913
with mts or com+ you can create a client config.exe(application proxy)
this exe can configure client pc to work with your server.

but for activex exe you need to use clireg32
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now