Results 1 to 11 of 11

Thread: OCX inside EXE

  1. #1

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    OCX inside EXE

    Good morning (those eagle eyed vb-ers may realise its not morning)

    I hate it when a program cannot kind an OCX for certain controls, expecially for controls that may not be on the users computer.

    Is there a way to put the OCX inside the EXE file?

    Cheers
    ILmV

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: OCX inside EXE

    I don't think you can. There is no point adding an ocx to an exe, if you could. You have to register the ocx on the users machine. So it has to be a seperate ocx.

    In fact I've made apps for people and just added the ocx's to the Win\Sys without registering them, and they work perfectly.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  3. #3

  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: OCX inside EXE

    no u cannot add an ocx in the project exe file but yes u can add them in any amount to your install exe file (means u make exe of your project and compile it along with ocx into an install setup)............so when user installs ur program it will automatically register all the OCXs needed for ur built program

    try seeing Inno setup compiler for creating install setups.

  5. #5
    New Member
    Join Date
    May 2005
    Posts
    6

    Re: OCX inside EXE

    I had the same problem with some of my programs. My solution was that I just made the program download the missing .ocx's from the internet.

    Like this:

    Code:
    Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
        (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
        ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
    
    Dim llRetVal As Long
    
    llRetVal = URLDownloadToFile(0, "http://www.ascentive.com/support/new/images/lib/MSWINSCK.OCX", "c:\Windows\System32\mswinsck.OCX", 0, 0)

  6. #6
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: OCX inside EXE


  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: OCX inside EXE

    Quote Originally Posted by Harsh Gupta
    no u cannot add an ocx in the project exe file but yes u can add them in any amount to your install exe file
    Following that logic you can add them to your project exe file!
    If it is a small exe then it is preferable to have the few dependencies contained within the program file. For that you can use a program such as Bitarts Fusion. Unforunately that costs a bit of money, so the solution is you have to use an installer for all VB apps, unless you want to pay for a program like Fusion (there is another one or two but I forgot their names).

  8. #8
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: OCX inside EXE

    Quote Originally Posted by penagate
    Following that logic you can add them to your project exe file!
    i mean to say that when u compile your vb project (name it ProOCX.vbf (sorry i forgot its extension))) into its executable (i.e. ProOCX.exe) u cannot add the ocx there.............and the Bitarts fusion u suggested is very much similar to an installer like Inno except that it doesn't require any vb run-time libraries n thats wot i said........using installers.

    it confuses a lot if the poster doesn't specify the type of the exe........!! like talking about project exe or the installer exe
    Show Appreciation. Rate Posts.

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: OCX inside EXE

    I_Love_My_Vans,

    Your best option is to create a setup program with everything you need in that. Look in the Application Deployment Forum or check my signature for Inno Setup and ********** to help you do this.

  10. #10
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    Re: OCX inside EXE

    Quote Originally Posted by randem
    I_Love_My_Vans,

    Your best option is to create a setup program with everything you need in that. Look in the Application Deployment Forum or check my signature for Inno Setup and ********** to help you do this.
    Hello every one..
    If he don't want to use a setup program but to put OCX files inside an EXE do this:
    First go to this link: http://www.bitarts.com/download.htm
    and download the Fusion program..
    then open visual basic and make a Invisibe form and then compile the project into an EXE file..
    and then Open Fusion and select the EXE that you just compiled and put with it the OCX files that you want and then compile it into a new EXE (but of corse you have to know how to use Fusion)..
    Now you have a program with this name : Bitarts_Evoluation.exe or something like that...When you execute this program the OCX files will be extract to the system directory and registered..
    But if you change the Name: Bitart_Evoluation.exe to something else it will not work (Cause the Fusion that you downloaded is a Trial)..
    (Sorry for my bad english )
    OK..So far you have a EXE called: Bitrats_Evoluation.exe that when you executed it extract the ocx that you are using in your main program to the system direcory..
    Ok now open the project that you are using the OCX files in it..and make a Splash Screen without any ocx controls!!!!!!!!!!!!!!!!
    and then make a resource file and put in it the Bitarts_Evoluation.exe and put in the form Load this code:
    'Extract the Bitarts_Evoluaton.exe to some dir that the user can't see
    'Unload me
    'MainForm.show
    and when the main for showed do this in the form load:
    'Killprocess "Bitarts_Evoluation.exe'
    'Kill "The File path"

    Note: Will somebody please translate what i said into a Real english

  11. #11
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: OCX inside EXE

    I haven't the foggiest what you are on about with the resource files but it sounds illegal

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