1*520fa265SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*520fa265SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*520fa265SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*520fa265SAndrew Rist * distributed with this work for additional information
6*520fa265SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*520fa265SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*520fa265SAndrew Rist * "License"); you may not use this file except in compliance
9*520fa265SAndrew Rist * with the License. You may obtain a copy of the License at
10*520fa265SAndrew Rist *
11*520fa265SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*520fa265SAndrew Rist *
13*520fa265SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*520fa265SAndrew Rist * software distributed under the License is distributed on an
15*520fa265SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*520fa265SAndrew Rist * KIND, either express or implied. See the License for the
17*520fa265SAndrew Rist * specific language governing permissions and limitations
18*520fa265SAndrew Rist * under the License.
19*520fa265SAndrew Rist *
20*520fa265SAndrew Rist *************************************************************/
21*520fa265SAndrew Rist
22*520fa265SAndrew Rist
23cdf0e10cSrcweir // Simple.cpp : Implementation of CSimple
24cdf0e10cSrcweir #include "stdafx.h"
25cdf0e10cSrcweir #include "XCallback_Impl.h"
26cdf0e10cSrcweir #include "Simple.h"
27cdf0e10cSrcweir
28cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////
29cdf0e10cSrcweir // CSimple
30cdf0e10cSrcweir
31cdf0e10cSrcweir
func(BSTR message)32cdf0e10cSrcweir STDMETHODIMP CSimple::func(BSTR message)
33cdf0e10cSrcweir {
34cdf0e10cSrcweir USES_CONVERSION;
35cdf0e10cSrcweir MessageBox( NULL, W2T( message), _T("XCallback_Impl.Simple"), MB_OK);
36cdf0e10cSrcweir return S_OK;
37cdf0e10cSrcweir }
38cdf0e10cSrcweir
39cdf0e10cSrcweir
func2(BSTR message)40cdf0e10cSrcweir STDMETHODIMP CSimple::func2(BSTR message)
41cdf0e10cSrcweir {
42cdf0e10cSrcweir USES_CONVERSION;
43cdf0e10cSrcweir MessageBox( NULL, W2T( message), _T("XCallback_Impl.Simple"), MB_OK);
44cdf0e10cSrcweir return S_OK;
45cdf0e10cSrcweir }
46cdf0e10cSrcweir
func3(BSTR message)47cdf0e10cSrcweir STDMETHODIMP CSimple::func3(BSTR message)
48cdf0e10cSrcweir {
49cdf0e10cSrcweir USES_CONVERSION;
50cdf0e10cSrcweir MessageBox( NULL, W2T( message), _T("XCallback_Impl.Simple"), MB_OK);
51cdf0e10cSrcweir return S_OK;
52cdf0e10cSrcweir }
53cdf0e10cSrcweir
54cdf0e10cSrcweir
get__implementedInterfaces(LPSAFEARRAY * pVal)55cdf0e10cSrcweir STDMETHODIMP CSimple::get__implementedInterfaces(LPSAFEARRAY *pVal)
56cdf0e10cSrcweir {
57cdf0e10cSrcweir HRESULT hr= S_OK;
58cdf0e10cSrcweir SAFEARRAY *pArr= SafeArrayCreateVector( VT_BSTR, 0, 3);
59cdf0e10cSrcweir if( pArr)
60cdf0e10cSrcweir { long index=0;
61cdf0e10cSrcweir BSTR name1= SysAllocString(L"oletest.XSimple");
62cdf0e10cSrcweir BSTR name2= SysAllocString(L"oletest.XSimple2");
63cdf0e10cSrcweir BSTR name3= SysAllocString(L"oletest.XSimple3");
64cdf0e10cSrcweir
65cdf0e10cSrcweir hr= SafeArrayPutElement( pArr, & index, name1);
66cdf0e10cSrcweir index++;
67cdf0e10cSrcweir hr= SafeArrayPutElement( pArr, &index, name2);
68cdf0e10cSrcweir index++;
69cdf0e10cSrcweir hr= SafeArrayPutElement( pArr, &index, name3);
70cdf0e10cSrcweir *pVal= pArr;
71cdf0e10cSrcweir
72cdf0e10cSrcweir }
73cdf0e10cSrcweir *pVal= pArr;
74cdf0e10cSrcweir return S_OK;
75cdf0e10cSrcweir }
76cdf0e10cSrcweir
77