CommonDialog

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yanivoliver@gmail.com

    CommonDialog

    Hey,

    I'm using the CommonDialog object to load a dialog which allows the
    user to select the files they want to upload. This solution works
    perfectly on computers that have some Visual Studio applications
    installed, but on those without any, it won't work since it doesn't
    have the required file registered.

    The code I'm currently using:

    ComDlg = new ActiveXObject(" MSComDlg.Common Dialog");

    ComDlg.Filter = "All Files(*.*)|*.*" ;
    ComDlg.FilterIn dex = 1;
    ComDlg.Flags = 0x200 | 0x1000 | 0x80000;
    ComDlg.MaxFileS ize = 512;

    ComDlg.ShowOpen ();


    Does anyone have a way I can still use the CommonDialog object on
    computers that dont have comdlg32.dll registered correctly? I have no
    problem putting the comdlg32.dll file on the users computer, but how
    can I register it/use it without registering it?

    Any help would be greatly appreciated,
    Yaniv

  • Thomas 'PointedEars' Lahn

    #2
    Re: CommonDialog

    yanivoliver@gma il.com wrote:
    [color=blue]
    > Does anyone have a way I can still use the CommonDialog object on
    > computers that dont have comdlg32.dll registered correctly? I have no
    > problem putting the comdlg32.dll file on the users computer, but how
    > can I register it/use it without registering it?[/color]

    You cannot. There is either support for this control or there is not.
    There is no between. And since you have correctly identified the problem
    to be not script-related, why are you insisting on posting in to this
    newsgroup dealing with _J(ava)Script/ECMAScript_?


    PointedEars

    Comment

    • Duncan Booth

      #3
      Re: CommonDialog

      yanivoliver@gma il.com wrote:
      [color=blue]
      > I have no
      > problem putting the comdlg32.dll file on the users computer, but how
      > can I register it/use it without registering it?[/color]

      You certainly should have a problem with putting comdlg32.dll on the users'
      computers as you don't have a license for that. You may only redistribute
      those files which Microsoft list as redistributable and they are quite
      explicit that comdlg32.dll is not redistributable .

      See http://support.microsoft.com/kb/q216368/

      Comment

      • VK

        #4
        Re: CommonDialog


        Thomas 'PointedEars' Lahn wrote:[color=blue]
        > You cannot. There is either support for this control or there is not.
        > There is no between. And since you have correctly identified the problem
        > to be not script-related, why are you insisting on posting in to this
        > newsgroup dealing with _J(ava)Script/ECMAScript_?[/color]

        Maybe because JScript is used as a tier to access system resources?

        To OP: do not pay attention to <Thomas 'PointedEars' Lahn> - he's
        trying to be local spooky man, but he's not spooky at all really. Just
        say him "grrrh" out loud and he will run away. :-)

        Presuming you have all rights in your LAN:

        First you have to install free Microsoft .Net Framework package on each
        computer.

        Patch .Net Framework with 1.1 patch (if needed).

        To start using a .dll library first you need to register it in GAC
        (Global Assembly Cash). The simplest way I've found so far is using
        Windows Explorer:
        1. Run two instances of Explorer.
        2. In the first Explorer navigate to the folder where your dll is
        located
        3. In the second Explorer navigate to the folder <Windows>\assem bly
        4. Drag and drop dll from the first Explorer window to the second one.
        5. It should work now.

        NB: it must be Windows Explorer, not a folder window, otherwise the
        bird will not fly.

        Comment

        • VK

          #5
          Re: CommonDialog


          Duncan Booth wrote:[color=blue]
          > You certainly should have a problem with putting comdlg32.dll on the users'
          > computers as you don't have a license for that. You may only redistribute
          > those files which Microsoft list as redistributable and they are quite
          > explicit that comdlg32.dll is not redistributable .[/color]

          Damn right! But a wait a second... comdlg32.dll is not a package
          library, it native to Windows XP SP2

          To OP:
          What OS are you running on other machines?

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: CommonDialog

            VK wrote:
            [color=blue]
            > Thomas 'PointedEars' Lahn wrote:[color=green]
            >> You cannot. There is either support for this control or there is not.
            >> There is no between. And since you have correctly identified the problem
            >> to be not script-related, why are you insisting on posting in to this
            >> newsgroup dealing with _J(ava)Script/ECMAScript_?[/color]
            >
            > Maybe because JScript is used as a tier to access system resources?[/color]

            You have not understood that his is not a question very likely to be
            answered here since it is off-topic despite the fact that JScript is
            the used interface language: it is not a language problem but one of
            the underlying system configuration. He could have used VBScript and
            any other interface language and nothing changed.

            There is a group dealing with ActiveX-specific _configuration_ issues.
            It is not this one.


            PointedEars

            Comment

            • Robert

              #7
              Re: CommonDialog

              yanivoliver@gma il.com wrote:[color=blue]
              > Does anyone have a way I can still use the CommonDialog object on
              > computers that dont have comdlg32.dll registered correctly? I have no
              > problem putting the comdlg32.dll file on the users computer, but how
              > can I register it/use it without registering it?
              >[/color]

              Registering it without registering it?
              Isn't that impossible by definition?

              Anyway can't you distribute it like any other activex on the web?
              But even then it still needs to be registered.

              Comment

              • web.dev

                #8
                Re: CommonDialog


                yanivoliver@gma il.com wrote:[color=blue]
                > Hey,
                >
                > I'm using the CommonDialog object to load a dialog which allows the
                > user to select the files they want to upload. This solution works
                > perfectly on computers that have some Visual Studio applications
                > installed, but on those without any, it won't work since it doesn't
                > have the required file registered.
                >
                > The code I'm currently using:
                >
                > ComDlg = new ActiveXObject(" MSComDlg.Common Dialog");
                >
                > ComDlg.Filter = "All Files(*.*)|*.*" ;
                > ComDlg.FilterIn dex = 1;
                > ComDlg.Flags = 0x200 | 0x1000 | 0x80000;
                > ComDlg.MaxFileS ize = 512;
                >
                > ComDlg.ShowOpen ();
                >
                >
                > Does anyone have a way I can still use the CommonDialog object on
                > computers that dont have comdlg32.dll registered correctly? I have no
                > problem putting the comdlg32.dll file on the users computer, but how
                > can I register it/use it without registering it?
                >
                > Any help would be greatly appreciated,
                > Yaniv[/color]

                Must you really use the active x object to achieve what you want to do?
                There is another way. Users can also upload files through a form.
                For example:

                <form>
                ....
                <input type = "file">
                ....
                </form>

                Comment

                • rf

                  #9
                  Re: CommonDialog

                  VK wrote:
                  [color=blue]
                  > Duncan Booth wrote:[color=green]
                  >> You certainly should have a problem with putting comdlg32.dll on the users'
                  >> computers as you don't have a license for that. You may only redistribute
                  >> those files which Microsoft list as redistributable and they are quite
                  >> explicit that comdlg32.dll is not redistributable .[/color][/color]

                  comdlg32.dll by itself is not redistributable but it *is* redistrubitable
                  as part of other other redistributable objects, the reason being
                  comdlg32.dll and comctrl.dll (for example) go together. Change only one of
                  them and your system will break.
                  [color=blue]
                  > Damn right! But a wait a second... comdlg32.dll is not a package
                  > library, it native to Windows XP SP2[/color]

                  Where did you get that idea?

                  comdlg32.dll has been around since before windows 95. It shipped as part of
                  win32s, the 32 bit addon to windows 3.1, about eighteen years ago.
                  [color=blue]
                  > To OP:
                  > What OS are you running on other machines?[/color]

                  Indeed. I doubt that comdlg32.dll would install on a Mac :-)

                  --
                  Cheers, Richard.
                  If you are reading this using google groups then also read this:
                  http://www.safalra.com/special/googlegroupsreply/ if you have not done so
                  already. If you reply to this post without correct quoting and attribution,
                  as per the above, I, and others, may just totally ignore you.

                  Comment

                  • Duncan Booth

                    #10
                    Re: CommonDialog

                    rf wrote:
                    [color=blue][color=green]
                    >> Duncan Booth wrote:[color=darkred]
                    >>> You certainly should have a problem with putting comdlg32.dll on the
                    >>> users' computers as you don't have a license for that. You may only
                    >>> redistribute those files which Microsoft list as redistributable and
                    >>> they are quite explicit that comdlg32.dll is not redistributable .[/color][/color]
                    >
                    > comdlg32.dll by itself is not redistributable but it *is*
                    > redistrubitable as part of other other redistributable objects, the
                    > reason being comdlg32.dll and comctrl.dll (for example) go together.
                    > Change only one of them and your system will break.[/color]

                    Do you have evidence for this? Everything I can find says comgld32.dll is
                    not redistributable .

                    Comment

                    • VK

                      #11
                      Re: CommonDialog


                      Duncan Booth wrote:[color=blue]
                      > Do you have evidence for this? Everything I can find says comgld32.dll is
                      > not redistributable .[/color]

                      Let's us clear up the situation based on OP issue:

                      He's using MSComDlg.Common Dialog which is COMDLG32.OCX control
                      available on Windows XP with Visual Studio / Visual Studio # installed.
                      You have to either install a copy of Visual Studio on each computer or
                      you have to get a destribution license from Microsoft to register this
                      control on each computer.

                      COMDLG32.DLL library is presented in each Windows installation starting
                      Windows 98 at least. So if you have a legal copy of Windows, you
                      already have a legal copy of COMDLG32.DLL - so no destribution is
                      needed.

                      The trick is that you cannot use ActiveXObject() on .DLL because it's
                      not a control, it's a library you can link to your project to make your
                      own control.

                      A side walk for the OP situation (presuming they have basic Microsoft
                      Office package installed) would be to call Excel dialog window via
                      ActiveXObject. This dialog (but not Word's one) can be patched to
                      accept multiple file selection.

                      Comment

                      • rf

                        #12
                        Re: CommonDialog

                        Duncan Booth wrote:
                        [color=blue]
                        > rf wrote:
                        >[color=green][color=darkred]
                        >>> Duncan Booth wrote:
                        >>>> You certainly should have a problem with putting comdlg32.dll on the
                        >>>> users' computers as you don't have a license for that. You may only
                        >>>> redistribute those files which Microsoft list as redistributable and
                        >>>> they are quite explicit that comdlg32.dll is not redistributable .[/color]
                        >>
                        >> comdlg32.dll by itself is not redistributable but it *is*
                        >> redistrubitable as part of other other redistributable objects, the
                        >> reason being comdlg32.dll and comctrl.dll (for example) go together.
                        >> Change only one of them and your system will break.[/color]
                        >
                        > Do you have evidence for this? Everything I can find says comgld32.dll is
                        > not redistributable .[/color]

                        Hmmm. You may well be right. I looked at the "note" in the microsoft page
                        you refered to wherein they say that comctl32 and comdlg32 are not
                        redistributable . They go on to say the "if you must update comctl32.dll,
                        download 401comupt.exe.. .". I know of the existance of the latter[1] and
                        naturally assumed that comdlg32 was part of it. Perhaps it isn't.

                        [1] I have never used xxxcomupt.exe. Some of my software *does* rely on
                        newer versions of comctl32 than may not be available on older systems
                        (notably 95 and 98) however I simply inform my users that they must have
                        IE6 installed to use my software, as the IE6 install includes a quite up to
                        date comctl32, and said users are far more comfortable installing IE6 than
                        they are installing some vague redist exe the have to download from MS.
                        Never really bothered thinking about comdlg32 as I have never had a version
                        issue with it.

                        However, as VK has pointed out the OP is really talking about comdlg32.ocx,
                        which is redistributable .

                        --
                        Cheers, Richard.
                        If you are reading this using google groups then also read this:
                        http://www.safalra.com/special/googlegroupsreply/ if you have not done so
                        already. If you reply to this post without correct quoting and attribution,
                        as per the above, I, and others, may just totally ignore you.

                        Comment

                        • rf

                          #13
                          Re: CommonDialog

                          VK wrote:
                          [color=blue]
                          > Duncan Booth wrote:[color=green]
                          >> Do you have evidence for this? Everything I can find says comgld32.dll is
                          >> not redistributable .[/color]
                          >
                          > Let's us clear up the situation based on OP issue:
                          >
                          > He's using MSComDlg.Common Dialog which is COMDLG32.OCX control[/color]

                          True. Missed that first time :-)
                          [color=blue]
                          > available on Windows XP with Visual Studio / Visual Studio # installed.
                          > You have to either install a copy of Visual Studio on each computer or
                          > you have to get a destribution license from Microsoft to register this
                          > control on each computer.[/color]

                          Lets clear it up entirely and avoid anybody thinking that their users might
                          have to have visual studio installed. At several hundred dollars a copy...

                          The following knowledge base article tells all:


                          [color=blue]
                          > COMDLG32.DLL library is presented in each Windows installation starting
                          > Windows 98 at least.[/color]

                          95, and before that win32s.
                          [color=blue]
                          > So if you have a legal copy of Windows, you
                          > already have a legal copy of COMDLG32.DLL - so no destribution is
                          > needed.[/color]

                          Yes.
                          [color=blue]
                          > The trick is that you cannot use ActiveXObject() on .DLL because it's
                          > not a control, it's a library you can link to your project to make your
                          > own control.[/color]

                          Er, you link to it so as to use the common dialogs. If you want to make
                          your own control you, well, make your own control.
                          [color=blue]
                          > A side walk for the OP situation (presuming they have basic Microsoft
                          > Office package installed) would be to call Excel dialog window via
                          > ActiveXObject. This dialog (but not Word's one) can be patched to
                          > accept multiple file selection.[/color]

                          ?

                          --
                          Cheers, Richard.
                          If you are reading this using google groups then also read this:
                          http://www.safalra.com/special/googlegroupsreply/ if you have not done so
                          already. If you reply to this post without correct quoting and attribution,
                          as per the above, I, and others, may just totally ignore you.

                          Comment

                          • VK

                            #14
                            Re: CommonDialog

                            > VK wrote:[color=blue][color=green]
                            > > A side walk for the OP situation (presuming they have basic Microsoft
                            > > Office package installed) would be to call Excel dialog window via
                            > > ActiveXObject. This dialog (but not Word's one) can be patched to
                            > > accept multiple file selection.[/color][/color]

                            rf wrote:[color=blue]
                            > ?[/color]

                            new ActiveXObject(' Application.Exc el')
                            and later Dialogs(wdDialo gFileOpen)

                            This works but it's too ugly and unrealiable (too many if's)

                            I came across this problem while doing my JavaScript file manager. The
                            question was: presuming user granted all requested privileges - how to
                            display system file dialog and get results back?

                            So far my answer is "no way unless you're acting as a miserable
                            hacker". Truthfully I do not understand all this licensing dancing with
                            comdlg. IMHO user already paid in full for the honnor to click all
                            Windows buttons and open all Windows windows - when she bought her copy
                            of Windows. An attempt to collect additional bucks on this later seems
                            a bit of a scam to me.

                            Interstingly enough Gesko seems to have no problem to access system
                            dialogs via XPConnect:
                            <http://groups.google.c om/group/comp.lang.javas cript/browse_frm/thread/7cd482713658987 b/61b24d432da604b 8>

                            I wondering now if this is license clear? ...

                            Comment

                            • rf

                              #15
                              Re: CommonDialog

                              VK wrote:
                              [color=blue][color=green]
                              >> VK wrote:[color=darkred]
                              >>> A side walk for the OP situation (presuming they have basic Microsoft
                              >>> Office package installed) would be to call Excel dialog window via
                              >>> ActiveXObject. This dialog (but not Word's one) can be patched to
                              >>> accept multiple file selection.[/color][/color]
                              >
                              > rf wrote:[color=green]
                              >> ?[/color]
                              >
                              > new ActiveXObject(' Application.Exc el')
                              > and later Dialogs(wdDialo gFileOpen)
                              >
                              > This works but it's too ugly and unrealiable (too many if's)
                              >
                              > I came across this problem while doing my JavaScript file manager. The
                              > question was: presuming user granted all requested privileges - how to
                              > display system file dialog and get results back?
                              >
                              > So far my answer is "no way unless you're acting as a miserable
                              > hacker". Truthfully I do not understand all this licensing dancing with
                              > comdlg. IMHO user already paid in full for the honnor to click all
                              > Windows buttons and open all Windows windows - when she bought her copy
                              > of Windows. An attempt to collect additional bucks on this later seems
                              > a bit of a scam to me.
                              >
                              > Interstingly enough Gesko seems to have no problem to access system
                              > dialogs via XPConnect:
                              > <http://groups.google.c om/group/comp.lang.javas cript/browse_frm/thread/7cd482713658987 b/61b24d432da604b 8>
                              >
                              > I wondering now if this is license clear? ...[/color]

                              I repeat:

                              ?

                              That is, I have no bloody idea what you are talking about.

                              What has firing up excel do to with running the commondialog ocx control?

                              --
                              Cheers, Richard.
                              If you are reading this using google groups then also read this:
                              http://www.safalra.com/special/googlegroupsreply/ if you have not done so
                              already. If you reply to this post without correct quoting and attribution,
                              as per the above, I, and others, may just totally ignore you.

                              Comment

                              Working...