Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using OCX controls in VS2013 vb.NET Forms

Status
Not open for further replies.

planetbluau

Programmer
May 25, 2010
54
AU
Hi,

I'm wondering if anybody has any success with Using OCX controls in VS2013 vb.NET Forms and could outline the steps to do so.

I have tried the usual process of adding the OCX to the TOOLBOX, dropping on the form but always get the Failed to Import OCX message.

I know, I know... some of the answers might be to use VB6 or a VBA Macro and appreciate that it may be easier that way. In fact that is what I have done at the moment. But all my other Sage automation has been done in vb.NET. So... If you have done this already with success, can you give me some pointers on the process to get it to work.

Many thanks if you can.

Rodney
 
You might try this post. It's a way of putting a level of interfacing between your program and the screen which allows you to load the screen dynamically and then access the properties of the screen.


As an aside I've tried loading screens into Delphi and had no success - something was missing that the screen wanted to load and I gave up trying to figure out what it was. VB is really good at hosting OCX controls so that's why you have the easiest time with that environment/language.
 
You need to get the SDK first. There is a file named ObjSafe.tlb which you will need put it in your shared data folder to get the COM resolved in .NET form. Then you will need to wire up the events of the objects to write your own code for what you do. - That is on development side.

You will need to turn off DEP at client machine when you install and deploy the .NET application with OCX.

You'd better off to use VB6.0 for any OCX related application. Too much pain and too much work for what you need to do with a few additions\changes on OCX.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top