Solved

create com dll with c# and raise vb event

Posted on 2013-11-15
8
489 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

DevOps Toolchain Recommendations

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question! 4 36
Hey!! 5 33
Hey!!!! 1 20
Call a function within the ASP code 4 9
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

786 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