Commit a1222a35 authored by Aaro Altonen's avatar Aaro Altonen Committed by Alexandre Julliard

msado15: Implement IConnectionPointContainer_FindConnectionPoint.

parent a8b647d8
......@@ -23,6 +23,7 @@
#include "initguid.h"
#include "ocidl.h"
#include "objbase.h"
#include "olectl.h"
#include "msado15_backcompat.h"
#include "wine/debug.h"
......@@ -455,8 +456,20 @@ static HRESULT WINAPI connpointcontainer_FindConnectionPoint( IConnectionPointCo
REFIID riid, IConnectionPoint **point )
{
struct connection *connection = impl_from_IConnectionPointContainer( iface );
FIXME( "%p, %s, %p\n", connection, debugstr_guid( riid ), point );
return E_NOTIMPL;
TRACE( "%p, %s %p\n", connection, debugstr_guid( riid ), point );
if (!point) return E_POINTER;
if (IsEqualIID( riid, connection->cp_connev.riid ))
{
*point = &connection->cp_connev.IConnectionPoint_iface;
IConnectionPoint_AddRef( *point );
return S_OK;
}
FIXME( "unsupported connection point %s\n", debugstr_guid( riid ) );
return CONNECT_E_NOCONNECTION;
}
static const struct IConnectionPointContainerVtbl connpointcontainer_vtbl =
......
......@@ -20,6 +20,7 @@
#define COBJMACROS
#include <initguid.h>
#include <oledb.h>
#include <olectl.h>
#include <msado15_backcompat.h>
#include "wine/test.h"
......@@ -805,10 +806,36 @@ static void test_Command(void)
_Command_Release( command );
}
static void test_ConnectionPoint(void)
{
HRESULT hr;
ULONG refs;
IConnectionPoint *point;
IConnectionPointContainer *pointcontainer;
hr = CoCreateInstance( &CLSID_Connection, NULL, CLSCTX_INPROC_SERVER,
&IID_IConnectionPointContainer, (void**)&pointcontainer );
hr = IConnectionPointContainer_FindConnectionPoint( pointcontainer, &DIID_ConnectionEvents, NULL );
ok( hr == E_POINTER, "got %08x\n", hr );
hr = IConnectionPointContainer_FindConnectionPoint( pointcontainer, &DIID_RecordsetEvents, &point );
ok( hr == CONNECT_E_NOCONNECTION, "got %08x\n", hr );
hr = IConnectionPointContainer_FindConnectionPoint( pointcontainer, &DIID_ConnectionEvents, &point );
ok( hr == S_OK, "got %08x\n", hr );
refs = IConnectionPoint_Release( point );
ok( refs == 1, "got %u", refs );
IConnectionPointContainer_Release( pointcontainer );
}
START_TEST(msado15)
{
CoInitialize( NULL );
test_Connection();
test_ConnectionPoint();
test_Fields();
test_Recordset();
test_Stream();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment