Results 1 to 15 of 15

Thread: [RESOLVED] Joining controls

  1. #1

    Thread Starter
    Fanatic Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    547

    Resolved [RESOLVED] Joining controls

    I have a set of custom controls. I would like to know your opinion if it is better to compile in a single ocx or separately. What advantages or disadvantages?

    Thanks for your suggestion.

  2. #2
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,057

    Re: Joining controls

    there is a lot to weigh on the decision.

    I would not make an ocx out of them for quite a while and just use them as user controls until you are very happy with the api interface and have figured out and debugged all the features you want in the long term. once that part is complete, then the ocx question.

    really large controls that are very complex I would make standalone ocx
    a group of smallish controls I would bundle all together into one

    once you start distributing multiple projects using the same ocx, it can get annoying if you have to break compatibility for any reason. Then you all of a sudden
    have to recompile everything that used it. thats why i opt for a long user control period. Even now some user controls even after a couple years I do not convert
    because I like to be able to keep customizing them to the current program.

    if its only for personal small projects, then it is easier. I have one activex dll with loads of debugged classes that I only use for one off projects. its a full runtime
    of handy stuff and only project compatibility set so I can adapt it or add on to it at any time, I never use it for anything I distribute and instead rip the classes out
    of it into other dlls or compile in if the need arises. that way I have a foundry where I can forge and refine in a test environment.

    so depends on the size, complexity, if your distributing them, if the api interface is set in stone yet, how well debugged they are, do they benefit from customization per app etc.
    switching to dll/ocx to early gives headaches would be my main warning.

  3. #3
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,997

    Re: Joining controls

    Quote Originally Posted by Episcopal View Post
    I have a set of custom controls. I would like to know your opinion if it is better to compile in a single ocx or separately. What advantages or disadvantages?

    Thanks for your suggestion.
    Single ocx.

    Quote Originally Posted by Episcopal View Post
    What advantages or disadvantages?
    The advantage is that it is only one ocx.
    Disadvantages: it depends on your case, but most probably none.

  4. #4
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: Joining controls

    Yeah dz32 brought a lot of this out, but my question would be, "What do you intend to do with these controls?"

    If you only intend to use them in your own project(s), I see no reason to make an OCX at all. Just include the controls in your project(s) on an as-needed basis. That makes distribution easier, and obviates any need to worry about registration of the OCX.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  5. #5

    Thread Starter
    Fanatic Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    547

    Re: Joining controls

    Quote Originally Posted by Elroy View Post
    Yeah dz32 brought a lot of this out, but my question would be, "What do you intend to do with these controls?"

    If you only intend to use them in your own project(s), I see no reason to make an OCX at all. Just include the controls in your project(s) on an as-needed basis. That makes distribution easier, and obviates any need to worry about registration of the OCX.
    Yes, it's for my own projects. But if I put everything in the EXE, and if I need to fix any bugs, then I'll have to update the executable every time.

    When it comes to registration, there is the SXS technology.

  6. #6

    Thread Starter
    Fanatic Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    547

    Re: Joining controls

    Separate ocx, in my view is that in possible bugs, it would be easier to debug a single control.

  7. #7
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: Joining controls

    Umm, to fix bugs, you've still got to redistribute something. With everything in the EXE, you've got the possibility of a portable application (no installation needed). But, to redistribute an OCX, you've really got to re-install everything or else teach your users how to re-register their new OCX (which I wouldn't recommend).

    Addendum: Here's a screenshot of my primary project (literally 100s of modules):

    Name:  prj.png
Views: 178
Size:  15.8 KB
    Last edited by Elroy; Oct 6th, 2021 at 12:18 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  8. #8
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,057

    Re: Joining controls

    debugging a usercontrol in your primary project is easier than doing it in an ocx.

    many times I will create a sub directory in ocx projects which load the usercontrol
    into an exe project directly to debug stuff its just quicker.

  9. #9

    Thread Starter
    Fanatic Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    547

    Re: Joining controls

    The debugging issue I do in a Project Group... works in real time.
    Attached Images Attached Images  

  10. #10
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,057

    Re: Joining controls

    project group is a good way too

  11. #11

    Thread Starter
    Fanatic Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    547

    Re: Joining controls

    dz32, Elroy e Eduardo-

    I think I'll compile in the same OCX, which even when compiling I put the .DLL extension

  12. #12
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,997

    Re: Joining controls

    Unless you intend to use all these controls in only one program, putting them in an ocx has a huge advantage of reusability (and maintenance) over putting them in source code in every exe project.

    About the idea of "easier to debug" if the controls are split into different ocx files, I don't see why it would be easier to debug, it is the same.

  13. #13
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,997

    Re: Joining controls

    Quote Originally Posted by Episcopal View Post
    dz32, Elroy e Eduardo-

    I think I'll compile in the same OCX, which even when compiling I put the .DLL extension
    DLL?

  14. #14
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,997

    Re: Joining controls

    Quote Originally Posted by dz32 View Post
    project group is a good way too
    Exactly, that's good for debugging/improving the component.

  15. #15

    Thread Starter
    Fanatic Member Episcopal's Avatar
    Join Date
    Mar 2019
    Location
    Brazil
    Posts
    547

    Re: Joining controls

    Quote Originally Posted by Eduardo- View Post
    DLL?
    I know it's silly, but I change my ocx extension to dll at compile time. It's just a pattern to match my general function dlls.

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