ReactOS 0.4.15-dev-8100-g1887773
AtlObjMap.cpp File Reference
#include "atltest.h"
#include <atlbase.h>
#include <atlcom.h>
Include dependency graph for AtlObjMap.cpp:

Go to the source code of this file.

Classes

class  CAtlObjMapModule
 
struct  CObjMapTestObject
 

Functions

 START_TEST (AtlObjMap)
 

Variables

CAtlObjMapModule _Module
 
CLSID CLSID_ObjMapTestObject = {0xeae5616c, 0x1e7f, 0x4a00, {0x92, 0x27, 0x1a, 0xad, 0xad, 0x66, 0xbb, 0x85}}
 
static LONG g_Created = 0
 
static LONG g_Destroyed = 0
 

Function Documentation

◆ START_TEST()

START_TEST ( AtlObjMap  )

Definition at line 28 of file AtlObjMap.cpp.

29{
31 ok_hex(hr, S_OK);
32
33 {
34 CComPtr<IUnknown> spTestObject;
35 hr = CoCreateInstance(CLSID_ObjMapTestObject, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID*)&spTestObject);
37 }
38
39 ok_int(g_Created, 0);
41
42 // Register the com objects added to the auto-map in _AtlComModule
43 hr = _Module.RegisterClassObjects(CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE);
44 ok_hex(hr, S_OK);
45
46 ok_int(g_Created, 0);
48
49 {
50 CComPtr<IUnknown> spTestObject;
51 hr = CoCreateInstance(CLSID_ObjMapTestObject, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID *)&spTestObject);
52 ok_hex(hr, S_OK);
53 ok_int(g_Created, 1);
55 }
56 ok_int(g_Created, 1);
58}
static LONG g_Created
Definition: AtlObjMap.cpp:24
CLSID CLSID_ObjMapTestObject
Definition: AtlObjMap.cpp:22
static LONG g_Destroyed
Definition: AtlObjMap.cpp:25
CAtlObjMapModule _Module
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok_int(expression, result)
Definition: atltest.h:134
const GUID IID_IUnknown
HRESULT RegisterClassObjects(DWORD dwClsContext, DWORD dwFlags)
Definition: atlbase.h:840
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
#define S_OK
Definition: intsafe.h:52
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:393
HRESULT hr
Definition: shlfolder.c:183
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696

Variable Documentation

◆ _Module

Referenced by START_TEST().

◆ CLSID_ObjMapTestObject

CLSID CLSID_ObjMapTestObject = {0xeae5616c, 0x1e7f, 0x4a00, {0x92, 0x27, 0x1a, 0xad, 0xad, 0x66, 0xbb, 0x85}}

Definition at line 22 of file AtlObjMap.cpp.

Referenced by START_TEST().

◆ g_Created

LONG g_Created = 0
static

Definition at line 24 of file AtlObjMap.cpp.

Referenced by CObjMapTestObject::CObjMapTestObject(), and START_TEST().

◆ g_Destroyed

LONG g_Destroyed = 0
static

Definition at line 25 of file AtlObjMap.cpp.

Referenced by START_TEST(), and CObjMapTestObject::~CObjMapTestObject().