Results 1 to 12 of 12

Thread: Adding VB6 OCX to VB.Net Windows form

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2021
    Posts
    10

    Adding VB6 OCX to VB.Net Windows form

    Am investigating doing a re-write of an old VB6 project and am able to bring over all 3rd party OCX's with the exception of those from VideoSoft.
    I'm able to add the Videosoft OCX tools to the vb.Net Toolbox but vs2012 crashes as soon as I drag one of those OCX's to a blank form.

    Any suggestions as to how to determine source of problem and correct it?

    Need some help on this!

    Lee

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: Adding VB6 OCX to VB.Net Windows form

    Hi,

    Perhaps you could provide a little more info? What is VideoSoft? Where did you get the ocx? How does Visual Studio crash? Do you get any error message?

    Thank you.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2021
    Posts
    10

    Re: Adding VB6 OCX to VB.Net Windows form

    Quote Originally Posted by Peter Swinkels View Post
    Hi,

    Perhaps you could provide a little more info? What is VideoSoft? Where did you get the ocx? How does Visual Studio crash? Do you get any error message?

    Thank you.
    Peter:
    Thanks for the response...

    Videosoft is a set of vb6 OCX tools for Reporting and string parsing. We purchased it from Videosoft in 1998 and have license for use. Videosoft has since gone or was purchased by another entity and product is no longer available or supported.

    In vs2012 IDE I open new project, add the Videosoft OCX to toolbox, drag OCX to blank form, wait for a few seconds and vs2012 quits - no error messages - just a crash and back to normal desktop.

    Lee

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Adding VB6 OCX to VB.Net Windows form

    Are you referring to the components like vsFlexGrid 6 and vsReport 6?

    When VideoSoft was bought/changed to ComponentOne they have released major updates v7 and v8 (latest update in 2005)
    For most controls there are also .Net versions.

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2021
    Posts
    10

    Re: Adding VB6 OCX to VB.Net Windows form

    Arnoutdv:
    vsPrinter, vsView, vsAwk, vsInform, etc are the items.
    I'll check with ComponentOne.

    Thanks.

  6. #6
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: Adding VB6 OCX to VB.Net Windows form

    I did some quick research. When I examine the Event Viewer I find this: (when trying to use this ocx myself)

    Source: ".NET Runtime"
    Code:
    Application: devenv.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: exception code c0000005, exception address 343019D0
    Stack:
       at System.Windows.Forms.UnsafeNativeMethods+IOleObject.DoVerb(Int32, IntPtr, IOleClientSite, Int32, IntPtr, COMRECT)
       at System.Windows.Forms.AxHost.DoVerb(Int32)
       at System.Windows.Forms.AxHost.InPlaceActivate()
       at System.Windows.Forms.AxHost.TransitionUpTo(Int32)
       at System.Windows.Forms.AxHost.CreateHandle()
       at System.Windows.Forms.Control.CreateControl(Boolean)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control+ControlCollection.Add(System.Windows.Forms.Control)
       at System.Windows.Forms.Form+ControlCollection.Add(System.Windows.Forms.Control)
       at System.Windows.Forms.Design.ParentControlDesigner.AddChildControl(System.Windows.Forms.Control)
       at System.Windows.Forms.Design.ParentControlDesigner.AddControl(System.Windows.Forms.Control, System.Collections.IDictionary)
       at System.Windows.Forms.Design.ControlDesigner.InitializeNewComponent(System.Collections.IDictionary)
       at System.Windows.Forms.Design.AxHostDesigner.InitializeNewComponent(System.Collections.IDictionary)
       at System.Drawing.Design.ToolboxItem.CreateComponentsCore(System.ComponentModel.Design.IDesignerHost, System.Collections.IDictionary)
       at System.Drawing.Design.ToolboxItem.CreateComponents(System.ComponentModel.Design.IDesignerHost, System.Collections.IDictionary)
       at System.Windows.Forms.Design.OleDragDropHandler.CreateTool(System.Drawing.Design.ToolboxItem, System.Windows.Forms.Control, Int32, Int32, Int32, Int32, Boolean, Boolean, System.Windows.Forms.Design.Behavior.ToolboxSnapDragDropEventArgs)
       at System.Windows.Forms.Design.ParentControlDesigner.CreateToolCore(System.Drawing.Design.ToolboxItem, Int32, Int32, Int32, Int32, Boolean, Boolean)
       at System.Windows.Forms.Design.ParentControlDesigner.CreateTool(System.Drawing.Design.ToolboxItem, System.Drawing.Point)
       at System.Windows.Forms.Design.ParentControlDesigner.OnMouseDragEnd(Boolean)
       at System.Windows.Forms.Design.ControlDesigner.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Design.ScrollableControlDesigner.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Design.DocumentDesigner.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Design.FormDocumentDesigner.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Design.ControlDesigner+DesignerWindowTarget.OnMessage(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)
    Source: "Application Error"
    Code:
    Faulting application name: devenv.exe, version: 16.11.32002.261, time stamp: 0x61a977d6
    Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
    Exception code: 0xc0000005
    Fault offset: 0x343019d0
    Faulting process id: 0x3ba8
    Faulting application start time: 0x01d80bc174f26272
    Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
    Faulting module path: unknown
    Report Id: 5ff41572-b918-4cef-8397-df84fab78def
    Faulting package full name: 
    Faulting package-relative application ID:
    Last edited by Peter Swinkels; Jan 17th, 2022 at 11:56 AM.

  7. #7
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Adding VB6 OCX to VB.Net Windows form

    VB6 controls do not play well with WinForms'. VB6 controls have a set of complicated interfaces that need to be implemented for them to be sited correctly on a WinForms' Form.

    TLDR; They are incompatible GUI technologies.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  8. #8

    Thread Starter
    New Member
    Join Date
    Oct 2021
    Posts
    10

    Re: Adding VB6 OCX to VB.Net Windows form

    I guess it's time to bite the bullet and start from scratch with new set of tools from Component Source.
    Rewriting a legacy application is not what I had in mind.
    Thanks to all for input on this.

    Lee

  9. #9
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Adding VB6 OCX to VB.Net Windows form

    Whenever someone tries to migrate an app from VB6 to .NET it always seems that a rewrite is in order for one reason or another. The two visual basics differ so much that many baulk at the two products even having the same name let alone the same code. A rewrite seems to be the standard approach.

    You could instead just watch the TwinBasic and RADBasic projects. They are both aiming to provide full compatibility with VB6. Neither is yet complete but both supposedly making good progress. It might be a way out for you.

    To utilise these might require a delay to your current plans but might also buy you some breathing time in the near future when you know a new and potentially supported platform is just around the corner.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  10. #10
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: Adding VB6 OCX to VB.Net Windows form

    Unless the program has stopped working, what is your reason for updating. If your going to use old legacy OCX's and not modern components what are you gaining? Why spend all the time and money on a program that is still out of date and could stop working the next time MS modifies their OS. If there is no current libraries or components that will fit your needs then it might make sense.

  11. #11

    Thread Starter
    New Member
    Join Date
    Oct 2021
    Posts
    10

    Re: Adding VB6 OCX to VB.Net Windows form

    Programs were written for Windows 95 about 25 yrs ago and continually updated. Data bases have been changed and mods added for compatibility with latest Windows (thru 11).
    Most procedural code can be easily updated but the UI components makes it quite difficult. Program was originally written in the 80's and run as DOS application.
    Time for a facelift! Have 2800 users world wide and would hate to see things come to screeching halt on next release of Windows.

    Lee

  12. #12
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Adding VB6 OCX to VB.Net Windows form

    I have to agree with wes4dbt on this one. I really think you should look for modern replacements of these components or find some decent substitution for whatever functionality they provide. Mixing VB6 and .Net is only ever meant to be a stopgap measure to save time in the short term. Long term, the legacy components should be replaced.

    Quote Originally Posted by yereverluvinuncleber View Post
    You could instead just watch the TwinBasic and RADBasic projects. They are both aiming to provide full compatibility with VB6. Neither is yet complete but both supposedly making good progress.
    I can't speak for RADBasic, I haven't seen any credible evidence of it's existence as of yet but TwinBASIC shows great promise. You could wait for it to mature and it should provide a great upgrade path for aging VB6 applications.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width