Link to home
Start Free TrialLog in
Avatar of RhinoInformation
RhinoInformation

asked on

Embedding VB application in IE page

This has probably been covered a million times in this forum. What I'm looking for is a complete answer with examples or links to good examples that will help me accomplish what I'm looking to do. Basically, I don't want to have to do much more research after this.

(1) I want to use Winsock in VB from a class. If I don't have a form, I can't use the control. So how can I use Winsock in a UI-less program (complete answer with example, please).

(2) I want to create a web page that enbeds a VB app. The page will have data from the server. The app, using Winsock, will be communicating with another server with more app-specific data. How can I accomplish this (VB and HTLM please)? I had tried a quick test with an ActiveX EXE and DLL and the <object> tag. The form I opened was not embedded in the page as I intended - it opened as a modal form. And IE said it didn't support nonmodal.

  a. Should I create an ActiveX DLL or EXE to embed in the page?
  b. Can I have a form (UI) that is displayed IN the page? Or, must I create a UI-less object that interacts with standard HTML controls? (examples, please)
  c. When an object tag is used, when is the object instantiated? Is that reference enough? When is it destroyed?

(3) Is there anything I'm missing? Again, web page hosted in IE that has, as part of the page, a custom VB app with an interface that communicates via Winsock to another server.

I am offering so many points because I am asking for detailed responses (I tried to offer more, but EE capped me at 500). Let me know if you need more information.

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of inthedark
inthedark
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RhinoInformation
RhinoInformation

ASKER

Thanks for the replies. I should have realized OCX...user control. Duh.

Related to the original Q, how can I set a reference from the OCX to the copy of IE that's hosting it?? Basically, I have a browser session open that has session variables on the server. I need to open a new page from IE that lives in the same session. SO, I need to be able to open a new page from the page that's hosting the OCX in order to be in the same session. I believe that if I create a new IE object that it will be in a different session (the difference between opening multiple copies of the browser versus opening a new browser window from the menu).

inthedark:
Just for your info, I found something a little better on this site:

In the DLL, go to the projects menu, select references and browse.  Browse to mswinsock.ocx in system dir.  You have now added a reference to the winsock library (you can't do this with all controls.)

In your class declare a variable at the General Declarations level.

Private WithEvents Winsock1 as Winsock

You should see the object dropdown on the left of the codepane will now have a Winsock1 entry.  Using the event dropdown on the right, you can enter code to handle all the events for the winsock 'control.'