473,573 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

int64 method from COM into javascript

Hi

i have a property on a COM which returns int64:

var Milliseconds=Fo rm1.Player.Abso lutePosition;
however for somereason the typeof(Millisec onds) isn't number but unknown....

I can't make any use of this.

Does any one knows how can I transfer it to number?

10x
Guy.
Jul 23 '05 #1
11 2219
Guy Jacubovs wrote:
i have a property on a COM which returns int64:
Which COM _object_? Which user agent?
var Milliseconds=Fo rm1.Player.Abso lutePosition;
however for somereason the typeof(Millisec onds) isn't number but unknown....
There is no "unknown" type and, consequently, the typeof _operator_ (no
parantheses required) does not return an "unknown" string, only
"number", "string", "boolean", "object" and "function". Please specify.
I can't make any use of this.
With that little information I can't either and I doubt anyone else can.
Does any one knows how can I transfer it to number?


Provided that the property is a 64 bit integer value it should be
converted into a IEEE-754 double-precision floating-point number
as this is the only number format J(ava)Script supports.
PointedEars
Jul 23 '05 #2
Guy Jacubovs wrote:
i have a property on a COM which returns int64:
Which COM _object_? Which user agent?
var Milliseconds=Fo rm1.Player.Abso lutePosition;
however for somereason the typeof(Millisec onds) isn't number but
unknown....
There is no "unknown" type and, consequently, the typeof _operator_
(no parantheses required) does not return an "unknown" string, only
"number", "string", "boolean", "object", "function" and "undefined" .
Please specify.
I can't make any use of this.
With that little information I can't either and I doubt anyone else can.
Does any one knows how can I transfer it to number?


Provided that the property is a 64 bit integer value it should be
converted into a IEEE-754 double-precision floating-point number
as this is the only number format J(ava)Script supports.
PointedEars
Jul 23 '05 #3
Thomas 'PointedEars' Lahn wrote:
Guy Jacubovs wrote:
i have a property on a COM which returns int64:


Which COM _object_? Which user agent?
var Milliseconds=Fo rm1.Player.Abso lutePosition;
however for somereason the typeof(Millisec onds) isn't number but
unknown....


There is no "unknown" type and, consequently, the typeof _operator_
(no parantheses required) does not return an "unknown" string, only
"number", "string", "boolean", "object", "function" and "undefined" .


<quote cite="ECMA 262 3rd edition">
11.4.3 The typeof Operator
The production UnaryExpression : typeof UnaryExpression is
evaluated as follows:

1. Evaluate UnaryExpression .
2. If Type(Result(1)) is not Reference, go to step 4.
3. If GetBase(Result( 1)) is null, return "undefined" .
4. Call GetValue(Result (1)).
5. Return a string determined by Type(Result(4)) according to
the following table:

Type | Result
-------------------------------------------------
Undefined | "undefined"
-------------------------------------------------
Null | "object"
-------------------------------------------------
Boolean | "boolean"
-------------------------------------------------
Number | "number"
-------------------------------------------------
String | "string"
-------------------------------------------------
Object (native and |
doesn't implement |
[[Call]]) | "object"
-------------------------------------------------
Object (native and |
implements [[Call]]) | "function"
-------------------------------------------------
Object (host) | Implementation-dependent
</quote>

That final "Implementa tion-dependent" means that an alien primitive
wrapped in a host object has every right to return "unknown" if it feels
like it (and on IE some of them do).

Richard.
Jul 23 '05 #4
Hello All

you are all missing the point,

i don't care what typeof returns.... ;)
Here is the definition of AbsolutePositio n in the idl:

[propget, id(12), helpstring("pro perty AbsolutePositio n")] HRESULT
AbsolutePositio n([out, retval] __int64 * pVal);

All I want to is use this value in jscript.
Every time I want to access this value as a number (of example
division) jscript gives me an error

10x for the replies

Guy.
Jul 23 '05 #5
Guy Jacubovs wrote:
Hi

i have a property on a COM which returns int64:

var Milliseconds=Fo rm1.Player.Abso lutePosition;

however for somereason the typeof(Millisec onds) isn't number but unknown....

I can't make any use of this.

Does any one knows how can I transfer it to number?

10x
Guy.


typeof Milliseconds can't be "transferre d" to a number, since there doesn't
appear to be any "AbsolutePositi on" property for the "Player" object on "Form1".

You can _try_ something like:

var obj = Form1.Player;
for (var prop in obj) {
document.write(
prop + ' = ' + obj[prop] +
' (' + typeof obj[prop] + ')' +
'<br>'
);
}

to see if it lists an "absolutePositi on" or "AbsolutePositi on" property.

--
| Grant Wagner <gw*****@agrico reunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #6
Guy Jacubovs wrote:
you are all missing the point,
I think in fact *you* do. Since ECMAScript and implementations use
IEEE-754 doubles only, there is no exact representation of a 64 bit
integer value in these languages. Proof: The largest value a signed
64 bit integer can hold is (2^63)-1 (1 MSB + 63 bits) which is
922337203685477 5807. However, JavaScript (v1.5 in Mozilla Firefox)
returns 922337203685477 6000 for Math.pow(2, 63)-1 because of the 64
bits available for the floating-point number some bits are required
for the exponent (the stored value is 9.2233720368547 760E18):

<http://www.minet.uni-jena.de/~sack/SS04/download/IEEE-754.html>
i don't care what typeof returns.... ;)
If you would have bothered to read about J(ava)Script numbers as I
recommended previously, you would have recognized that "typeof" is
not really your problem.
Here is the definition of AbsolutePositio n in the idl:

[propget, id(12), helpstring("pro perty AbsolutePositio n")] HRESULT
AbsolutePositio n([out, retval] __int64 * pVal);

All I want to is use this value in jscript.
You can use only a rounded representation of it.
Every time I want to access this value as a number (of example
division) jscript gives me an error


We are not truthsayers. Show the source and the other information
requested previously.
PointedEars
Jul 23 '05 #7
ja******@yahoo. com (Guy Jacubovs) writes:
i have a property on a COM which returns int64:

var Milliseconds=Fo rm1.Player.Abso lutePosition; however for somereason the typeof(Millisec onds) isn't number but unknown....
I assume you are speaking about a COM object used in Internet
Explorer. Your best chance of getting advice about
IE/JScript-specific programming like this (or just to finde people who
knows what you are talking about) is the newsgroup
<URL: news:microsoft. public.scriptin g.jscript >
Does any one knows how can I transfer it to number?


My, completely unfounded, guess would be to do either
Milliseconds.to Double()
or
Number(Millisec onds)

Good luck
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #8
JRS: In article <40************ **@PointedEars. de>, seen in
news:comp.lang. javascript, Thomas 'PointedEars' Lahn
<Po*********@nu rfuerspam.de> posted at Fri, 18 Jun 2004 19:27:23 :

We are not truthsayers.


You are entitled to describe yourself thusly; but not to so describe the
rest of us, forsooth.

Those who are not British are warned not to emulate Pointy-Head's misuse
of the English language. Others should not need the warning.

--
© John Stockton, Surrey, UK. ??*@merlyn.demo n.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demo n.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Jul 23 '05 #9
Oh my, I just have set up another OS and did not copy my killfile.
And now this again.

Dr John Stockton wrote:
JRS: In article <40************ **@PointedEars. de>, seen in
news:comp.lang. javascript, Thomas 'PointedEars' Lahn
<Po*********@nu rfuerspam.de> posted at Fri, 18 Jun 2004 19:27:23 :
We are not truthsayers.
You are entitled to describe yourself thusly; but not to so describe
the rest of us, forsooth.

^^^^^^^^^^^^^^
And you are entitled to speak for everyone else (but me)?
I am afraid that your arrogance grows (is?) beyond imagination.
Those who are not British
There are other countries on this planet that have the English language
as official and/or native language. The above statement of yours is
only another proof of your arrogant attitude.
are warned not to emulate Pointy-Head's ^^^^^^^^^^^^^ misuse of the English language. Others should not need the warning.


I read the term "truthsayer " in some of the "Dune" novels by Frank
Herbert, a great American science-fiction writer and, as I have recently
found out, I was simply mislead by my linguistic intuition. Of course
I meant a different thing; a person with prescience -- a *soothsayer*.
It sometimes happens that a translation that is inspired by intuition
is not the correct one (in German, "soothsayer " is "Wahrsager" --
"truth-sayer"). But it happens more often to me that my linguistic
intuition leads to an appropriate translation. So far for *my* use of
the English language.

And what about *yours*? There are far better ways than this to tell
people that they have made a mistake (and people /make/ mistakes, that
is how they learn to better themselves). Especially for off-topic
notes, there is private e-mail. Do you really think your *continuing
completely off-topic personal attacks* here will do (you, this
newsgroup, me) anything good? I wonder how and why an university
graduate like you continues to display such a behavior in public.
If I were in your place, I would be very much ashamed of it.
PointedEars, Score adjusted (again)
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2157
by: Simon Devlin | last post by:
Hi folks, I've been bashing my head against this all afternoon and am now totally baffled. Given this (a simple routine to turn a ip address string into an decimal) <snip> Dim Parts(3) as string ' --> each element is an integer in the range 0-255 Dim Big as int64 = 0
5
5322
by: harishashim | last post by:
I have gone through necessary step and have been able to use a .Net libraries (created using C#) in VB6. It run good untill I try to use certain function in the library that is using Int64 type as parameter. VB6 give the following error Compile Error: Function or interface marked as restricted, or the function use an automation type not...
10
2887
by: Lau Lei Cheong | last post by:
Hello, I really need to use volatile System.Int64 for a .NET v1.1 program in C#. But the compiler complains "a volatile field can not be of type long". How to work around it? Or is there any other way to get similar effect for Int64 type? Another question less urging question is, why long variables can't be used as volatile? I understand...
14
9626
by: cj | last post by:
VB2003. I need a large positive integer. Which is larger int64 or double? I see int64 also apparently is known as long and will hold -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807. But I'm not good with the E+??? notation so when I'm told double holds -1.79769313486231570E+308 through -4.94065645841246544E-324 for negative...
12
3020
by: Allen | last post by:
My C extension works wrong, and debug it, found that sizeof (INT64) = 4, not 8. I compile on Windows XP platform. Please tell me how to fix it to support INT64? Thanks.
3
10739
by: Tim Sprout | last post by:
To convert hex to Int64 I can use: string hex = "413208A97245F5AE"; Int64 intFromHex = System.Convert.ToInt64(hex, 16); //intFromHex = 4697826885160531374 How do I reverse this, and convert Int64 to hex? Thanks,
0
7747
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7987
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7740
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6363
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5557
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3706
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.