Results 1 to 12 of 12

Thread: [RESOLVED] Laoding commaon Dialog at run time

  1. #1

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Resolved [RESOLVED] Laoding commaon Dialog at run time

    I recently read an rticle on mvps.org where the author created a progreesbar control at runtime without including the mscommcontrols activex control.
    This can be quite helpful if we want to reduce the distribution size.
    So i was wondering if its possible to load a commondialog object too at runtime in a similar way.

    heres the link to the mvps site
    http://btmtz.mvps.org/progressbar/

    Can someone point to threads where this has been discussed before or to other online resources.

    thanks
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

  2. #2
    Hyperactive Member
    Join Date
    Aug 2006
    Location
    TeXaS
    Posts
    497

    Re: Loading common Dialog at run time

    many people have made class modules to add into your projects to replace an ocx, here is an old one that i found awhile back. there are newer and more advanced, this only includes the open and save dialogs. you just add it to your project and set it up as you would any class module. it uses api to open and save.
    Attached Files Attached Files

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

    Re: Laoding commaon Dialog at run time

    What you are refereing to can be done but the control still has to exist on the destination machine. So it has to have been deployed in some way. Using this method is very dangerous since you are counting on the controls being already having been installed. Not a bright idea. The best idea is to always deploy everything you need for your app to work. NO EXCEPTIONS...

  4. #4

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: Laoding commaon Dialog at run time

    but i think comdlg32.dll exists on any windows system,the only difference being the file versions( which matter the most).So i think the above class file should work.

    Randem ,what u said is perfectly right .I just want to reduce my setup file by 150kb(the size of the comdlg32.ocx).So i asked
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

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

    Re: Laoding commaon Dialog at run time

    Depending on what you used to gather the dependencies... You may not even be deploying enough files and possibly some unsafe ones. You may need to deploy some SP's instead of just one dll, etc.... It is more likely that your deployment package will grow than shrink when it's done correctly.

    Remember: Using less nails to build your house may get the job done but would you really want to live in it.

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

    Re: Laoding commaon Dialog at run time

    Quote Originally Posted by randem
    What you are refereing to can be done but the control still has to exist on the destination machine.
    Not for a common dialog, they are a part of the OS. The COM control is just a wrapper for the same API functions you can call yourself. Joacim Andersson has an ancient but good class wrapper for several common dialogs in the Codebank.

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

    Re: Laoding commaon Dialog at run time

    Quote Originally Posted by penagate
    Not for a common dialog,
    Then it still has to exist... Doesn't it???? Not all controls exist. That one happens to exist... It still doesn't change anything...

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

    Re: Laoding commaon Dialog at run time

    Yeah, it exists in a DLL (comdlg32.dll) that is part of all Windows distributions. Almost all applications use a form of the common dialog and only those written in VB use the .ocx control. If you write an application in C++ (ignoring MFC) it is easier just to call the API functions directly. The control just makes life easier for VB developers.

    KB 161286.

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

    Re: Laoding commaon Dialog at run time

    Also what happens if an old version is on the target system and his app needs the newer one????

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

    Re: Laoding commaon Dialog at run time

    There is no "newer" one. The control simply wraps what is on the system already.

    I agree you're completely correct when referring to controls that actually offer their own functionality, but this doesn't.

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

    Re: Laoding commaon Dialog at run time

    Okie Dok...

  12. #12

    Thread Starter
    Frenzied Member litlewiki's Avatar
    Join Date
    Dec 2005
    Location
    Zeta Reticuli Distro:Ubuntu Fiesty
    Posts
    1,162

    Re: Laoding commaon Dialog at run time

    ohh thanks penagate and randem for that wonderful discussion .The reasion i asked for is because my original app is just 150 kb in size but because i'm using a cdlg and a scroll bar ,my distribution size has crossed 2mb for no reason(1 mb for mscommcontrol and 150 for this one).

    I found the one for progress bar before itself and now i found one for this too.Thanks penagate and joacim(for his amazing class).

    Randem, your arguments were really insightful, will keep them in mind before releasing the distributables.
    __________________
    ________________0îîî___
    ___îîî0________(___)____
    __(___)_________) _/_____
    ___\_ (_________(_/______
    ____\_)_________________

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