473,387 Members | 1,834 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,387 software developers and data experts.

capture Event of VB DLL in Javascript

6
Hi.................,

i want to capture event from vb dll file in javascript,actually i can already access all the function of that dll from javascript but i don know how to capture event raised by ny vb dll file in my web page from javascript............if u have any solution plz post it as early as possible.

my code is as follows


[HTML]<html>
<head>
<title></title>
</head>
<SCRIPT language="javascript">
function comEventOccured()
{
var msg;
var obj =new ActiveXObject("e3_TestProj4ASP.e3_Test");
obj.GetUCaseStr("super"); // function that raises the custom event
// UppercaseStr(msg)

)
function UppercaseStr(msg)
{
alert(msg);
document.write(msg);
alert("After Event");
}



</SCRIPT>
<body>

<INPUT TYPE=button value=MethodCall onClick="comEventOccured()">
</body>

</html>[/HTML]

************************************************** **********************************

e3_TestProj4ASP.dll

UppercaseStr(msg) is the event raised in Vb dll as

raiseEvent UppercaseStr(msg)

msg is the dim variable returned by my event, so whenever i capture it i need to have the value of that msg variable.

thanx
Nov 22 '07 #1
9 2413
acoder
16,027 Expert Mod 8TB
Welcome to TSDN!

If you use document.write after the page has loaded, it will open a new document for writing. Where do you want this new valueto be displayed?

PS. If it's just uppercase that you want, why not use JavaScript instead of VB for this?
Nov 22 '07 #2
Hirru
6
Welcome to TSDN!

If you use document.write after the page has loaded, it will open a new document for writing. Where do you want this new valueto be displayed?

PS. If it's just uppercase that you want, why not use JavaScript instead of VB for this?
hi..............

i don have dip knowledge in jscript, so i don know hthat document.write is of vbscript, but it doesn't make call to event.

i mean whenever we call the above function it raises the UppercaseStrn event which returns the msg parameter which is then useful to me.

but i cant capture the raised event, i don want to display the msg parameter i just want to pass it in new page through jsp.but alert(msg) does not called, it means raised event is not captured by ny Uppercase function

i hope u got it properly........
By the way thanx for replying....& if u have any idea plz send me urgent........
Thanx a lot
Hirru
Nov 23 '07 #3
acoder
16,027 Expert Mod 8TB
If you want to pass the msg value to your JSP page, set a form input element to that value, e.g.
[HTML]<input id="msg" name="msg" type="text">[/HTML] then in your JavaScript function, instead of the alert, try:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("msg").value = msg;
You then need to submit this value to the JSP script.
Nov 23 '07 #4
Hirru
6
[HTML]<html>
<head>
<title></title>
</head>
<SCRIPT language="javascript">
function comEventOccured()
{
var msg;
var obj =new ActiveXObject("e3_TestProj4ASP.e3_Test");
obj.GetUCaseStr("super"); // function that raises the custom event
// UppercaseStr(msg)

)
function UppercaseStr(msg)
{
document.getElementbyId("msg")=msg;
}
</SCRIPT>
<body>
<INPUT TYPE=button value=MethodCall onClick="comEventOccured()">
</body>
</html>[/HTML]
Nov 23 '07 #5
acoder
16,027 Expert Mod 8TB
Try this:[HTML]
<html>
<head>
<title></title>
</head>
<SCRIPT type="text/javascript">
function comEventOccured()
{
var msg;
var obj =new ActiveXObject("e3_TestProj4ASP.e3_Test");
obj.GetUCaseStr("super"); // function that raises the custom event
// UppercaseStr(msg)

)
function UppercaseStr(msg)
{
document.getElementById("msg").value=msg;
}
</SCRIPT>
<body>
<form action="yourJSPscript.jsp">
<input id="msg" type="text">
<INPUT TYPE=button value=MethodCall onClick="comEventOccured()">
<input type="submit">
</form>
</body>
</html>[/HTML]
Nov 23 '07 #6
Hirru
6
First of all Once again thanx for replying

<B>My DLL file is as follows</B>

Expand|Select|Wrap|Line Numbers
  1. Public Event UppercaseStr(UStr As String)
  2.  
  3. Public Sub GetUCaseStr(MsgStr As String)
  4.     Dim UString As String
  5.  
  6.     TimerTask 5
  7.  
  8.     UString = UCase(MsgStr)
  9.     RaiseEvent UppercaseStr(UString)
  10. End Sub
  11.  
************************************************** *****

Now, the actuall problem is that when i call the
GetUCaseStr("super") Function as

obj.GetUCaseStr("super") ...........it wait for 5 second, then convert the string into Uppercase and raise the Event UppercaseStr which return a "SUPER" as String.

But when i call the obj.GetUCaseStr("super"), it is successfully called, then it waits for 5 second, it means the event in the dll is raised but it wont be captured in Javascript.

So i need help in javascript that how to capture that event which is raised in dll...
i have searched almost forum and sites, i din get this answer..related to
Event capturing in Javascript

Thanx a lot Once Again for replying me
Hirru
Nov 23 '07 #7
acoder
16,027 Expert Mod 8TB
Is this the only thing that you require in VB, i.e. making a string upper case? Or is this just an example and you're going to make calls to other VB DLLs?

If it's just this, then there's no need for VB - JavaScript can also convert a string to upper case.
Nov 25 '07 #8
Hirru
6
Thank-U very very much again for replying

No, Its just testing actual thing is different.........................................

But I got the solution wchin is written bellow

[HTML]<html>
<head>
<title></title>
<div style="display: none">
<object Progid="e3_TestProj4ASP.e3_Test" id="dllobjr"
classid="ClsId:A11D6C46-5968-4BB9-BF56-C974EF87BFAD" style="display: none;">
</object>
</div>

<script type="text/javascript" FOR="dllobj" EVENT="UppercaseStr(msg)" Viewastext>
alert( "I just caught the event!"+ msg );
</script>
</head>
<body>
<b>This contains the "object" tag</b><br>

<input type=button onclick=VBxSignaler.GetUCaseStr("super") value="FireEvent" /><p>
</body>
</html>
[/HTML]
NOTE: This page is working if it is running in any of the
Appication Server Such as Tomcat. IIS,etc......depends on your application.

It can be Jsp, Asp or Html page.....you can do the same in any way......

Thanx...ba bye
Nov 26 '07 #9
acoder
16,027 Expert Mod 8TB
This would obviously only work in IE.

Anyway, I'm glad you got it working. Post again if you have any more questions.
Nov 26 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Hans | last post by:
Hi! Does anybody of you have a good algorithm to capture when a value in a textbox is changed? I'm using the keypress/keydown events but they seems to be a bit inconsistent (IE and Mozilla)....
2
by: jva02 | last post by:
Hi, I'm confused why I can capture an event fired by an ActiveX object when it's loaded via an <object> tag, but not when loaded using "new ActiveXObject". Here's a basic example: vb ActiveX...
2
by: Saulo | last post by:
Hi, Well...I have a function in javascrit that capture the keys or event that a user to do... How I do to capture a control in the Datagrid ItemTemplate it's a Footer into the Template ??? ...
4
by: Bill Manring | last post by:
I need to capture the event when the user closes the browser in my application. I have some code in the session_End event, which works fine when the session times out, but I need to end the...
5
by: ewillyb | last post by:
Hi, ASP.NET has some interesting behavior when the user hits the Enter key. If there are multiple ASP:Buttons (rendered as HTML submits) on the form, when the user hits enter, the first button's...
7
by: Lit | last post by:
Hi, How can I capture the vertical scroll bar position for a Listbox. I have a Listbox of 100 items + when I click on it I post back remove the item selected. After returning to the client...
1
by: bravo | last post by:
hi using javascript i am able to capture the backspace key and also to disable it but it is not working for the back button on the toolbar. i am new to javascript have searched a lot but didnt...
4
by: mbatestblrock | last post by:
I hope this makes some sense. My ultimate goal here is to execute a block of code if the mouse has not moved in a minute or so within the broswer. The machine I am running this on is for internal...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.