Hi,

The problem i am mentioning is re-hash of previous post but the thread
finally ended with no concrete solution.

Subject
Date
UserControl in Browser Caching Problem                        20/2/2002
More Control Caching Strangeness                                22/2/2002
 Cacheing in IE for Windows Forms Controls doesn't       8/3/2002

And now i am the victim... Is this a confirmed bug or are there any solution
which i m not aware ?

below is the sample code
================

Control
--------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data ;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Net ;
using System.Threading;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;

using System.Text;



namespace Client
{
 /// <summary>
 /// Summary description for Ticker.
 /// </summary>
 ///
 [ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(ClientCOMEvents))]
 public class Ticker : System.Windows.Forms.UserControl,ClientCOMIncoming
 {
  //Declaration of Delegate and event.
  public delegate void ClientEventHandler();
  public event ClientEventHandler ClientEvt;

  private System.Windows.Forms.Label lbltickerdisplay;
  private System.Windows.Forms.Timer GetStockTimer;
  private System.ComponentModel.IContainer components;

  /// <summary>
  /// Required designer variable.
  /// </summary>

  public Ticker()
  {
   //
   // Required for Windows Form Designer support
   //
   InitializeComponent();
   // TODO: Add any constructor code after InitializeComponent call
   //
  }

  /// <summary>
  /// Clean up any resources being used.
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if(components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );

  }

  #region Windows Form Designer generated code
  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>
  private void InitializeComponent()
  {
   this.components = new System.ComponentModel.Container();
   this.lbltickerdisplay = new System.Windows.Forms.Label();
   this.GetStockTimer = new System.Windows.Forms.Timer(this.components);
   this.SuspendLayout();
   //
   // lbltickerdisplay
   //
   this.lbltickerdisplay.AutoSize = true;
   this.lbltickerdisplay.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.lbltickerdisplay.ForeColor = System.Drawing.Color.Red;
   this.lbltickerdisplay.Location = new System.Drawing.Point(600, 8);
   this.lbltickerdisplay.Name = "lbltickerdisplay";
   this.lbltickerdisplay.Size = new System.Drawing.Size(0, 13);
   this.lbltickerdisplay.TabIndex = 0;

   //
   // GetStockTimer
   //
   this.GetStockTimer.Enabled = true;

   //
   // Ticker
   //
   this.BackColor = System.Drawing.SystemColors.ControlText;
   this.Controls.AddRange(new System.Windows.Forms.Control[]
{this.lbltickerdisplay});
   this.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
   this.Name = "Ticker";
   this.Size = new System.Drawing.Size(864, 72);
   this.Load += new System.EventHandler(this.Ticker_Load);
   this.ResumeLayout(false);

  }
  #endregion

  // Dummy Function to implement the interface.
  public void TestMsg()
  {

  }


  private void Ticker_Load(object sender, System.EventArgs e)
  {
   try
   {
    ClientEvt();
   }
   catch(Exception e1)
   {
    MessageBox.Show("Error occured in raising Ticker event : " +
e1.Message);
   }
  }
 }


 public interface ClientCOMIncoming
 {
  void TestMsg();
 }
 [Guid("A59B958D-B363-454b-88AA-BE8626A131FB")]
 [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
 public interface ClientCOMEvents
 {
  [DispId(0x60020000)]
  void ClientEvt();
 }

}


HTML
------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html>
<head>
  <title>DLL Init</title>
  <meta name="vs_defaultClientScript" content="JavaScript">
  <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5";>
  <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
  <meta name="ProgId" content="VisualStudio.HTML">
  <meta name="Originator" content="Microsoft Visual Studio.NET 7.0">
</head>

 <SCRIPT FOR="CtlTicker" EVENT="ClientEvt">
  alert("Ticker event raised");
 </SCRIPT>

 <body MS_POSITIONING="GridLayout">
  <object id=CtlTicker classid=http:TickerDisplay.dll#Client.Ticker
width="500" height="200" events="true"></object>
 </body>
</html>




Regards
Yogesh Shetty
Team COE
Financial Technologies (India) Ltd.
URL: www.ftindia.com
mailto : [EMAIL PROTECTED]
contact : +91 22 6164145

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to