Results 1 to 10 of 10

Thread: [RESOLVED] VB6 OCX - Standalone vs Embeded

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    10

    Resolved [RESOLVED] VB6 OCX - Standalone vs Embeded

    Is there any difference about speed, stability, threading behavior or other "hardcore stuff" if I compile a User Contol into an OCX or if I embeded a User Control into my EXE project?

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: VB6 OCX - Standalone vs Embeded

    I think an ocx that is a stand-alone ocx rather than being built-in to your program will execute faster than if it were built-in. That is being the stand-alone ocx would only have to do what its functions require and not have to wait for other code to start and finish before it can start/stop.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    10

    Thumbs up Re: VB6 OCX - Standalone vs Embeded

    Thanks 4 you answer

    Still waiting for detail info... anyone??

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 OCX - Standalone vs Embeded

    Controls compiled separately involve some additional creation and call overhead compared to those compiled inline in the client. As far as I know they will never be "faster" to use in any meaningful way. There is even more overhead for controls from an out-of-process library (ActiveX EXE). Another "dimension" of overhead is whether early or late binding is used.

    Compiling internal classes, controls, and forms isn't "embedding" in any technical Windows sense of the term such as OLE. Call overhead is about the same as calls into static (BAS) modules once an instance has been loaded.

    Threading won't be significant when using in-process libraries created in VB6, but various threading models are available out-of-process.

    I have no clue what "stability" means in this context, perhaps you could explain this.


    The main advantages of separate compilation to create libraries are (a.) sharing by multiple applications, (b.) separate servicing (updating), and (c.) managing development in smaller chunks. They can also aid in test-driven development and of course out-of-process libraries offer additional benefits of their own such as running in a separate machine from the client.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB6 OCX - Standalone vs Embeded

    Moved To General Developer

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: VB6 OCX - Standalone vs Embeded

    Also, I reckon standalone is better if at some stage you need to share the functionality with another developer or two. If not an embedded ocx would be better.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    10

    Re: VB6 OCX - Standalone vs Embeded

    dilettante :
    yes, "embedding" is not a correct word. What I mean is my User Control compiled along with my (standard) EXE, I just can't find a proper word for that
    Threading.. if I use such intensive work in the user control (manipulating image), isn't it the process in the EXE app will be queued until that work is done? (like Nightwalker83 state above?

    stability... just forget about it, I don't know how to desribe it

    So.. if I'm gonna use this User Control for this App only (all the sharing advantages thing not considered), it is better to have the Control bundled into the EXE?

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 OCX - Standalone vs Embeded

    If you think you really need multithreading then you don't have a lot of choice except to use an ActiveX EXE. Your OCX code written in VB6 is limited to running on the UI thread of your application just like any logic you write in your main EXE.

    One way we get around this is to use OCXs written in C++ which can have worker threads. But if you are trying to do everything in VB6 that isn't an option.

    Most of the time when you think you need multithreading you don't. When you do your problem may not be well suited to VB6. When you must anyway, then either an ActiveX EXE or a worker process (separate program) are about the only reliable choices.

    Ther are also some 3rd party libraries to help you have VB6 threads but they are not widely used and take time and study to understand. For example look at the Advanced COM topics at http://www.newobjects.com/pages/ndl/ which describes the free ActiveX Pack1. This can be used for threading (and lots of other stuff) in either VBScript or VB 5 & 6.

  9. #9
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    Re: VB6 OCX - Standalone vs Embeded

    If I recall, from the old VB6 days, there's no perceivable difference in speed/performance, etc. Basically, test it for yourself, based on what you are going to do on the control.

    The disadvantage of an external file (OCX) is the registration requirement. the disadvantage of 'embedded' is the inability to modify just the control, and a larger executable (not that that means much these days).
    "Ok, my response to that is pending a Google search" - Bucky Katt.
    "There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
    "Before you can 'think outside the box' you need to understand where the box is."

  10. #10
    Addicted Member
    Join Date
    Mar 2007
    Location
    India
    Posts
    227

    Re: VB6 OCX - Standalone vs Embeded

    Quote Originally Posted by dilettante View Post
    Ther are also some 3rd party libraries to help you have VB6 threads but they are not widely used and take time and study to understand. For example look at the Advanced COM topics at http://www.newobjects.com/pages/ndl/ which describes the free ActiveX Pack1. This can be used for threading (and lots of other stuff) in either VBScript or VB 5 & 6.
    AXPack1 is a gem of an ActiveX controls that I have ever used.

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