OLE Automation Server in VB6

Hi,

I want to create a Ole Automation Server( or called ActiveX now ? ) in VB6.0 .
I want to make my program as a Ole Automation Server, but it should also maintain the capability as a normal .exe program. So, the output should be a .EXE file.

Please give me ALL the processes to create a Ole Automation Server !! For example, when I create a new project, what project type I should choose ? Any other properies I have to change it ?
Please give me the complete coding including the server and client so that I can test it.

Thanx!


Raymond
rngAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
robbertConnect With a Mentor Commented:
You can post a "Points for robbert" question in the VB TA, mentioning this question's number or URL.
Deleting this Q doesn't mean that your points are refunded, immediately - so, you can ask the Community Support to do so.
0
 
robbertCommented:
HOWTO: Create and Use a Minimal ActiveX Component in VB
http://support.microsoft.com/support/kb/articles/Q170/9/46.asp

There are some additional issues that we can discuss when you got this running.
0
 
rngAuthor Commented:
robbert:

According to the article, the first step is:

1. Start a new project in Visual Basic. Choose either ActiveX EXE or ActiveX DLL.

What is the difference between ActiveX EXE and ActiveX DLL ?
Also, "ActiveX EXE and/or ActiveX DLL" does equal to "OLE Automation Server" ? They do the same thing ?
Please help !


Raymond
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
robbertCommented:
The basic difference is that an ActiveX EXE runs in another process than the calling app; an ActiveX DLL runs in the same process.

Some effects:
+ ActiveX EXE throws error. Calling app doesn't receive the error.
While ActiveX DLL throws error; the calling app wouldn't receive it.

+ Calling app ends. Reference to the ActiveX DLL has gone, and the instance of the DLL *should* be destroyed, automatically.
On the other hand, an instance of the ActiveX EXE would still run when the calling app ends, as it runs in a seperate process.

You would choose an EXE.

Additional info:
ActiveX EXEs and DLLs
http://msdn.microsoft.com/library/default.asp?URL=/library/books/advnvb5/ch03_15.htm
0
 
robbertCommented:
What I wrote on errors isn't true.
0
 
rngAuthor Commented:
robbert:

According to the article, the first step is:

1. Start a new project in Visual Basic. Choose either ActiveX EXE or ActiveX DLL.

What is the difference between ActiveX EXE and ActiveX DLL ?
Also, "ActiveX EXE and/or ActiveX DLL" does equal to "OLE Automation Server" ? They do the same thing ?
Please help !


Raymond
0
 
robbertCommented:
Choosing a Project Type and Setting Project Properties
http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconsettingprojectoptions.htm

Choose an ActiveX EXE.
0
 
robbertCommented:
The following is what I would tell you if I was Microsoft:

Creating an ActiveX EXE Component
http://msdn.microsoft.com/library/default.asp?URL=/library/devprods/vs6/vbasic/vbcon98/vbconcreatingoleserver.htm
0
 
rngAuthor Commented:
robbert:

According to the article, the first step is:

1. Start a new project in Visual Basic. Choose either ActiveX EXE or ActiveX DLL.

What is the difference between ActiveX EXE and ActiveX DLL ?
Also, "ActiveX EXE and/or ActiveX DLL" does equal to "OLE Automation Server" ? They do the same thing ?
Please help !


Raymond
0
 
rngAuthor Commented:
robbert:

If I make my application as a ActiveX EXE, then does it maintain the capability as a NORMAL .EXE program ?


Raymond
0
 
rngAuthor Commented:
Actually, I am working on the Ole Automation in Nagivator now, however, I don't know how to implement the following in VB6 :

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
PROTOCOL.ODL

uuid(00000000-0000-0000-0000-000000000000), version(1.0) ]
library OleExampleProtocolHandler
 {
 //  For the Windows 16-bit version, the following line should be
 //  importlib("stdole.tlb");
 importlib("stdole32.tlb");

[ uuid(00000000-0000-0000-0000-000000000000) ]
dispinterface IExampleProtocolHandler1
{
        properties:

         methods:
                  [id(1)] short Initialize(BSTR pProtocol, BSTR pUrl);
                  [id(2)] void Open(BSTR pUrl);
};

[ uuid(00000000-0000-0000-0000-000000000000) ]
coclass ExampleProtocolHandler1
{
           [default] dispinterface IExampleProtocolHandler1;
};
};
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Do you know ???  Because I know very little about Ole Automation.
If I can implement the above thing in VB6, I think I can solve my problem !!
You can find more in:                    http://developer.netscape.com:80/docs/manuals/communicator/OLE/ole6obj.htm#protocolodl

Surely, If you can implement it, I will give you the points.
Thanx !!


Raymond
0
 
robbertCommented:
If you have gone through the step-by-step instructions on building an ActiveX EXE above, you're already at a point. - But I don't know where you currently are.

> If I make my application as a ActiveX EXE, then does it maintain the capability as a NORMAL .EXE program

No. Menu: Project, Properties. Tab: Component. - Start Mode: Standalone.

> Actually, I am working on the Ole Automation in Nagivator now, however, I don't know how to implement
the following in VB6

That's not developing an ActiveX app, it's calling one. - What's your goal with this question in non-technical terms?
0
 
rngAuthor Commented:
Robbert:

Actually, I want to implement a External Protocol Handler for Netscape Navigator. You can find more information here:
http://developer.netscape.com/docs/manuals/communicator/OLE/ole5pro.htm

As you can see in the above link, the External Protocol Handler should have these methods:

short Initialize(LPCTSTR pProtocol, LPCTSTR pUrl);
void Open(LPCTSTR pUrl);

However, I don't know how to do it in VB6.
Can you help me ??
Thanx!


Raymond
0
 
robbertCommented:
That's still technical terms. First, you wanted to build an ActiveX Server, now you want to implement a specific interface that was for NN v1.1. I can't follow you that way - loose focus and say what you really want - in non-technical terms.
Besides, I currently can't install NN.
0
 
rngAuthor Commented:
In non-technical terms, I want to make a program that can catch all mouse-clicks for downloading files from all the running instance of Netscape Navigator.


Raymond
0
 
robbertCommented:
With that, I can't help you at all.

Some notes, though:
+ Everything which you can program via OLE automation/COM/ActiveX, you'll find in VB under Project | References.

+ I never found NN there, and NN never made whole-heartedly efforts to be programmable. Well, the OLE thing you found, but it doesn't seem to have being extended. Then, there was an interface called DDE which was better evolved.

+ Capturing mouse-clicks, however, is advanced over just treating an instance of NN as object, and i.e., making it navigate to an URL. With IE, it's tricky but should work - if you created that instance, yourself.

+ Accessing programs, or windows, that you didn't create, again, is another pair of shoes. You can get the window handle (FindWindow() API I believe) and by that, some window properties, as the title. You can also terminate it. But beyond, it's getting very hard.

+ And it's not that window, you're interested in but an object it contains.

+ I don't believe that it's possible without rocket-science. If you want to leave this question open, you should edit your original question, and add the non-technical goal. ;-) Sorry.
0
 
rngAuthor Commented:
Robbert:

I want to delete this question now, but I want to give you 100 points.
How can I proceed ?


Raymond
0
 
rngAuthor Commented:
Delete this question please !!
0
 
rngAuthor Commented:
Delete it please !!!
0
 
amp072397Commented:
Points reduced from 200 to 100. Go ahead and accept robbert's comment as answer.

amp
Community Support Moderator
Experts Exchange
0
 
rngAuthor Commented:
Thanx Robbert.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.