Skip to content

Commit

Permalink
Add new COM method VPMBuildVersion returning double vpinball#249
Browse files Browse the repository at this point in the history
  • Loading branch information
JockeJarre committed Jul 19, 2024
1 parent 8689b73 commit 266a8bd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions installguide/Interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,26 @@
</TABLE>


<TABLE WIDTH="100%" BORDER = 1>
<TR><TD WIDTH="50%"><B>VPMBuildVersion</B></TH>
<TD WIDTH="50%" ALIGN="right">Read Only</TH></TD>
<TR><TD VALIGN=top COLSPAN=2>
<p>Returns the version number of Visual PinMAME as an floatnumber
"vvmmbbrr.ggggg":<BR><BR>
vv = Major version<BR>
mm = Minor version<BR>
bb = Beta version<BR>
rr = Revision<BR>
ggggg = Build number<BR><BR>
Example:<BR>
A result of "990201.04711" signifies "Version 0.99 Beta 2 Rev A build number 4711<BR><BR>
If (Controller.VPMBuildVersion&lt;990201.04711) Then MsgBox "You need a newer
version of VPinMAME." : Exit Sub
</TD>
</TR>
</TABLE>


<TABLE WIDTH="100%" BORDER = 1>
<TR><TD WIDTH="100%" BGCOLOR="#f0f0ff" ALIGN="middle"><B>Methods</B></TH></TD>
<TR><TD><B>Run(parentWindow, minVersion)</B></TH>
Expand Down
18 changes: 18 additions & 0 deletions src/win32com/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,24 @@ STDMETHODIMP CController::get_Version(BSTR *pVal)
return S_OK;
}

/****************************************************************************
* IController.Version (read-only): gets the program build version of VPM
****************************************************************************/
STDMETHODIMP CController::get_VPMBuildVersion(double *pVal)
{
if (!pVal)
return S_FALSE;

int nVersionNo0, nVersionNo1, nVersionNo2, nVersionNo3;
GetProductVersion(&nVersionNo0, &nVersionNo1, &nVersionNo2, &nVersionNo3);

double nVersionNo = nVersionNo0 *1000 + nVersionNo1 * 100 + nVersionNo2 + nVersionNo3 / 10000.0;

*pVal = nVersionNo;

return S_OK;
}

/****************************************************************************
* IController.Games (read-only): hands out a pointer to a games-objects
****************************************************************************/
Expand Down
1 change: 1 addition & 0 deletions src/win32com/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ DECLARE_PROTECT_FINAL_CONSTRUCT()
STDMETHOD(get_Settings)(/*[out, retval]*/ IControllerSettings * *pVal);
STDMETHOD(get_Games)(/*[out, retval]*/ IGames* *pVal);
STDMETHOD(get_Version)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(get_VPMBuildVersion)(/*[out, retval]*/ double *pVal);
STDMETHOD(get_SolMask)(/*[in]*/ int nLow, /*[out, retval]*/ long *pVal);
STDMETHOD(put_SolMask)(/*[in]*/ int nLow, /*[in]*/ long newVal);
STDMETHOD(put_Mech)(/*[in]*/ int param, /*[in]*/int newVal);
Expand Down
1 change: 1 addition & 0 deletions src/win32com/VPinMAME.idl
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ import "ocidl.idl";
[propput, id(45), helpstring("property SolMask")] HRESULT SolMask([in] int nLow, [in] long newVal);
/* ! */ [id(46), helpstring("method ShowPathesDialog")] HRESULT ShowPathesDialog([in,defaultvalue(0)] LONG_PTR hParentWnd);
[propget, id(48), helpstring("property Version")] HRESULT Version([out, retval] BSTR *pVal);
[propget, id(48), helpstring("property VPMBuildVersion")] HRESULT VPMBuildVersion([out, retval] double *pVal);
[propput, id(49), helpstring("property Mech")] HRESULT Mech([in] int param, [in] int newVal);
/* ! */ [propget, id(50), helpstring("property NewSoundCommands")] HRESULT NewSoundCommands([out, retval] VARIANT *pVal);
[propget, id(51), helpstring("property Games")] HRESULT Games([out, retval] IGames* *pVal);
Expand Down

0 comments on commit 266a8bd

Please sign in to comment.