Skip to content

Commit

Permalink
Add build number to the COM Version method of VPM vpinball#249
Browse files Browse the repository at this point in the history
  • Loading branch information
JockeJarre committed Mar 14, 2024
1 parent bfa2cca commit 9bd5939
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions installguide/Interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@
<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 8-digit string
"vvmmbbrr":<BR><BR>
"vvmmbbrr.bbbb":<BR><BR>
vv = Major version<BR>
mm = Minor version<BR>
bb = Beta version<BR>
rr = Revision<BR><BR>
rr = Revision<BR>
bbbb = Build number<BR><BR>
Example:<BR>
A result of "00990201" signifies "Version 0.99 Beta 2 Rev A<BR><BR>
If (Controller.Version&lt;"00990201") Then MsgBox "You need a newer
A result of "00990201.4711" signifies "Version 0.99 Beta 2 Rev A build #4711<BR><BR>
It is possible to amend the build number while checking the version, but not mandatory!<BR><BR>
If (Controller.Version&lt;"00990201.4711") Then MsgBox "You need a newer
version of VPinMAME." : Exit Sub
</TD>
</TR>
Expand Down
8 changes: 4 additions & 4 deletions src/win32com/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1742,10 +1742,10 @@ STDMETHODIMP CController::get_Version(BSTR *pVal)
int nVersionNo0, nVersionNo1, nVersionNo2, nVersionNo3;
GetProductVersion(&nVersionNo0, &nVersionNo1, &nVersionNo2, &nVersionNo3);

TCHAR szVersion[9];
wsprintf(szVersion, _T("%02i%02i%02i00"), nVersionNo0, nVersionNo1, nVersionNo2);
//Should output the version number as 03060000 without build number
//the build number does not have enough room^^
TCHAR szVersion[14];
wsprintf(szVersion, _T("%02i%02i%02i00.%04i"), nVersionNo0, nVersionNo1, nVersionNo2, nVersionNo3);
// Should output the version number as 03060000.0980
// The build number is returned after the decimal sign

CComBSTR bstrVersion(szVersion);

Expand Down

0 comments on commit 9bd5939

Please sign in to comment.