Click here to Skip to main content
15,884,537 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Passing a string to a method that takes an IDispatch*? Pin
Rob Caldecott25-Feb-10 10:56
Rob Caldecott25-Feb-10 10:56 
GeneralRe: Passing a string to a method that takes an IDispatch*? Pin
Stuart Dootson25-Feb-10 11:36
professionalStuart Dootson25-Feb-10 11:36 
QuestionRun Only One Instance Of this AddOn In Multiple IE Win Pin
A_Fa24-Feb-10 3:06
A_Fa24-Feb-10 3:06 
AnswerRe: Run Only One Instance Of this AddOn In Multiple IE Win Pin
KingsGambit24-Feb-10 6:00
KingsGambit24-Feb-10 6:00 
QuestionCreating checkboxes dynamically from array Pin
Steven Foxton23-Feb-10 13:26
Steven Foxton23-Feb-10 13:26 
AnswerRe: Creating checkboxes dynamically from array Pin
«_Superman_»23-Feb-10 16:51
professional«_Superman_»23-Feb-10 16:51 
AnswerRe: Creating checkboxes dynamically from array Pin
Richard MacCutchan23-Feb-10 21:41
mveRichard MacCutchan23-Feb-10 21:41 
Questionvs 2008 and Icopy Pin
aurelcly23-Feb-10 7:41
aurelcly23-Feb-10 7:41 
Good afternoon I currently write a IcopyHook shell using visual studio 2008 and atl I have this compile error:
Error 1 error C2259: 'ATL::CComObject<Base>' : cannot instantiate abstract class c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlcom.h 1801

this is a piece of code I use to do so:
// MyHook.h : Declaration of the CMyHook

#ifndef __MYHOOK_H_
#define __MYHOOK_H_

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CMyHook
class ATL_NO_VTABLE CMyHook : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CMyHook, &CLSID_MyHook>,
	public ICopyHook,		// ICopyHook interface.
	public IDispatchImpl<IMyHook, &IID_IMyHook, &LIBID_COPYHOOKLib>
{
public:
	CMyHook() //_ATL_DEBUG_ADDREF_RELEASE_IMPL
	{
	}

/*	//Ansi Version.
    STDMETHOD_(UINT,CopyCallback) (HWND hwnd, UINT wFunc, UINT wFlags, LPCSTR pszSrcFile, DWORD dwSrcAttribs,
                                   LPCSTR pszDestFile, DWORD dwDestAttribs);
*/
	//Unicode Version.
    STDMETHOD_(UINT,CopyCallback) (HWND hwnd, UINT wFunc, UINT wFlags, LPCWSTR pszSrcFile, DWORD dwSrcAttribs,
                                   LPCWSTR pszDestFile, DWORD dwDestAttribs);

DECLARE_REGISTRY_RESOURCEID(IDR_MYHOOK)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CMyHook)
	COM_INTERFACE_ENTRY_IID(IID_IShellCopyHook , CMyHook)
	COM_INTERFACE_ENTRY(IMyHook)
	COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()

};

#endif //__MYHOOK_H_


// CopyHook.cpp : Implementation of DLL Exports.


// Note: Proxy/Stub Information
//      To build a separate proxy/stub DLL, 
//      run nmake -f CopyHookps.mk in the project directory.

#include "stdafx.h"
#include "resource.h"
#include <initguid.h>
#include "CopyHook.h"

#include "CopyHook_i.c"
#include "MyHook.h"


CComModule _Module;

BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_MyHook, CMyHook)
END_OBJECT_MAP()

/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point

extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
    if (dwReason == DLL_PROCESS_ATTACH)
    {
        _Module.Init(ObjectMap, hInstance, &LIBID_COPYHOOKLib);
        DisableThreadLibraryCalls(hInstance);
    }
    else if (dwReason == DLL_PROCESS_DETACH)
        _Module.Term();
    return TRUE;    // ok
}

/////////////////////////////////////////////////////////////////////////////
// Used to determine whether the DLL can be unloaded by OLE

STDAPI DllCanUnloadNow(void)
{
    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}

/////////////////////////////////////////////////////////////////////////////
// Returns a class factory to create an object of the requested type

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
    return _Module.GetClassObject(rclsid, riid, ppv);
}

/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)
{
    // registers object, typelib and all interfaces in typelib
    return _Module.RegisterServer(TRUE);
}

/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
{
    return _Module.UnregisterServer(TRUE);
}


Thank you
AnswerRe: vs 2008 and Icopy Pin
Stuart Dootson23-Feb-10 14:01
professionalStuart Dootson23-Feb-10 14:01 
QuestionATL Server Exe Shutdown Hangs Pin
marko201022-Feb-10 14:31
marko201022-Feb-10 14:31 
AnswerRe: ATL Server Exe Shutdown Hangs [modified] Pin
KingsGambit22-Feb-10 17:42
KingsGambit22-Feb-10 17:42 
QuestionDirect3D Types as interface parameters Pin
Aschratt20-Feb-10 22:47
Aschratt20-Feb-10 22:47 
AnswerRe: Direct3D Types as interface parameters Pin
Jonathan Davies21-Feb-10 2:03
Jonathan Davies21-Feb-10 2:03 
GeneralRe: Direct3D Types as interface parameters Pin
Aschratt21-Feb-10 2:07
Aschratt21-Feb-10 2:07 
GeneralRe: Direct3D Types as interface parameters Pin
Jonathan Davies21-Feb-10 2:24
Jonathan Davies21-Feb-10 2:24 
GeneralRe: Direct3D Types as interface parameters Pin
Aschratt21-Feb-10 2:32
Aschratt21-Feb-10 2:32 
GeneralRe: Direct3D Types as interface parameters Pin
Jonathan Davies21-Feb-10 3:26
Jonathan Davies21-Feb-10 3:26 
GeneralRe: Direct3D Types as interface parameters [modified] Pin
Aschratt21-Feb-10 4:42
Aschratt21-Feb-10 4:42 
GeneralRe: Direct3D Types as interface parameters Pin
Jonathan Davies21-Feb-10 6:23
Jonathan Davies21-Feb-10 6:23 
GeneralRe: Direct3D Types as interface parameters Pin
Aschratt21-Feb-10 6:24
Aschratt21-Feb-10 6:24 
QuestionHow to create EXE setup file using VS2005,VS2008 Pin
am 20096-Feb-10 6:14
am 20096-Feb-10 6:14 
AnswerRe: How to create EXE setup file using VS2005,VS2008 Pin
KingsGambit6-Feb-10 6:38
KingsGambit6-Feb-10 6:38 
AnswerRe: How to create EXE setup file using VS2005,VS2008 Pin
LunaticFringe6-Feb-10 7:58
LunaticFringe6-Feb-10 7:58 
Questionvector of strings, find all matches Pin
ekimpl3-Feb-10 23:54
ekimpl3-Feb-10 23:54 
AnswerRe: vector of strings, find all matches Pin
Nuri Ismail4-Feb-10 0:14
Nuri Ismail4-Feb-10 0:14 

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.