473,385 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Accessing Functions in a JScript.NET assem

Hi Gang,

My question is directed more towards the MS JSctip.NET
dev team. I understand that you guys are planning to
implement events in the newer versions of JS.NET, but is
there a way to work around this problem now? I thought I
could access a function in a HTA application by passing it
into a JS.NET assembly. I learned of that it in exposed in
the asm as an Object(AKA: System.__ComObject). But I am
unable to cast it to a local Function variable. I tried
using the TypeDescriptor and converting it that way, but I
keep getting compile error, (type mispatches), and other
runtime errors. The closest i get is when I cast this way:

public function recieveFunction(f : Object) : void {
var theFunction : Function = (Function)f.valueOf();
theFunction(); // runtime error
}

Am I not using the type converter classes properly?:

public function recieveFunction(f : Object) : void {
var theFunction : Function;
if (!TypeDescriptor.GetConverter(typeof
(Function)).IsValid(f))
throw 0; // throw something
else
theFunction =
TypeDescriptor.GetConverter(typeof(Function)).Conv ertTo(f,
typeof(Function));
}

And for my next question, is there a way to expose the
MSHTML library in a JS.NET assembly directly. I mean
without having to write a C/VB.NET control. I know that
we can reference the lib in VB,J++ and C++ but is there a
way to do that in JS?

If this is the wrong group, and I think it may be, then
can someone direct me to the group that handles this type
of inquerry.

Any help would be appreciated
- rashad
"if you want to reply to me directly, just remove the "-
noSpamPlease" and "NOSPAM" from my address

Nov 18 '05 #1
1 1131
"Rashad Rivera" <ra***********************@hotmail.NOSPAMcom> wrote in
message news:05****************************@phx.gbl...
I thought I
could access a function in a HTA application by passing it
into a JS.NET assembly. I learned of that it in exposed in
the asm as an Object(AKA: System.__ComObject). But I am
unable to cast it to a local Function variable.


Hi,

A "Function" is something very specific in JScript; it is not a normal .NET
method. You should check out my samples on GotDotNet if you want to see
JScript .NET interacting with IE.

http://www.gotdotnet.com/userfiles/torrboy/pdc2001.zip

Peter

--
Please post questions to the newsgroup - everyone benefits.
This post is provided "AS IS" with no warranties, and confers no rights
Sample code subject to http://www.microsoft.com/info/cpyright.htm
Office / Security / Random weblog -- http://weblogs.asp.net/ptorr
Nov 18 '05 #2

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

Similar topics

1
by: alaa | last post by:
I have the following code in an ASP page but it does not seem to allow a JScript to access VBScript variables. But if a VBScript accesses a variable in declared in a JScript TAG then it seems to...
1
by: TopDawg044 | last post by:
I continue to lose Javascript functionality in any browser I use under WinXPPro...(IE6, Moz 1.4, NS 7.1...)it is now at the point where I'm unable to access my school sites which use jscript and...
6
by: Alfred Taylor | last post by:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C#...
1
by: kscho | last post by:
Hi~ When I make shared library with option -fPIC, the result is wrong and different that made static library. first time , I made apps with static library. code works fine. however when i ...
1
by: RFS666 | last post by:
Hello together, I wanted to ask if somebody can help me with accessing a listbox (a serverside webform from the designer-toolbox) from clientside JScript. I need to add and remove values and...
37
by: pochartrand | last post by:
Hello, Is there a way to manipulate or at least read the pseudo-class of an element ? I know the style attribute can be accessed and gives the CSS properties for a particular element....
18
by: Franky | last post by:
I don't know how to ask this so that someone will not misread it but here goes. At run time I want to be able to evaluate functions from the Math library, but at design time I do not know what...
1
by: Eran | last post by:
I am trying to hook up or get some kind of a notification event when the script engine is executing a certain JScript function. The script engine is not hosted in IE, but in an independent...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.