mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2003
Posts: 161
A
Vogon poet
OP Offline
Vogon poet
A
Joined: May 2003
Posts: 161
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.

Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
confirmed


NaquadaBomb
www.mirc-dll.com
Joined: Apr 2004
Posts: 218
P
Fjord artisan
Offline
Fjord artisan
P
Joined: Apr 2004
Posts: 218
Isn't 6.2 the same as 6.20, and 6.200?


Live to Dream & Dream for Life
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
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.

Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
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


NaquadaBomb
www.mirc-dll.com
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
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)


NaquadaBomb
www.mirc-dll.com
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Jul 2006
Posts: 53
O
Babel fish
Offline
Babel fish
O
Joined: Jul 2006
Posts: 53
shocked


Link Copied to Clipboard