+ Reply to Thread
Results 1 to 16 of 16

Thread: [howto] making a windows shell extension with qt open-source edition

  1. #1
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [howto] making a windows shell extension with qt open-source edition

    Hello,

    I've managed to create a Windows shell extension using qt open-source edition and the freely distributed visualstudioexpress. I'm new to Qt C++ programming and very new to Windows programming. I was told this could make an interesting tutorial, perhaps for the wiki.
    As I'm new, there may be much room for improvements, maybe we can even get rid of visualstudioexpress (or at least replace it with some more basic sdk).

    This is a work in progress, and you're invited to give feedback, make suggestions or even patches, it would be a team work.

    [The tutorial follows in the next post, due to the size limit of a forum post]

  2. The following 3 users say thank you to Tilda for this useful post:

    ajax (6th December 2010), cheesethief (23rd July 2013)

  3. #2
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Qt Code:
    1. In this tutorial, we will make a windows shell extension using Qt and visualstudio express. This extension will add some overlay icons to files in the file explorer. Files whose names contain a 'q' or a 't' will have their icon modified.
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. Note: perhaps visualstudio express is not even needed, perhaps only some free windows SDK. What is needed from it is its "midl" tool since there is no opensource alternative yet.
    2. Disclaimer: this tutorial is a work in progress.
    3.  
    4. The ActiveQt OpenGL example was the nearest to this task and helped doing this task. [http://doc.trolltech.com/4.6/activeqt-opengl.html]
    5.  
    6. Concepts used in the tutorial
    7. =============================
    8.  
    9. What is a "shell extension"?
    10. ----------------------------
    11. A shell extension is a plugin for the windows shell, namely explorer.exe, or open/save file dialogs in any application (e.g. notepad). An extension can for example change the display of icons in the explorer (which we will do in this tutorial), add items in the contextual menu, etc.
    12.  
    13. A shell extension is a DLL file that needs to be "registered" so it can be enabled and used by the shell.
    14.  
    15. Registering an extension
    16. ------------------------
    17. An extension will start taking effect after it is registered, and separately in apps started _after_ registration. If the extension is just registered, you won't see its effects in explorer yet. If you start notepad after, you will see the extension effects in notepad, but not in explorer.exe. explorer.exe will have to be restarted (or the computer rebooted) to see the effect in explorer.
    18.  
    19. Symmetrically, unregistration will not disable the extension immediately in all applications. Applications still running while the extension is unregistered will still have the extension loaded until the apps are exited.
    20.  
    21. This has an importance while developping the extension, as the extension file DLL can't be overwritten while it's in use, unregistering it is not enough.
    22.  
    23. Here, we will register/unregister extensions using the "regsvr32" command.
    24.  
    25. To register an extension:
    26. regsvr32 the_extension.dll
    27.  
    28. To unregister it:
    29. regsvr32 /u the_extension.dll
    30.  
    31. The /s flag can be added to the regsvr32 command to enable "silent mode", which disables the annoying dialogbox. But we won't use it at first, since it doesn't report registration errors.
    32.  
    33.  
    34. 32-bits/64-bits compatibility
    35. -----------------------------
    36.  
    37. An extension, as a native binary DLL, is very sensitive to byte-architecture.
    38. Whereas a 32-bits program can be run on a 64-bits OS, a DLL is more complicated: it has to be be in the same bytes architecture as the program that loads it.
    39. This means that on a 64-bits OS, 2 DLLs will be needed: a 64-bits one for 64-bits programs like explorer.exe, and a 32-bits one for 32-bits programs like many. Remember that your extension can be used in third-party, non-builtin-in-windows programs, for example any program that has an open/save file dialog.
    40.  
    41.  
    42. Basic anatomy of a shell extension and COM
    43. ------------------------------------------
    44.  
    45. A shell extension has to provide an API to applications that will use it, through a protocol called "COM". The shell extension will be a COM server, as it exposes its API, and the apps will be COM clients.
    46. A COM server in a DLL is called an "in-process" server.
    47.  
    48. The API it implements follows some defined "COM interfaces" (interface is the 'I' in "API", it's a kind of abstract class).
    49.  
    50. The API is implemented in a class, each instance of this class is a "COM object".
    51.  
    52. Our shell extension, displaying icon overlays, will implement the "IShellIconOverlayIdentifier" interface.
    53.  
    54. COM objects need a COM factory to be created by the COM clients.
    55.  
    56. COM interfaces implementations need declaration in a special language called IDL. These IDL declarations will be generated by an "MIDL" tool.
    57.  
    58.  
    59. ActiveQt
    60. --------
    61.  
    62. ActiveQt is a Qt module that will provide us classes for implementing COM servers and building COM factories. It also provides many other features which we won't need here. All classes names from ActiveQt start with "QAx".
    63. We will use its QAxServer submodule.
    64.  
    65. - http://doc.trolltech.com/4.6/activeqt.html
    66. - http://doc.trolltech.com/4.6/activeqt-server.html
    67.  
    68. VisualStudio Express
    69. --------------------
    70.  
    71. In this tutorial, we will use VisualStudioExpress, which is free, for its "midl" tool, that will generate IDL definitions for our shell extension.
    72.  
    73. - http://www.microsoft.com/express/
    74.  
    75. GUIDs
    76. -----
    77.  
    78. GUIDs, Class IDs (CLSID), Interface IDs (IID) are all UUIDs, 128-bits Universally Unique IDentifiers.
    79. They are used to identify every published component of a shell extension and to tell them apart from all shell extensions in the world.
    80. As they are 128-bits, which is big, a randomly generated UUID is generally enough, there is no need of a central registry to check our UUID is not already used.
    81.  
    82. For example, "60c580d2-41f2-43ed-b5d1-b435d74d1999" is an UUID.
    83.  
    84. We can use the VisualStudioExpress builtin generator, or use any uuid generator tool. Qt does not provide one, but there are many, for example, python can be used to generate one:
    85. python -c "import uuid; print uuid.uuid4()"
    86.  
    87.  
    88.  
    89. ============
    90.  
    91. Starting
    92. --------
    93. In QtCreator, start a new "C++ library" project, we can call it "shellext_overlay". This project does not need QtGui.
    94.  
    95. Create a new C++ class (called "ShellOverlay" for example).
    96.  
    97. The COM object class
    98. --------------------
    99.  
    100. Our class will be the class for the COM object. So it will have to inherit QObject (first, because Qt needs QObject always be the first), QAxAggregated and the COM interfaces we implement: IShellIconOverlayIdentifier.
    101.  
    102.  
    103. class SHELLEXT_OVERLAYSHARED_EXPORT ShellOverlay : public QObject, public QAxAggregated, public IShellIconOverlayIdentifier {
    104.  
    105.  
    106. All COM interfaces inherit the IUnknown interface, so we would have to implement it, but Qt provides a sane default implementation for it, which can be included with the QAXAGG_IUNKNOWN macro in our class declaration.
    107.  
    108. long queryInterface(const QUuid &iid, void**iface);
    109. ???
    110.  
    111. IShellIconOverlayIdentifier interface
    112. +++++++++++++++++++++++++++++++++++++
    113. The IShellIconOverlayIdentifier defines 3 members we will need to implement, here is their declaration
    114.  
    115.  
    116. /*! Query information about the overlay icon
    117. \param pwszIconFile output parameter where to put the array of overlay icon (wchar_t **)
    118. \param cchMax size of the pwszIconFile buffer, in characters (not bytes)
    119. \param pIndex output parameter, index of the icon in the pwszIconFile file (e.g. if the file contains multiple icons), starting at 0
    120. \param pdwFlags output parameter, options for the overlay icon
    121. \return S_OK in case of success
    122. */
    123. STDMETHOD(GetOverlayInfo)(LPWSTR pwszIconFile, int cchMax, int *pIndex, DWORD* pdwFlags);
    124.  
    125. STDMETHOD(GetPriority)(int* pPriority);
    126.  
    127. /*! Query if the overlay is present for a particular file
    128. \param pwszPath path of the file to query (wchar_t*)
    129. \param dwAttrib attributes of the file
    130. \return S_OK if the icon has to be overlayed, S_FALSE else
    131. */
    132. STDMETHOD(IsMemberOf)(LPCWSTR pwszPath,DWORD dwAttrib);
    133.  
    134. Implementation of the class
    135. +++++++++++++++++++++++++++
    136.  
    137. long ShellOverlay::queryInterface(const QUuid &iid, void **iface) {
    138. *iface = 0;
    139. if (iid == IID_IShellIconOverlayIdentifier)
    140. *iface = (IShellIconOverlayIdentifier *)this;
    141. else
    142. return E_NOINTERFACE;
    143.  
    144. AddRef();
    145. return S_OK;
    146. }
    147.  
    148.  
    149. Implementation of the interface
    150. +++++++++++++++++++++++++++++++
    151.  
    152. In this function, we have to return information about our icon. Our icon will be embedded in the DLL file, whose path is QAxFactory::serverFilePath(). It will be the first icon in the DLL file.
    153.  
    154. STDMETHODIMP ShellOverlay::GetOverlayInfo(LPWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags) {
    155. QString iconPath(QAxFactory::serverFilePath());
    156. if (iconPath.length() > cchMax)
    157. return S_FALSE;
    158.  
    159. int len = iconPath.toWCharArray(pwszIconFile);
    160. pwszIconFile[len] = L'\0';
    161.  
    162. *pIndex = 0;
    163. *pdwFlags = ISIOI_ICONFILE | ISIOI_ICONINDEX;
    164.  
    165. return S_OK;
    166. }
    167.  
    168. This function is not important in this tutorial.
    169. STDMETHODIMP ShellOverlay::GetPriority(int *pPriority) {
    170. *pPriority = 0;
    171. return S_OK;
    172. }
    173.  
    174. In this function, we have to tell if a file's icon has to be modified by ours, or not. If the filename contains a 'q' or a 't', we reply it should.
    175. STDMETHODIMP ShellOverlay::IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib) {
    176. QFileInfo info(QString::fromWCharArray(pwszPath));
    177. QString filename = info.fileName();
    178. if (filename.contains(QChar('q')) || filename.contains(QChar('t')))
    179. return S_OK;
    180. return S_FALSE;
    181. }
    182.  
    183. - http://msdn.microsoft.com/en-us/library/bb761265%28v=VS.85%29.aspx
    To copy to clipboard, switch view to plain text mode 

    To be continued in next post.

  4. The following 2 users say thank you to Tilda for this useful post:

    caesarxx (16th August 2010)

  5. #3
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Qt Code:
    1. The COM factory
    2. ---------------
    3.  
    4. In "shelloverlay.h", we will declare this class:
    5. class ShellOverlayBinder : public QObject, public QAxBindable {
    6. Q_OBJECT
    7.  
    8. public:
    9. ShellOverlayBinder(QObject *parent = 0);
    10.  
    11. QAxAggregated *createAggregate();
    12. };
    13.  
    14. Add a dllmain.cpp file to the project, which will contain:
    15.  
    16. #include <qt_windows.h>
    17. #include <ActiveQt>
    18. #include <QAxFactory>
    19. #include "shelloverlay.h"
    20. QT_USE_NAMESPACE
    21. QAXFACTORY_DEFAULT(ShellOverlayBinder,
    22. "{60c580d2-41f2-43ed-b5d1-b435d74d1999}", /* Class ID (CLSID) */
    23. "{21a9e71b-9ae4-4887-8ada-720442394493}", /* Interface ID (IID) */
    24. "{8c996c29-eafa-46ac-a6f9-901951e765b5}", /* event interface ID */
    25. "{a6b1968a-4bbc-4420-9a55-5ce3579f795a}", /* Type Library ID (TLB) */
    26. "{4f7d37e8-b9cb-4e66-a725-f043753b755c}" /* Application ID (AppID) */
    27. )
    28.  
    29. Every UUID in this file has to be generated. The ones were used on the author's machine and are fine for this tutorial, but if you want to make your own shell extension, you will have to generate new ones yourself.
    30.  
    31. - http://doc.trolltech.com/4.6/qaxfactory.html
    32.  
    33. Additional files, embedding the icon
    34. ------------------------------------
    35.  
    36. We will need a .def file, which will declare the exported symbols. The file from <qt>\src\activeqt\control\qaxserver.def will be enough, we can use it verbatim.
    37.  
    38. We will also need a .rc file, containing this:
    39.  
    40. 1 TYPELIB "qaxserver.rc"
    41. 1 ICON DISCARDABLE "qtoverlay.ico"
    42.  
    43. We will ultimately need an icon file. We will for example use Qt's favicon, modified so it only covers a quarter of the file.
    44.  
    45. % wget http://qt.nokia.com/favicon.ico
    46. % convert favicon.ico -alpha on -background none -gravity southeast -extent 32x32 qtoverlay.ico
    47.  
    48. We will put these 3 files at the root of our project dir. You can add also add them to the project in QtCreator.
    49.  
    50.  
    51. Build
    52. -----
    53.  
    54. QMake configuration
    55. +++++++++++++++++++
    56. The qmake .pro file will need some modifications.
    57. Add this:
    58.  
    59. CONFIG += dll qaxserver qt
    60.  
    61. qaxserver is used to include some default implementations (for the symbols from the .def file we previously included) ActiveQt provides and which suit our needs.
    62.  
    63. LIBS += -luser32 -lole32 -loleaut32 -lgdi32 -luuid
    64. DEF_FILE = qaxserver.def
    65. RC_FILE = qaxserver.rc
    66.  
    67. - http://doc.trolltech.com/4.6/qmake-manual.html
    68.  
    69. Include VisualStudioExpress tools path
    70. ++++++++++++++++++++++++++++++++++++++
    71. TODO this section needs work
    72. Open a "cmd" prompt, exec vcvars32.bat in it, and run qtcreator from there.
    73.  
    74. Build
    75. +++++
    76. The project should now build fine.
    77.  
    78.  
    79. Run
    80. ---
    81.  
    82. Installation
    83. ++++++++++++
    84. TODO this section needs work, the registry part should be in DllInstall perhaps in the future
    85.  
    86. A key with any name must be created in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers, and its default value should be the bracketed (with '{' and '}' around it) ClassID of our extension (the class id can be found in dllmain.cpp).
    87.  
    88. Registration and dependencies
    89. +++++++++++++++++++++++++++++
    90. TODO this section needs work
    91.  
    92. Unfortunately, the DLL has dependencies to other DLL files, that have to be copied in the same directory as our DLL, these are:
    93. - mingwm10.dll (found in <qt>\bin)
    94. - libgcc_s_dw2-1.dll (found in <qt>\bin)
    95. - QtCore4.dll (or QtCored4.dll if the extension is built in "debug")
    96. - QtGui4.dll (or QtGuid4.dll if debug) (TODO this should not be needed)
    97.  
    98. The extension can now be registered, by typing "regsvr32 shellext_overlay.dll".
    99.  
    100. If regsvr32 says "the specified module could not be found", it may have some other dependencies. The "Dependency Walker" tool can be used to find them.
    101.  
    102. - http://www.dependencywalker.com/
    103.  
    104. Test
    105. ++++
    106.  
    107. Now, we can start notepad (or any app with a file selection dialog), select "open..." and watch our shell extension at work!
    To copy to clipboard, switch view to plain text mode 

  6. The following user says thank you to Tilda for this useful post:


  7. #4
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Attaching the project files.

    Sorry for the format of the posts, I wrote in semi-restructuredtext, it should be reformatted later.

  8. The following user says thank you to Tilda for this useful post:


  9. #5
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    1
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Hi,

    Thanks for this post !

    I manged to build your project and it registers fine.... but somehow doesn't work.
    I added

    "
    QFile file("/tmp/out.txt");
    if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
    QTextStream out(&file);
    out << "getoverlayinfo " << "\n";
    } else { }
    "

    to almost every function since i didn't know how to debug the dll file proberly.. but out.txt is emty..
    do you have any hints ?

    in your project file you named your icon qtdemo.ico not qtoverlay.ico... ?! i created both..
    i used your Class IDs... should be fine for testing ?

    it's my first qt project and i really don't know where to look....

    Thanks,!

  10. The following user says thank you to caesarxx for this useful post:


  11. #6
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Hello,

    Quote Originally Posted by caesarxx View Post
    I manged to build your project and it registers fine.... but somehow doesn't work.
    I added

    "
    QFile file("/tmp/out.txt");
    if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
    QTextStream out(&file);
    out << "getoverlayinfo " << "\n";
    } else { }
    "

    to almost every function since i didn't know how to debug the dll file proberly.. but out.txt is emty..
    do you have any hints ?
    Your .txt file is created by the DLL or not even at all? You also use the "/tmp/out.txt" path on Windows? Does it work?

    Are you on a 32bits Windows with a 32bits QtCreator and did you restart explorer (restart explorer means either kill the process/launch again, or close session and restart, or reboot)? If not, it may be the cause if the registration works but the DLL doesn't do its job.
    If it's the reason, you can still start a fresh process of a 32bits app (SciTE for example), and go to "File > Open..." see if overlays are present.
    This may not be clear enough in this howto, it should be rewritten with better style.


    Quote Originally Posted by caesarxx View Post
    in your project file you named your icon qtdemo.ico not qtoverlay.ico... ?! i created both..
    qtdemo.ico is a mistake in the .pro file, it should be qtoverlay.ico but it shouldn't prevent the overlays from being displayed.
    Quote Originally Posted by caesarxx View Post
    i used your Class IDs... should be fine for testing ?
    Yes, using the same GUID is OK as both mine and yours are examples on our own machines.


    About debugging, I have not tried that yet with but it's a good idea of a thing to look at. On the general principle, you should attach the debugger to a process that uses the DLL (explorer.exe for example) and put breakpoints in your DLL code.
    Last edited by Tilda; 19th August 2010 at 17:43.

  12. The following user says thank you to Tilda for this useful post:


  13. #7
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    1
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Hi,

    The TextFile isn't created at all.. i tested the code in another simple programm and "/tmp/out.txt" worked there.. ( even with windows.. )

    seems like the dll isn't called at all.... ( or has no rights to access /tmp... who knows :-)


    I tried restarting windows, explorer and i started notepad :-)

    hmm... still have no idea.. maybe a windows 7 issue....

    i try to get a debugger an explorer.exe working..

    Thanks !

  14. The following user says thank you to caesarxx for this useful post:


  15. #8
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Is it a 32bits Windows or 64bits?

    I did not try with Windows 7, maybe it requires administrator rights to register the DLL.

  16. The following user says thank you to Tilda for this useful post:


  17. #9
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    1
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Its 32 bits and i tried registering with a Administrator cmd line and without... maybe i try windows xp first...

    what system do you use ?

  18. The following user says thank you to caesarxx for this useful post:


  19. #10
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    1
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4

    Default Re: [howto] making a windows shell extension with qt open-source edition

    for future reference :

    i did everything a second time on a new windows installation, this time i generated new uuid from http://www.famkruithof.net/uuid/uuidgen
    and now it works !!

    Thanks for your Help and efford writing this tutorial !!!

  20. The following user says thank you to caesarxx for this useful post:


  21. #11
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Quote Originally Posted by caesarxx View Post
    for future reference :

    i did everything a second time on a new windows installation, this time i generated new uuid from http://www.famkruithof.net/uuid/uuidgen
    and now it works !!

    Thanks for your Help and efford writing this tutorial !!!
    This is really strange, it can't come from the UUID, but I don't understand what was the problem with your old system

    Thank you too for trying my tutorial
    The tutorial still needs work, some things could be done better (like avoiding MS SDK), or explained better.
    Don't hesitate to point out things that were unclear, you can even write text if you have inspiration, if the whole becomes good enough, we could post it to wiki as a collaborative work.

  22. The following user says thank you to Tilda for this useful post:


  23. #12
    Join Date
    Aug 2010
    Posts
    6
    Thanks
    1
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4

    Default Re: [howto] making a windows shell extension with qt open-source edition

    I think it's quite good ! There are only two things i didn't unterstand at first... ( and this was my first qt project ever ! )

    1. Where is the icon comming from.. the filename nevers shows anywerer exept the resource file...
    2. Where is the tmp folder stuff comming from....

    2.-> i found out why it wasn't working on my first try... i don't know why but if i move my project in any other directory than "c:\qt\2010.04\qt" it doesn't work ! if i qmake the projekt the make files are very different than qmake in e.g. c:\projects\. The makefile creates a tmp folder and other stuff but only if qmake is called in the qt directory....... i still can't find out why it has to be in this directroy.. is it you default dir ? where is this saved ? i looked at every file in your example project...

    very very stange.... i used cmd, not qtcreator...

    i keep you postet if i every find out why... a.. and one other thing...

    If anyone want's to use more than one icon :


    in dllmain.cpp:

    QAXFACTORY_BEGIN(
    "{4c52cc51-89f0-48e0-9678-474e3613d9d7}", /* Type Library ID (TLB) */
    "{5c52cc51-89f0-48e0-9678-474e3613d9d7}" /* Application ID (AppID) */
    )
    QAXCLASS(SOSyncedBinder)
    QAXCLASS(SOUnsyncedBinder)
    QAXFACTORY_END()



    and in your class header file for each binded class:

    class SOSyncedBinder : public QObject, public QAxBindable {

    Q_CLASSINFO("ClassID", "{1955991f-0df0-4563-8a0b-624a227605d6}")
    Q_CLASSINFO("InterfaceID", "{2955991f-0df0-4563-8a0b-624a227605d6}")
    Q_CLASSINFO("EventsID", "{3955991f-0df0-4563-8a0b-624a227605d6}")

  24. The following 2 users say thank you to caesarxx for this useful post:

    Tilda (2nd September 2010)

  25. #13
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    1
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: [howto] making a windows shell extension with qt open-source edition

    Quote Originally Posted by caesarxx View Post
    I think it's quite good ! There are only two things i didn't unterstand at first... ( and this was my first qt project ever ! )

    1. Where is the icon comming from.. the filename nevers shows anywerer exept the resource file...
    2. Where is the tmp folder stuff comming from....

    2.-> i found out why it wasn't working on my first try... i don't know why but if i move my project in any other directory than "c:\qt\2010.04\qt" it doesn't work ! if i qmake the projekt the make files are very different than qmake in e.g. c:\projects\. The makefile creates a tmp folder and other stuff but only if qmake is called in the qt directory....... i still can't find out why it has to be in this directroy.. is it you default dir ? where is this saved ? i looked at every file in your example project...

    very very stange.... i used cmd, not qtcreator...
    It's weird, I did not put my project anywhere under c:\qt\ but in "my documents", and IIRC I did not put absolute path references.

    Quote Originally Posted by caesarxx View Post

    i keep you postet if i every find out why... a.. and one other thing...

    If anyone want's to use more than one icon :


    in dllmain.cpp:

    QAXFACTORY_BEGIN(
    "{4c52cc51-89f0-48e0-9678-474e3613d9d7}", /* Type Library ID (TLB) */
    "{5c52cc51-89f0-48e0-9678-474e3613d9d7}" /* Application ID (AppID) */
    )
    QAXCLASS(SOSyncedBinder)
    QAXCLASS(SOUnsyncedBinder)
    QAXFACTORY_END()



    and in your class header file for each binded class:

    class SOSyncedBinder : public QObject, public QAxBindable {

    Q_CLASSINFO("ClassID", "{1955991f-0df0-4563-8a0b-624a227605d6}")
    Q_CLASSINFO("InterfaceID", "{2955991f-0df0-4563-8a0b-624a227605d6}")
    Q_CLASSINFO("EventsID", "{3955991f-0df0-4563-8a0b-624a227605d6}")
    Thank you for finding how to use multiple extensions in the same DLL!
    And also thanks for the feedback!

  26. The following user says thank you to Tilda for this useful post:


  27. #14
    Join Date
    May 2013
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Error ? I run on QT 2.6.1 . Can you help me ???Error overlay.png

  28. The following user says thank you to tanbmuit for this useful post:


  29. #15
    Join Date
    May 2013
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Icon overlay not show in win 64bit ??? help me

  30. #16

    Default Re: [howto] making a windows shell extension with qt open-source edition

    Same here. Cannot make it work on Win7 x64 with Visual Studio 2010 and Qt 4.8.4. Any hints?

+ Reply to Thread

Similar Threads

  1. Replies: 1
    Last Post: 8th February 2009, 15:08
  2. OLE with Qt Open Source Edition??
    By Arpan in forum Qt Programming
    Replies: 3
    Last Post: 6th August 2008, 14:00
  3. Open Source on Windows
    By yogeshgokul in forum Installation and Deployment
    Replies: 3
    Last Post: 29th January 2008, 09:54
  4. Qt/Windows Open Source Edition to support VS Express
    By pdolbey in forum Installation and Deployment
    Replies: 3
    Last Post: 23rd September 2007, 14:32
  5. Qtopia 4.2 Open Source edition released!
    By lpotter in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 21st December 2006, 20:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts