Skip to content

Commit

Permalink
Get PyCOMTest building with vs2017 and add a function for turning a d…
Browse files Browse the repository at this point in the history
…ouble into a date
  • Loading branch information
mhammond committed Mar 27, 2021
1 parent 2b353b3 commit 8814c57
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
8 changes: 8 additions & 0 deletions com/TestSources/PyCOMTest/PyCOMImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,14 @@ HRESULT CPyCOMTest::EarliestDate(DATE first, DATE second, DATE *pResult)
return S_OK;
}

HRESULT CPyCOMTest::MakeDate(double val, DATE *pResult)
{
if (!pResult)
return E_POINTER;
*pResult = (DATE)val;
return S_OK;
}

HRESULT CPyCOMTest::TestQueryInterface()
{
IUnknown *pObj = 0;
Expand Down
1 change: 1 addition & 0 deletions com/TestSources/PyCOMTest/PyCOMImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class CPyCOMTest : public IDispatchImpl<IPyCOMTest, &IID_IPyCOMTest, &LIBID_PyCO
STDMETHOD(DoubleInOutString)(BSTR *str);
STDMETHOD(TestMyInterface)(IUnknown *t);
STDMETHOD(EarliestDate)(DATE first, DATE second, DATE *pResult);
STDMETHOD(MakeDate)(double val, DATE *pResult);
STDMETHOD(TestQueryInterface)();
STDMETHOD(NotScriptable)(int *val);
STDMETHOD(get_LongProp)(long *ret);
Expand Down
8 changes: 6 additions & 2 deletions com/TestSources/PyCOMTest/PyCOMTest.idl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ library PyCOMTestLib
};
// Some test structures
typedef [uuid(7a4ce6a7-7959-4e85-a3c0-b41442ff0f67), version(1.0)]
struct tagTestStruct1 {
struct TestStruct1 {
int int_value;
BSTR str_value;
} TestStruct1;
Expand Down Expand Up @@ -261,12 +261,16 @@ library PyCOMTestLib

HRESULT TestMyInterface([in] IUnknown *tester);

// Test date objects. From a bug-report from a user.
// Test date objects.
HRESULT EarliestDate(
[in] DATE First,
[in, optional, defaultvalue(0)] DATE Second,
[out, retval] Date* pResult);

HRESULT MakeDate(
[in] double val,
[out, retval] DATE* pResult);

HRESULT TestQueryInterface();
HRESULT AddCurrencies(
[in] CY v1,
Expand Down
2 changes: 0 additions & 2 deletions com/TestSources/PyCOMTest/preconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
// preconn.obj will contain the pre-compiled type information

#include "preconn.h"

#include "atlimpl.cpp"

0 comments on commit 8814c57

Please sign in to comment.