Solved

create com dll with c# and raise vb event

Posted on 2013-11-15
8
498 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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)

756 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