Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Create Object problem

Posted on 2002-07-30
14
194 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

839 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