Solved

DCOM  implementation in Visual Basic 6.0

Posted on 2001-06-18
18
267 Views
Last Modified: 2013-11-25
How can i implement DCOM using VB 6.0 ?
i.e. I want to register .dll component on server and
access that componenet from different client machines
connected in LAN. So how can i achieve this? Please
tell any method/code for implementing this.
0
Comment
Question by:shahsaurabhu
[X]
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
  • 5
  • 4
  • 3
  • +5
18 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6202163
Create a component in Visual Basic. Then add that component to MTS on the server. Once you have succesfully done that you can export the package from MTS. If you export it correctly, a .exe file will be created. Copy that file to all client machines and run it. Now the clients know where the component is located in the network and you can use it. (and thus DCOM is configured)

regards,
CJ
0
 
LVL 2

Expert Comment

by:chandukb
ID: 6202601
0
 
LVL 5

Expert Comment

by:gbaren
ID: 6202640
You need to create an ActiveX EXE project. When you use the Package and Deployment Wizard on it, it will prompt you, asking whether you want to include remote automation support files. A DCOM object must be in an EXE, not a DLL.

On the client, you'll need to use the second parameter of the CreateObject(obj,server) call.

CJ suggested MTS. I just want to clarify. You can use MTS or COM+ if you have it installed on the server, and it will be more efficient than DCOM. If you do, however, your project needs to be ActiveX DLL. You can not install an out of process ActiveX (ActiveX EXE) under MTS.
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:shahsaurabhu
ID: 6205214
To CJ
as mentioned by u, i have run exe files on client machines.
but how to instantiate the object of the component registered on MTS server.
I have used CreateObject(object,servername) method.
here what will be the value of these two parameter.
will this method work?
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 100 total points
ID: 6205354
You can do that the exact same way as you would normally do. However, the best way to instantiate the object is just by calling the CreateObject() function. Using the way I explained above you can ommit the second parameter.

Set myObject = CreateObject("DLLNAME.CLASSNAME")

You can also use the
Dim myObject as DLLNAME.CLASSNAME
or
Dim myObject as New DLLNAME.CLASSNAME

But the first approach is the best one.

Regards,
CJ
0
 

Expert Comment

by:nomulap
ID: 6211635
comment removed by Moderator
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6211752
What is your purpose in posting this as the proposed answer, numulap?  I will reject your proposed answer, and delete the comment.  Please read the Member Agreement here that you agreed to as well as the information here on Answers versus Comments:

http://www.experts-exchange.com/jsp/infoMemberAgreement.jsp

http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6211757
Deleting proposed answer comment "jkljlk"

Moondancer
Community Support Moderator @ Experts Exchange
0
 

Expert Comment

by:nomulap
ID: 6211821
Apologize to every body, I thought the question was locked and it would not let me propose another answer.
0
 
LVL 5

Expert Comment

by:gbaren
ID: 6212016
You shouldn't propose answers anyway. Post comments unless you think your oppinion is way more valuable than all those comments already posted before you.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6212119
Why did you do a COMPLETE removale of that comment, and not only rejecting it?????? Looks a bit weird in this question...

Regards,
CJ
0
 
LVL 5

Expert Comment

by:gbaren
ID: 6212126
The comment was gibberish. "jhjhjh" or something like that.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6212136
aight :-)
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6215808
Only function available for that line item was what I used, reject and edit; delete not an option to maintain activity trail for locked/rejected answers.

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6215952
gbaren is correct, that was what I overwrote.

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6228591
hi shahsaurabhu,
hi everybody else,

i dont want to intrude but...

shahsaurabhu, please follow up your open q's.
U have asked 9 questions, and have not graded 1.

cheers
Ricky
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6755093
I have finalized this today.  If there are questions about this decision, please comment here.

Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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
Course of the Month8 days, 22 hours left to enroll

615 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