Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Navneet Hegde

@Navneet Hegde
About
Posts
194
Topics
52
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • attach Event in Javascript
    N Navneet Hegde

    Hi All!

    using System;
    using System.Collections.Generic;
    using System.Runtime.InteropServices;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    namespace FinalEventsDLL
    {
    public delegate void ControlEventHandler(string redirectUrl);

    \[Guid("E819B536-D64F-4fed-BCE7-F21650364211")\]
    public interface DBCOM\_Interface
    {
        \[DispId(1)\]
        void Hello1(string userid, string password);
        \[DispId(2)\]
        bool Hello2(string selCommand);
    }
    
    // // Events interface Database\_COMObjectEvents 
    \[Guid("E72E89DB-788B-4f6d-BFB1-679CC103D13A"),
    InterfaceType(ComInterfaceType.InterfaceIsIDispatch)\]
    public interface DBCOM\_Events
    {
        //Add a DispIdAttribute to any members in the source interface to specify the COM DispId.
        \[DispId(0x60020001)\]
        void OnClose(string redirectUrl); //This method will be visible from JS
    }
    
    \[Guid("EC393ACC-37A5-44da-B316-E4E367517D1C"),
    ClassInterface(ClassInterfaceType.None),
    ComSourceInterfaces(typeof(DBCOM\_Events))\]
    public class FinalDLL : DBCOM\_Interface
    {
    
        public FinalDLL() { }
        public event ControlEventHandler OnClose;
    
        public void Hello1(string userid, string password)
        {
            return;
        }
    
        public bool Hello2(string selCommand)
        {
            Close();
            return true;
        }
    
        \[ComVisible(true)\]
        public void Close()
        {
            if (OnClose != null)
            {
                OnClose("http://otherwebsite.com"); //Calling event that will be catched in JS
            }
            else
            {
                MessageBox.Show("No Event Attached"); //If no events are attached send message.
            }
        }
    }
    

    }

    Above is the code for my C# DLL REGISTERED I have registered it using regasm D:\FinalEventsDLL.ddl /codebase /tlb IN JAVASCRIPT

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head> <title>C# ActiveX Test</title> </head>

    <body onload="myload();">
    <h1>This is Our ActiveX Test Page h1>

    <script type="text/javascript" >

    function myload{
    var myAx = new ActiveXObject("FinalEventsDLL.FinalDLL");

    if(myAx != null)
    {
       myAx.Hello2("sd")
    }
    else
    {
        alert("NOOOO... we failed");
    }
    

    }
    </script>

    </body></html>

    Everything is work

    C# com csharp javascript html database

  • C# DLL Events Catching.
    N Navneet Hegde

    Thanks for your efforts, I will try other resources!

    Develop2Program & Program2Develop

    C# csharp javascript help

  • C# DLL Events Catching.
    N Navneet Hegde

    Thanks for your reply, But no this is not what I mean I want to raise an Event in C# DLL class and this should be Caught in Javascript Code

    var myObj
    myObj = new ActiveXObject("myDLL.myClass");
    myObj.myPropertyOne="value1";
    myObj.processValue();

    Now if I through Event with value 0 Then how can I get the Event in Javascript. Thanks!

    Develop2Program & Program2Develop

    C# csharp javascript help

  • C# DLL Events Catching.
    N Navneet Hegde

    Hi! I have build C# DLL with few function and Registered it successfully and also consuming it through Javascript ActiveXObject. So far All is good. Now I want to raise one Event in C# Dll and want that event to be handled by Javascript Is that possible to catch event in Javascript which is thrown by C# DLL, If yes can you please help me. Thanks!

    Develop2Program & Program2Develop

    C# csharp javascript help

  • how to cause current application to close upon arrival of new updated application ?
    N Navneet Hegde

    Hi! Your new Application starts. In Main get the collection of all the running processes. Iterating it you get your running process object. Compare it's build with this process build. If it's greater than kill the previous process and continue with this process. Else kill this process. Thanks!

    Develop2Program & Program2Develop

    C# csharp visual-studio tools tutorial question

  • how to cause current application to close upon arrival of new updated application ?
    N Navneet Hegde

    Hi! Do you mean to say that during updated installation you SETUP should remove previous installation. Thanks!

    Develop2Program & Program2Develop

    C# csharp visual-studio tools tutorial question

  • Can not submit to the server. [modified]
    N Navneet Hegde

    Hi! Have you tried setting AutoPOstBAck property Thanks!

    Develop2Program & Program2Develop

    C# csharp help sysadmin question

  • button size srinks more in table layout panel
    N Navneet Hegde

    Hi! Design your layout in 800 by 600 resolution. and then move to 1280 by 1024 Thanks

    Develop2Program & Program2Develop

    C# question csharp design

  • C# Register DLL for COM Server
    N Navneet Hegde

    Hi All I have C# dll developed now I want to access it using JavaScript in ASP I need to Register it as COM Server? How can I do that Thansk!

    Develop2Program & Program2Develop

    C# question csharp javascript com sysadmin

  • VB.Net MDI Child form loading issue...
    N Navneet Hegde

    Hi! On which Event of Form are you fetching the data, Can we ;) know that? Thanks!

    Develop2Program & Program2Develop

    Visual Basic help csharp css database

  • Forums
    N Navneet Hegde

    Best way is to start yourself by Looking at this site Think, work and accomplish Thanks!

    Develop2Program & Program2Develop

    .NET (Core and Framework) csharp asp-net

  • Working with value pairs(a key and a value)
    N Navneet Hegde

    ok

    Develop2Program & Program2Develop

    C# help question

  • [Message Deleted]
    N Navneet Hegde

    Hi Can you get something like this <<%Page.a %>> Thanks!

    Develop2Program & Program2Develop

    C#

  • Working with value pairs(a key and a value)
    N Navneet Hegde

    Hi! It quite simple If Key Not Exists Keep on Adding Else If Exists RemoveKey and then Add Thanks!

    Develop2Program & Program2Develop

    C# help question

  • Using Regex in C# for ip:port format
    N Navneet Hegde

    Sure thx!

    Develop2Program & Program2Develop

    C# csharp regex question

  • Using Regex in C# for ip:port format
    N Navneet Hegde

    This should work @"^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[:][0-9]{1,5}$" Thanks!

    Develop2Program & Program2Develop

    C# csharp regex question

  • Using Regex in C# for ip:port format
    N Navneet Hegde

    Hmmmm not working for 2221.1.1:3000 Sorry!

    Develop2Program & Program2Develop

    C# csharp regex question

  • Using Regex in C# for ip:port format
    N Navneet Hegde

    But this work's fine. MessageBox.Show(System.Text.RegularExpressions.Regex.IsMatch("123a123a123a123", @"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{1,5}$", System.Text.RegularExpressions.RegexOptions.ExplicitCapture).ToString()); Thanks!

    Develop2Program & Program2Develop

    C# csharp regex question

  • Using Regex in C# for ip:port format
    N Navneet Hegde

    Try This : System.Text.RegularExpressions.Regex regStr = new System.Text.RegularExpressions.Regex(@"^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{1,5}$"); Thanks!

    Develop2Program & Program2Develop

    C# csharp regex question

  • Get current date from other pc
    N Navneet Hegde

    Where is your vb6 app executing and of which computer you want current time.

    Develop2Program & Program2Develop

    Visual Basic database sql-server sysadmin help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups