Click here to Skip to main content
15,893,381 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: list::sort() question Pin
peterchen23-Nov-04 13:49
peterchen23-Nov-04 13:49 
GeneralRe: list::sort() question Pin
nm_11423-Nov-04 14:08
nm_11423-Nov-04 14:08 
GeneralRe: list::sort() question Pin
toxcct23-Nov-04 8:12
toxcct23-Nov-04 8:12 
GeneralRe: list::sort() question Pin
peterchen23-Nov-04 13:58
peterchen23-Nov-04 13:58 
GeneralRe: list::sort() question Pin
toxcct23-Nov-04 21:37
toxcct23-Nov-04 21:37 
GeneralRe: list::sort() question Pin
peterchen23-Nov-04 22:28
peterchen23-Nov-04 22:28 
GeneralRe: list::sort() question Pin
Nemanja Trifunovic24-Nov-04 2:21
Nemanja Trifunovic24-Nov-04 2:21 
GeneralATL7 and VS.NET2k3 wizard, completely stuck Pin
seriema19-Nov-04 10:59
seriema19-Nov-04 10:59 
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 entries from the system registry
STDAPI DllUnregisterServer(void)
{
	HRESULT hr = _AtlModule.DllUnregisterServer();
	return hr;
}


That gives me two errors:
error C3861: 'InternalQueryInterface': identifier not found, even with argument-dependent lookup
error C2259: 'CThis2ThatModule' : cannot instantiate abstract class

I've tried adding stuff from my old ATL3 project, but no luck so far... My guess is that the MAP isn't working, i.e. I'm doing something wrong...
Adding DECLARE_PROTECT_FINAL_CONSTRUCT() gave me even more errors.


I would really appreciate any help I can get! Thank you...

[ ThumbView: Adds thumbnail support for DDS, PCX, TGA and 16 other imagetypes for Windows XP Explorer. | Homepage | Thread ]
GeneralRe: ATL7 and VS.NET2k3 wizard, completely stuck Pin
Michael Dunn19-Nov-04 13:25
sitebuilderMichael Dunn19-Nov-04 13:25 
GeneralRe: ATL7 and VS.NET2k3 wizard, completely stuck Pin
seriema19-Nov-04 13:33
seriema19-Nov-04 13:33 
GeneralPrevent IHTMLDocument2 from updating IE screen Pin
Wim Jans19-Nov-04 9:33
Wim Jans19-Nov-04 9:33 
Questionhow to use char* in ATL Pin
yingkou18-Nov-04 23:26
yingkou18-Nov-04 23:26 
AnswerRe: how to use char* in ATL Pin
geo_m18-Nov-04 23:39
geo_m18-Nov-04 23:39 
GeneralRe: how to use char* in ATL Pin
yingkou19-Nov-04 1:56
yingkou19-Nov-04 1:56 
GeneralRe: how to use char* in ATL Pin
geo_m19-Nov-04 2:52
geo_m19-Nov-04 2:52 
GeneralMemory leaks with BSTR Pin
prasad_som18-Nov-04 22:03
prasad_som18-Nov-04 22:03 
GeneralRe: Memory leaks with BSTR Pin
22491718-Nov-04 22:57
22491718-Nov-04 22:57 
GeneralRe: Memory leaks with BSTR Pin
prasad_som18-Nov-04 23:35
prasad_som18-Nov-04 23:35 
GeneralRe: Memory leaks with BSTR Pin
Steve S19-Nov-04 0:20
Steve S19-Nov-04 0:20 
QuestionHow can I create a colour btimap ? Pin
Darked developer18-Nov-04 19:59
Darked developer18-Nov-04 19:59 
AnswerRe: How can I create a colour btimap ? Pin
Rory Solley18-Nov-04 23:34
Rory Solley18-Nov-04 23:34 
GeneralRe: How can I create a colour btimap ? Pin
Darked developer19-Nov-04 2:41
Darked developer19-Nov-04 2:41 
GeneralCall to one Method of a COM component returns 0x80020008. But works on other machine Pin
User 21559718-Nov-04 18:39
User 21559718-Nov-04 18:39 
GeneralRe: Call to one Method of a COM component returns 0x80020008. But works on other machine Pin
geo_m19-Nov-04 2:58
geo_m19-Nov-04 2:58 
GeneralRe: Call to one Method of a COM component returns 0x80020008. But works on other machine Pin
User 21559719-Nov-04 3:28
User 21559719-Nov-04 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.