Results 1 to 22 of 22

Thread: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another OCX)

  1. #1

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    285

    Merge several OCX files ? (or extract them to get ctl/ctx and recompile another OCX)

    Hi friends,

    I finally got good result with manifest files to embed OCX files in the app directory instead of registering them in the OS.

    Some minor question, is it possible to :
    - Create one OCX file, including several OCX files ?
    - Extracte each OCX file (in view to recreate one OCX file from ctl/ctx files of each extracter OCX files) ?

    The goal is having for exeample "myapp.ocx" and that's all

    Thanks
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,979

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Why would like to have a single OCX?
    If you want a single monolith OCX then you need to the source code of all OCX components and build a new one.
    But more simple is to just place all needed OCX files in a subfolder of your application.

  3. #3
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,227

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by Couin View Post
    Some minor question, is it possible to :
    - Create one OCX file, including several OCX files ?
    - Extracte each OCX file (in view to recreate one OCX file from ctl/ctx files of each extracter OCX files) ?
    - That's usually how it's done. Why would anyone compile a single user-control to a separate OCX file?
    - Very much default modus operandi too. Here is a snippet from a manifest of ours:

    Code:
    <file name="PosCm15.ocx">
        <typelib tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" version="1.0" flags="control,hasdiskimage" helpdir="" />
        <comClass clsid="{473FAF53-3940-4E14-B962-544AF8851A28}" tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" progid="PosCommon15.ctxDivider" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,nouiactivate,setclientsitefirst" />
        <comClass clsid="{26772CA7-CEBA-4483-B25C-4498EAFD3123}" tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" progid="PosCommon15.ctxFooter" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikebutton,alignable,simpleframe,setclientsitefirst" />
        <comClass clsid="{F8B88B91-9B5D-46EB-A83F-A391419CE941}" tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" progid="PosCommon15.ctxHeading" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,nouiactivate,alignable,setclientsitefirst" />
        <comClass clsid="{1FB8D077-FD42-4264-BDA6-0B2E6ACA4CBF}" tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" progid="PosCommon15.ctxNineButton" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,actslikebutton,setclientsitefirst" />
        <comClass clsid="{7C440095-FF4F-4C1D-A4F4-821F62A29076}" tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" progid="PosCommon15.ctxFlexContainer" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" />
        <comClass clsid="{CDA3B189-1A76-44C0-8F26-E157158C5686}" tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" progid="PosCommon15.ctxTouchKeyboard" threadingModel="Apartment" miscStatus="" miscStatusContent="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,nouiactivate,setclientsitefirst" />
        <comClass clsid="{0A05CFC4-D5DB-41DE-B8C7-6C30CAF776FD}" tlbid="{6EBAAAAB-DAFA-4DBC-AB7E-C1698FD4D9B3}" progid="PosCommon15.cVncServer" threadingModel="Apartment" />
        ...
    </file>
    It bundles several user-controls in an OCX incl. support classes which are under the same typelib. Notice the miscStatusContent attribute on user-controls. This is an important one for user-controls and often missed in tutorials on reg-free COM here but might prevent user-controls from properly activating in your application e.g. showing redrawing problems.

    cheers,
    </wqw>

  4. #4
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,119

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by Couin View Post
    Some minor question, is it possible to :
    - Create one OCX file, including several OCX files ?
    No. You can create one ocx file containing several controls (several UserControls), but not several ocx files.

    Quote Originally Posted by Couin View Post
    - Extracte each OCX file (in view to recreate one OCX file from ctl/ctx files of each extracter OCX files) ?
    Impossible. OCX files are compiled programs, very much like an exe file or a dll file. It is not possible to get the source code from the ocx file.
    Ctl/ctx file are source code.
    Again, there is no way to get the source code from compiled files. For example your customers are not able to get the code of your program from the exe you send to them.

    Quote Originally Posted by Couin View Post
    The goal is having for exeample "myapp.ocx" and that's all

    Thanks
    What's the big problem in having a few ocx files and not only one? It is more or less the same.

  5. #5

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    285

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Hi friends

    Thanks for answer.
    At least, it's clear lol

    The goal was just to get 1 files instead of 7, that's why I was talking about minor question

    I have not the source of all controls (I have just 2 of 7 lol).

    So I will keep like I did.

    @wqweto: whet do you mean about the your manifest ?

    Mine is like that :
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
      <!-- Make My Manifest 0.12.308 -->
      <assemblyIdentity name="MyApp.exe" processorArchitecture="X86" type="win32" version="1.0.0.0" />
      
      <file name="comdlg32.ocx">
        <typelib tlbid="{F9043C88-F6F2-101A-A3C9-08002B2F49FB}" version="1.2" flags="control" helpdir="" />
        <comClass clsid="{F9043C85-F6F2-101A-A3C9-08002B2F49FB}" tlbid="{F9043C88-F6F2-101A-A3C9-08002B2F49FB}" threadingModel="Apartment" progid="MSComDlg.CommonDialog.1" description="Microsoft Common Dialog Control 6.0 (SP6)" />
      </file>
      <file name="MSCOMCT2.OCX">
        <typelib tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" version="2.0" flags="control" helpdir="" />
        <comClass clsid="{603C7E80-87C2-11D1-8BE3-0000F8754DA1}" tlbid="{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}" threadingModel="Apartment" progid="MSComCtl2.UpDown.2" description="UpDown Control" />
      </file>
    ...
    </assembly>
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  6. #6
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,434

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Put a subfolder in your manifest then all looks suddenly cleaner.
    E.g.
    Code:
    <file name="Dependencies\comdlg32.ocx">
    Last edited by Krool; Apr 20th, 2024 at 12:02 PM.

  7. #7
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,434

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    wqweto,
    Interesting!
    Never used the MiscStatus* attributes and never found something odd in the usage of my ocx'es. I use them always via manifest.
    What is it really about?

    I found this upon google.
    The 'miscStatus*' is a multi-valued attribute of the <comClass> element Manifest Maker fully supports this attribute and writes them to the manifest, if the ActiveX puts them in its own registration. Manifests with this attribute will be rejected on Windows XP prior to SP2 (or SP1+843524). Applications will fail with message:

    This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
    EDIT: Anyhow. I updated the manifest for VBCCR17.OCX and VBFLXGRD17.OCX using your UMMM. Thanks
    Last edited by Krool; Apr 20th, 2024 at 01:09 PM.

  8. #8
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,227

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    These attributes are "shadowing" the same named entries (bitmasks) from user-control's registration in registry. Not sure exactly how these are used by control containers, obviously each one can heed the flags (e.g. MFC/ATL, VB6) or totally ignore their values (e.g. MS Access). Seems some old OLE era stuff, most probably unused or under-used (one flag only), enough to prevent your user control from getting focus with mouse click on VB6 forms for instance or other obscure misbehavior.

    cheers,
    </wqw>

  9. #9
    Addicted Member
    Join Date
    Dec 2020
    Posts
    214

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Some hosts, such as MS Access use the value given at runtime from IOleObject::GetMiscStatus (https://learn.microsoft.com/en-us/wi...-getmiscstatus), rather than the value stored in the registry.

  10. #10
    Lively Member
    Join Date
    Feb 2024
    Posts
    66

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Enigma Virtual Box will help you!

  11. #11

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    285

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by Krool View Post
    Put a subfolder in your manifest then all looks suddenly cleaner.
    E.g.
    Code:
    <file name="Dependencies\comdlg32.ocx">
    Hi Krool,
    This if effectivly what I did

    Quote Originally Posted by TomCatChina View Post
    Enigma Virtual Box will help you!
    Hi TomCatChina,
    Thanks for the tip. I testyed and looks embeding well files I want, but too bad, the ouput exe is detected as HEUR/APC virus by Avira
    Tested with another exe (without any relation with App I work) where I added just one font file (wingding.ttf), same thing
    Without adding fil to original exe, he output exe looks not seen as virus.

    I know it's false positive, but I wouldn't have to ask to a lot of users allow the file in theuir AV software.
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  12. #12
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    1,537

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    You do realize that Avira is pretty "bottom of the barrel" when it comes to antivirus software...

  13. #13
    Lively Member
    Join Date
    Feb 2024
    Posts
    66

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by Couin View Post
    Hi TomCatChina,
    Thanks for the tip. I testyed and looks embeding well files I want, but too bad, the ouput exe is detected as HEUR/APC virus by Avira
    Tested with another exe (without any relation with App I work) where I added just one font file (wingding.ttf), same thing
    Without adding fil to original exe, he output exe looks not seen as virus.

    I know it's false positive, but I wouldn't have to ask to a lot of users allow the file in theuir AV software.
    Sorry, unfortunately the fact that packaged software and virus programs use the same API hijacking techniques makes it difficult to distinguish between them, and perhaps this way of working is not suitable for commercial software environments.

  14. #14

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    285

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by VanGoghGaming View Post
    You do realize that Avira is pretty "bottom of the barrel" when it comes to antivirus software...
    Unfortunately, it's not the only one I already notice false positiv with some others A
    If the software was just for me, it's not a problem to autorize the exe, but a lot of people won't know how to do, and it would also alter the trust of users for this software

    Quote Originally Posted by TomCatChina View Post
    Sorry, unfortunately the fact that packaged software and virus programs use the same API hijacking techniques makes it difficult to distinguish between them, and perhaps this way of working is not suitable for commercial software environments.
    It's too bad, I tried with other exe files, and each has been seen as infected (false positive). With some digging on the forum it looks that is not only avira, they recommend to sent the app to AV editor so they fix it... Not possible for me to test all AV and send them each time I build a version, would takes too much time
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  15. #15
    Lively Member
    Join Date
    Feb 2024
    Posts
    66

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Actually by using manifest , you can reduce the OCX files to 0. Save all the OCX files as resources in the exe file, your software project will have only one exe file, and then use the resource data to generate the ocx files on the hard disk in Sub main! The end user doesn't need to care if these ocx exist or not.

  16. #16
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    1,537

    Wink Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by TomCatChina View Post
    Save all the OCX files as resources in the exe file, your software project will have only one exe file
    His Avira would explode if he did that!

  17. #17
    Lively Member
    Join Date
    Feb 2024
    Posts
    66

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by VanGoghGaming View Post
    His Avira would explode if he did that!
    This is possible, The AI era has arrived!

  18. #18

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    285

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O


    Name:  pouf.jpg
Views: 45
Size:  10.4 KB

    Quote Originally Posted by TomCatChina View Post
    Actually by using manifest , you can reduce the OCX files to 0. Save all the OCX files as resources in the exe file, your software project will have only one exe file, and then use the resource data to generate the ocx files on the hard disk in Sub main! The end user doesn't need to care if these ocx exist or not.
    This come back to copy directly ocx,dll,fonts at install
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  19. #19
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,119

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by Couin View Post

    Name:  pouf.jpg
Views: 45
Size:  10.4 KB

    This come back to copy directly ocx,dll,fonts at install
    In simple steps:

    Make a folder for all the ocx and dll. I myself call it "Bin".
    Make a manifest (embed in the exe) and perform a SxS installation.
    The above means that the ocx and dll does not need to be registered in Windows.
    Use an installer program. I use Inno Setup. Configure it to create the folder and to copy the ocx and dll files (remember: without registering).

    About fonts: they need to be registered.
    Otherwise you need to install them privately for your program every time it runs.

  20. #20

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    285

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Hi Eduardo

    Today, I have a "Dependencies" folder, with OCX files inside, a "Fonts" folder, with the 3 font files I need. These folders are created and populated by the NSIS installer.
    About fonts, I found to run the app with fonts without having to register them (I join a small exemple, based on an existing project I found I don't no longer where ).
    Attached Files Attached Files
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

  21. #21
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,119

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Quote Originally Posted by Couin View Post
    About fonts, I found to run the app with fonts without having to register them (I join a small exemple, based on an existing project I found I don't no longer where ).
    Yes, it install them privately.

    Quote Originally Posted by Eduardo- View Post
    Otherwise you need to install them privately for your program every time it runs.

  22. #22

    Thread Starter
    Hyperactive Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    285

    Re: Merge several OCX files ? (or extract them to get ctl/ctx and recompile another O

    Yes, nothing is installed on the OS
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone) - New non-official Jingle Palette update Jingle Palette Reloaded

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