Solved

create com dll with c# and raise vb event

Posted on 2013-11-15
8
483 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 32

Expert Comment

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

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

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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:tedbilly
tedbilly 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now