Solved

create com dll with c# and raise vb event

Posted on 2013-11-15
8
495 Views
Last Modified: 2013-12-06
I need to create a dll with c# that is com visible so that I can use it in a web page  using the <object> tag.  This dll will also have to raise events in vbscript, so that the web page can get the event (the web page is old asp).  

I can write the dll, but how do I get it to raise a vbscript event?
0
Comment
Question by:dhenderson12
8 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 39651436
is this what you're looking for?

http://forums.asp.net/t/1442595.aspx
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 300 total points
ID: 39651760
more specifically, if you look at the post by kossovsky, you'll see a good example on how to build the DLL, register it, then call it from an asp page:

Set Base64 = CreateObject("ComComponent.Base64")
Result = Base64.Encode("some string to encode")
0
 

Author Comment

by:dhenderson12
ID: 39651763
yes, but it doesn't show how to raise an event.  I need to be able to respond to events from my web page with a vbscript function.
0
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 

Author Comment

by:dhenderson12
ID: 39652167
I guess I should rephrase my response:  I need the web page, via vbscript, to respond to events raised from my com object.  Hope that makes more sense.
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 39686866
Web pages doesn't work that way. All events come from the browser. If there is no request to the server to return a page, there is no code running in your web application.

What specifically is it that you are trying to accomplish that you though creating events from the server side would solve?
0
 
LVL 51

Assisted Solution

by:Ted Bouskill
Ted Bouskill earned 200 total points
ID: 39687708
I'm going to repeat GreenGhost's comment another way with some differences.

A web server can run events in many web server languages as can a copy of a page with JavaScript in the browser.  However, the server events only fire when the browser requests the page.

Remember, a web browser requests a web page using the URL in the address window.  The web server receives the URL request and then fires server code and logic to then transmit the page back to the browser.  As the page is being rendered on the browser JavaScript can begin to execute as the page is loading based on how it is inserted in the page.  Once the full response has been sent to the browser from the server, they disconnect from each other.

The server cannot push events back to the browser.  The browser using JavaScript timers can poll the server without refreshing the entire page, however, the web server only responds to requests from the browser.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question