mIRC Homepage
Posted By: Ashkrynt mIRC 6.2 reports version as 6.02 to DLLs - 02/08/06 03:05 PM
In mIRC 6.2, the mVersion member of the LOADINFO struct passed to LoadDll has just 2 as the minor version number, rather than the 20 that would be expected.
confirmed
Isn't 6.2 the same as 6.20, and 6.200?
What's the issue? mIRC uses real numbers for versions, not a <major>.<minor>.<revision> notation. Meaning the part after the decimal point is a fraction, not a distinct number. It's not reporting the version as '02', it's reporting it as '2', which is correct.
I think the point of the OP may be that you can't code any version check directly from that minor version style. A logical bit of code might be something like this pseudocode:

if ((majorversion == 6) && (minorversion >= 17)) { do something }

Obviously that code is trying to ensure that the user's version of mIRC is 6.17 or later, however the problem you'd run into with that code is that the version after 6.17 is 6.2, and as you can see, 2 is less than 17 so version 6.2 wouldn't be detected as newer than 6.17.

I think the minor version should return a number that is right padded with zeros (doesn't change the decimal value of the number) or it should return the actual decimal value, ie 0.17, 0.2 etc, as that would work correctly in > and < comparisons.

-genius_at_work
Posted By: Khaled Re: mIRC 6.2 reports version as 6.02 to DLLs - 04/08/06 11:48 AM
Thanks fixed for the next version, I'll change it so that it is right-padded with zeros, ie. it will return 6 20 for the major/minor values.
Thanks Khaled...

For those of you that still don't understand the problem, look at it this way... You have a single number for version (passed to the mLoad function). The left most BITS (shifted)of that number is the major version and the right most BITS of that same number form the minor version, it is not a floating point number. It a way to save two 16-bit numbers within one 32-bit number. See the macro definations HIWORD and LOWORD on msdn for additional details. wink
I don't think anyone thought mIRC passed the version to the DLL as a floating point number. My point was that the version numbers mIRC uses are floating points, ie. 6.2 is greater than 6.12 (which is not the case in the most common notation used in programming). Of course there's nothing wrong in passing it as '20' instead of '2' since they're effectively the same thing, and I guess if it makes things easier for checking versions than I suppose it makes sense to provide it that way.
You must work for Microsoft, Starbucks. grin

Math is math, don't think because you work for a billion dollar company, that you can change math. wink

Sure you could use any screw-ball way to keep track of version. Personallly, I like how Khaled (and myself) handle versions. Sounds better than what you are suggesting. smile
Let review...

* (02 == 2) and (.20 == .2)
* (0.2 > 0.17) and (2 < 17)
* (.02 != .2) and (2 != 20)
I'm not suggesting anything. I'm explaining the way it currently is and how it has been for every version to date. I'm quite aware of how numbers work thanks.

Anyway, Khaled's already said it'll be changed to make it easier to check as the OP wanted, so that's all that matters I guess.
shocked
© mIRC Discussion Forums