Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. dumpcpp.exe not working properly on clsid.
Forum Updated to NodeBB v4.3 + New Features

dumpcpp.exe not working properly on clsid.

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 829 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Ketan
    wrote on 23 Jul 2019, 09:10 last edited by
    #1

    I've been trying to generate .cpp, .h files of an activex using dumpcpp.exe but there isn't any progress yet.
    Cmd : dumpcpp -getfile {6BF52A52-394A-11d3-B153-00C04F79FAA6}

    P.S: I don't want to generate files using source dll. Requirement is to generate files with CLSID.
    Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 23 Jul 2019, 10:20 last edited by
      #2

      Hi
      It checks a certain key.

      if (category == TypeLibID) {
              QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\Software\\Classes\\TypeLib\\") +
                                 QString::fromLatin1(typeLib.constData()), QSettings::NativeFormat);
              typeLib = QByteArray();
              QStringList codes = settings.childGroups();
              for (int c = 0; c < codes.count(); ++c) {
                  typeLib = settings.value(QLatin1String("/") + codes.at(c) + QLatin1String("/0/win32/.")).toByteArray();
                  if (QFile::exists(QString::fromLatin1(typeLib))) {
                      break;
                  }
              }
      

      so first step is to check if its actually such clSid ( in registry )
      in the location
      QLatin1String("HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\"

      K 1 Reply Last reply 23 Jul 2019, 10:26
      0
      • M mrjj
        23 Jul 2019, 10:20

        Hi
        It checks a certain key.

        if (category == TypeLibID) {
                QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\Software\\Classes\\TypeLib\\") +
                                   QString::fromLatin1(typeLib.constData()), QSettings::NativeFormat);
                typeLib = QByteArray();
                QStringList codes = settings.childGroups();
                for (int c = 0; c < codes.count(); ++c) {
                    typeLib = settings.value(QLatin1String("/") + codes.at(c) + QLatin1String("/0/win32/.")).toByteArray();
                    if (QFile::exists(QString::fromLatin1(typeLib))) {
                        break;
                    }
                }
        

        so first step is to check if its actually such clSid ( in registry )
        in the location
        QLatin1String("HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\"

        K Offline
        K Offline
        Ketan
        wrote on 23 Jul 2019, 10:26 last edited by
        #3

        @mrjj Checked. It exists, so does the problem. Also, I'm not including TYPELIB in my project. I'm running dumpcpp.exe directly through command prompt. This doesn't occur if I'm using .dll file instead of CLSID.

        M 1 Reply Last reply 23 Jul 2019, 10:28
        1
        • K Ketan
          23 Jul 2019, 10:26

          @mrjj Checked. It exists, so does the problem. Also, I'm not including TYPELIB in my project. I'm running dumpcpp.exe directly through command prompt. This doesn't occur if I'm using .dll file instead of CLSID.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 23 Jul 2019, 10:28 last edited by mrjj
          #4

          @Ketan
          The docs just says
          "-getfile libid Print the filename for the typelibrary libid to stdout"

          nothing about it will generate files. So i wonder if it should and its a bug or
          it only wants DLLs.
          Give it a day. Someone is bound to have tried this :)

          K 1 Reply Last reply 23 Jul 2019, 10:30
          1
          • M mrjj
            23 Jul 2019, 10:28

            @Ketan
            The docs just says
            "-getfile libid Print the filename for the typelibrary libid to stdout"

            nothing about it will generate files. So i wonder if it should and its a bug or
            it only wants DLLs.
            Give it a day. Someone is bound to have tried this :)

            K Offline
            K Offline
            Ketan
            wrote on 23 Jul 2019, 10:30 last edited by
            #5

            @mrjj Ah, okay! Is there any other way to get files?

            M 1 Reply Last reply 23 Jul 2019, 10:32
            0
            • K Ketan
              23 Jul 2019, 10:30

              @mrjj Ah, okay! Is there any other way to get files?

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 23 Jul 2019, 10:32 last edited by
              #6

              @Ketan
              well normally that is via the DLL.
              But it sounds like you need not to use the dlls ?

              K 1 Reply Last reply 23 Jul 2019, 11:05
              0
              • M mrjj
                23 Jul 2019, 10:32

                @Ketan
                well normally that is via the DLL.
                But it sounds like you need not to use the dlls ?

                K Offline
                K Offline
                Ketan
                wrote on 23 Jul 2019, 11:05 last edited by
                #7

                @mrjj I do want to. Is it possible to get dll path based on ActiveX control name? If not, any other alternative will be highly appreciated. Thanks!

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  hskoglund
                  wrote on 24 Jul 2019, 00:19 last edited by
                  #8

                  Hi, to get the dll path you can search for it in the Windows registry, here's a Qt console test program:

                  include "qsettings.h"
                  #include "stdio.h"
                  
                  void main(int argc, char *argv[])
                  {
                      QString progid = *++argv;
                      if (progid.isEmpty())
                          progid = "WMPlayer.ocx";  // default (6BF52A52-394A-11d3-B153-00C04F79FAA6)
                  
                      QSettings s1(QString("\\HKEY_CLASSES_ROOT\\%1\\CLSID").arg(progid),QSettings::NativeFormat);
                      QString clsid = s1.value(".").toString();
                  
                      QSettings s2(QString("\\HKEY_CLASSES_ROOT\\CLSID\\%1\\InprocServer32").arg(clsid),QSettings::NativeFormat);
                      puts(s2.value(".").toString().toLatin1());
                  }
                  
                  K 1 Reply Last reply 24 Jul 2019, 04:06
                  6
                  • H hskoglund
                    24 Jul 2019, 00:19

                    Hi, to get the dll path you can search for it in the Windows registry, here's a Qt console test program:

                    include "qsettings.h"
                    #include "stdio.h"
                    
                    void main(int argc, char *argv[])
                    {
                        QString progid = *++argv;
                        if (progid.isEmpty())
                            progid = "WMPlayer.ocx";  // default (6BF52A52-394A-11d3-B153-00C04F79FAA6)
                    
                        QSettings s1(QString("\\HKEY_CLASSES_ROOT\\%1\\CLSID").arg(progid),QSettings::NativeFormat);
                        QString clsid = s1.value(".").toString();
                    
                        QSettings s2(QString("\\HKEY_CLASSES_ROOT\\CLSID\\%1\\InprocServer32").arg(clsid),QSettings::NativeFormat);
                        puts(s2.value(".").toString().toLatin1());
                    }
                    
                    K Offline
                    K Offline
                    Ketan
                    wrote on 24 Jul 2019, 04:06 last edited by Ketan
                    #9

                    @hskoglund It Works. Thank you!

                    1 Reply Last reply
                    0

                    1/9

                    23 Jul 2019, 09:10

                    • Login

                    • Login or register to search.
                    1 out of 9
                    • First post
                      1/9
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved