Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

seriema

@seriema
About
Posts
8
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • using ATL7.0 instead of ATL3, I'm missing something but what?
    S seriema

    The tutorial had this:

    BEGIN_OBJECT_MAP(ObjectMap)
    OBJECT_ENTRY(CLSID_SimpleShlExt, CSimpleShlExt)
    END_OBJECT_MAP()

    // DllMain(), a bunch of stuff and:
    _Module.Init(ObjectMap, hInstance, &LIBID_SIMPLEEXTLib); // Where _Module is a CComModule

    What I found out from MSDN is that that type of object map has been replaced by OBJECT_ENTRY_AUTO and inspecting my code VS.NET had already generated this for me: OBJECT_ENTRY_AUTO(__uuidof(T2TContextMenu), CT2TContextMenu) What I've understood that means that the main module object does has some kind of reference to my context menu. But why isn't it called?

    ATL / WTL / STL tutorial csharp c++ visual-studio com

  • using ATL7.0 instead of ATL3, I'm missing something but what?
    S seriema

    Yes, VS.NET created that for me. There's a global CThis2ThatModule _AtlModule; Init() is completely gone according to MSDN and is "replaced" by the constructor. While Term() is still there it's called by the destructor. What I don't know how to do is how I should pass my CT2TContextMenu so CThis2ThatModule will register it or whatever it's called. When the Init() function was available in ATL3.0 there was a object map and that was passed to _TheGlobalModule.Init(), this is where my CT2TContextMenu would've been passed. But I don't know how to do it in ATL7.0...

    ATL / WTL / STL tutorial csharp c++ visual-studio com

  • using ATL7.0 instead of ATL3, I'm missing something but what?
    S seriema

    Hello! I've implemented IShellExtInit and IContextMenu and followed the Complete Idiots guide by Michael Dunn. But I'm using ATL7.0 and some stuff is different. Like the CComModule has been replaced. From MSDN: "As of ATL 7.0, CComModule is obsolete: see ATL Module Classes for more details." The wizard in VS.NET 2003 implemented CAtlDllModuleT. Everything compiles, but my class (T2TContextMenu) isn't called (I have set up breakpoints in all functions). I've checked the registry and my key is there: HKEY_CLASSES_ROOT\.omfg\ShellEx\ContextMenuHandlers\This2That default value = "{3E670573-EA3F-498A-8EB1-F72DA6B5D221}" as a string The only difference I can see between my code and the tutorial is in the DllMain(). The tutorial calls _Module.Init(ObjectMap, hInstance, &LIBID_SIMPLEEXTLib); and has a Object map that includes the COM class the DLL is going to use. Mine doesn't. So my guess is that I have to pass the CLSID and maybe my classname somewhere to CAtlDllModuleT. MSDN gave me this: "Init and Term methods have moved into the constructors and destructors for the module classes; there is no longer a need to call Init and Term." VS.NET created CThis2That like this:

    class CThis2ThatModule : public CAtlDllModuleT< CThis2ThatModule >
    {
    public :
    DECLARE_LIBID(LIBID_This2ThatLib)
    DECLARE_REGISTRY_APPID_RESOURCEID(IDR_THIS2THAT, "{3E670573-EA3F-498A-8EB1-F72DA6B5D221}")
    };

    And CT2TContextMenu like this (I added the IShellExtInit/IContextMenu stuff):

    class ATL_NO_VTABLE CT2TContextMenu :
    public CComObjectRootEx<CComSingleThreadModel>,
    public CComCoClass<CT2TContextMenu, &CLSID_T2TContextMenu>,
    public IDispatchImpl<IT2TContextMenu, &IID_IT2TContextMenu, &LIBID_This2ThatLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
    public IShellExtInit,
    public IContextMenu
    {
    public:
    CT2TContextMenu(){}

    DECLARE_REGISTRY_RESOURCEID(IDR_T2TCONTEXTMENU)

    DECLARE_PROTECT_FINAL_CONSTRUCT()

    BEGIN_COM_MAP(CT2TContextMenu)
    COM_INTERFACE_ENTRY(IT2TContextMenu)
    COM_INTERFACE_ENTRY(IDispatch)
    COM_INTERFACE_ENTRY(IShellExtInit)
    COM_INTERFACE_ENTRY(IContextMenu)
    END_COM_MAP()

    HRESULT FinalConstruct(){ return S\_OK; }
    void FinalRelease() {}
    

    public:
    // IShellExtInit
    STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);

    // IContextMenu
    STDMETHOD(GetCommandString)(UINT, UINT, UINT\*, LPSTR, UINT);
    STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
    STDMETHOD
    
    ATL / WTL / STL tutorial csharp c++ visual-studio com

  • ATL7 and VS.NET2k3 wizard, completely stuck
    S seriema

    Hehe I was just about to delete my post, I noticed that too. I checked out your article code and saw that there WAS two classes. I've compiled now and it worked. So I tried to do the same thing with Attributes, and it compiles too. Now the real job begins hehe... Thank you for replying. And thank you for all the very helpful articles here at CodeProject! :-D

    ATL / WTL / STL c++ com csharp visual-studio windows-admin

  • ATL7 and VS.NET2k3 wizard, completely stuck
    S seriema

    Hi! I'm making a shell extension, adding stuff to the context menu in Windows Explorer. I can find plenty of tutorials, but everyone uses ATL3 or VC++. I've already made a shell extension using the old stuff, now I want to try using the latest. The stuff that's generated from the VS.NET 2003 ATL wizard is completely different from what I've seen. After being adviced not to use attributes (couldn't get it to work anyway) I've been trying to get the COM_MAP stuff to work, but I've not been succesfull. It generated over 10 files, but here's the main file (I think) and what I've got so far:

    /* This was all generated by VS.NET ATL wizard, I've marked the few lines I've added */
    // This2That.cpp : Implementation of DLL Exports.

    #include "stdafx.h"
    #include "resource.h"
    #include "This2That.h"
    #include <ShlObj.h> // added---------------------

    class CThis2ThatModule :
    public CAtlDllModuleT< CThis2ThatModule >,
    public IShellExtInit // added---------------------
    {
    public :
    DECLARE_LIBID(LIBID_This2ThatLib)
    DECLARE_REGISTRY_APPID_RESOURCEID(IDR_THIS2THAT, "{58F42B54-8108-44DF-8CBC-BE62D021D4D8}")

    BEGIN\_COM\_MAP(CThis2ThatModule) // added---------------------
    	COM\_INTERFACE\_ENTRY(IShellExtInit) // added---------------------
    	COM\_INTERFACE\_ENTRY\_IID(IID\_IShellExtInit, CThis2ThatModule) // added---------------------
    END\_COM\_MAP( ) // added---------------------
    
    
    // IShellExtInit
    STDMETHOD(Initialize)( LPCITEMIDLIST, IDataObject\*, HKEY ); // added---------------------
    

    };

    STDMETHODIMP CThis2ThatModule::Initialize( LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID ) { return E_NOTIMPL; } // added---------------------

    CThis2ThatModule _AtlModule;

    // DLL Entry Point
    extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
    {
    hInstance;
    return _AtlModule.DllMain(dwReason, lpReserved);
    }

    // Used to determine whether the DLL can be unloaded by OLE
    STDAPI DllCanUnloadNow(void)
    {
    return _AtlModule.DllCanUnloadNow();
    }

    // Returns a class factory to create an object of the requested type
    STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
    {
    return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
    }

    // DllRegisterServer - Adds entries to the system registry
    STDAPI DllRegisterServer(void)
    {
    // registers object, typelib and all interfaces in typelib
    HRESULT hr = _AtlModule.DllRegisterServer();
    return hr;
    }

    // DllUnregisterServer - Removes en

    ATL / WTL / STL c++ com csharp visual-studio windows-admin

  • what interface to extend the grey Info box in WinXP Explorer?
    S seriema

    Here's a pick to demonstrate what I mean, clicky[^] I have the actual thumbnail working for PCX and TGA files. But I want to supply "Measure" (Mått), "Size" (Storlek), "Last changed" (Senast ändrad). Crash course in swedish :P So that's why I'm guessing that there's some standard names that works with localization. Last changed and Size seem to be supplied as default, but in reversed order compared to say GIF files. Does anyone know how to extend that info box?

    COM csharp linux question

  • what interface to extend the grey Info box in WinXP Explorer?
    S seriema

    Hi! I'm working on a shell extension called ThumbView. I want to add image information in the Information box in the left, on web view, in windows xp explorer. I thought it was called a ToolTip so I overloaded IQueryInfo, but that's the yellow tooltip that shows when you hover your mouse over a file. So now I have 2 questions: 1) What's the interface for that Information box? Or at least a name, sine ToolTip is something else =/ 2) Is there a list of different info's, that works with localization (ie it translates "size" to whatever language your winxp is)? Thx! /JP

    COM csharp linux question

  • very odd IExtractImage::Extract() behaviour
    S seriema

    Hi! I've implemented a thumbnail extension for windows xp explorer by implementing the IExtractImage interface. The super weird part is about windows passing the desired BPP on GetLocation(). In Explorer: When the left bar, with the Information box, is active: windows requires 32bpp. And shows my image stretched (as wide as possible, and then super heigh). When in normal thumbnail mode, windows requires 24bpp: but it won't show the thumbnail unless it's 1bpp or 32bpp! If I force feed it 32bpp the thumbnail is shown nicely (not stretched as in the Information box). Does anyone have any idea as of why? :confused: Thanx /JP

    ATL / WTL / STL question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups