473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

.ocx with ASP.NET

I must use a component in my ASP.NET project but couldn't do it. There is a mistake anywhere .
I use Microsoft Visual Studio.NET 2003
I'm making a new project and add MSFlexGrid to my WebForm1.aspx
I'm adding MSFlexGrid from Project->Add References too

When Run this project it's give an error at WebForm1.aspx.vb at MSFlex.Col = 1

System.Runtime.InteropServices.COMException: The server threw an exception.
My WebForm1.aspx like this

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">

<OBJECT id=MSFlex classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30>
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="Rows" VALUE="2">
<PARAM NAME="Cols" VALUE="2">
<PARAM NAME="FixedRows" VALUE="1">
<PARAM NAME="FixedCols" VALUE="1">
<PARAM NAME="RowHeightMin" VALUE="0">
<PARAM NAME="BackColor" VALUE="-2147483643">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="BackColorFixed" VALUE="-2147483633">
<PARAM NAME="ForeColorFixed" VALUE="-2147483630">
<PARAM NAME="BackColorSel" VALUE="-2147483635">
<PARAM NAME="ForeColorSel" VALUE="-2147483634">
<PARAM NAME="BackColorBkg" VALUE="8421504">
<PARAM NAME="GridColor" VALUE="12632256">
<PARAM NAME="GridColorFixed" VALUE="0">
<PARAM NAME="WordWrap" VALUE="0">
<PARAM NAME="Redraw" VALUE="-1">
<PARAM NAME="AllowBigSelection" VALUE="-1">
<PARAM NAME="ScrollTrack" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="RightToLeft" VALUE="0">
<PARAM NAME="TextStyle" VALUE="0">
<PARAM NAME="TextStyleFixed" VALUE="0">
<PARAM NAME="FocusRect" VALUE="1">
<PARAM NAME="HighLight" VALUE="1">
<PARAM NAME="FillStyle" VALUE="0">
<PARAM NAME="GridLines" VALUE="1">
<PARAM NAME="GridLinesFixed" VALUE="2">
<PARAM NAME="ScrollBars" VALUE="3">
<PARAM NAME="SelectionMode" VALUE="0">
<PARAM NAME="MergeCells" VALUE="0">
<PARAM NAME="AllowUserResizing" VALUE="0">
<PARAM NAME="PictureType" VALUE="0">
<PARAM NAME="BorderStyle" VALUE="1">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="GridLineWidth" VALUE="1">
<PARAM NAME="FormatString" VALUE="">
<PARAM NAME="OLEDropMode" VALUE="0">
</OBJECT>

</form>
</body>
</HTML>
And My WebForm1.aspx.vb like this
Public Class WebForm1
Inherits System.Web.UI.Page
'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MSFlex As MSFlexGridLib.MSFlexGrid
MSFlex = New MSFlexGridLib.MSFlexGrid
MSFlex.Col = 1
MSFlex.Row = 1
MSFlex.Text = "abc"
End Sub

End Class
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 18 '05 #1
8 4167
OCX's don't run on the server side, they're only rendered on the client
side. If you want to set properties of the control, you have to use a
client-side script.

Trying to access properties of the control from the server will not
work, because the control doesn't exist on the server.

di*****@yahoo.com wrote:
I must use a component in my ASP.NET project but couldn't do it. There is a mistake anywhere .
I use Microsoft Visual Studio.NET 2003
I'm making a new project and add MSFlexGrid to my WebForm1.aspx
I'm adding MSFlexGrid from Project->Add References too

When Run this project it's give an error at WebForm1.aspx.vb at MSFlex.Col = 1

System.Runtime.InteropServices.COMException: The server threw an exception.
My WebForm1.aspx like this

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">

<OBJECT id=MSFlex classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30>
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="Rows" VALUE="2">
<PARAM NAME="Cols" VALUE="2">
<PARAM NAME="FixedRows" VALUE="1">
<PARAM NAME="FixedCols" VALUE="1">
<PARAM NAME="RowHeightMin" VALUE="0">
<PARAM NAME="BackColor" VALUE="-2147483643">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="BackColorFixed" VALUE="-2147483633">
<PARAM NAME="ForeColorFixed" VALUE="-2147483630">
<PARAM NAME="BackColorSel" VALUE="-2147483635">
<PARAM NAME="ForeColorSel" VALUE="-2147483634">
<PARAM NAME="BackColorBkg" VALUE="8421504">
<PARAM NAME="GridColor" VALUE="12632256">
<PARAM NAME="GridColorFixed" VALUE="0">
<PARAM NAME="WordWrap" VALUE="0">
<PARAM NAME="Redraw" VALUE="-1">
<PARAM NAME="AllowBigSelection" VALUE="-1">
<PARAM NAME="ScrollTrack" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="RightToLeft" VALUE="0">
<PARAM NAME="TextStyle" VALUE="0">
<PARAM NAME="TextStyleFixed" VALUE="0">
<PARAM NAME="FocusRect" VALUE="1">
<PARAM NAME="HighLight" VALUE="1">
<PARAM NAME="FillStyle" VALUE="0">
<PARAM NAME="GridLines" VALUE="1">
<PARAM NAME="GridLinesFixed" VALUE="2">
<PARAM NAME="ScrollBars" VALUE="3">
<PARAM NAME="SelectionMode" VALUE="0">
<PARAM NAME="MergeCells" VALUE="0">
<PARAM NAME="AllowUserResizing" VALUE="0">
<PARAM NAME="PictureType" VALUE="0">
<PARAM NAME="BorderStyle" VALUE="1">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="GridLineWidth" VALUE="1">
<PARAM NAME="FormatString" VALUE="">
<PARAM NAME="OLEDropMode" VALUE="0">
</OBJECT>

</form>
</body>
</HTML>
And My WebForm1.aspx.vb like this
Public Class WebForm1
Inherits System.Web.UI.Page
'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MSFlex As MSFlexGridLib.MSFlexGrid
MSFlex = New MSFlexGridLib.MSFlexGrid
MSFlex.Col = 1
MSFlex.Row = 1
MSFlex.Text = "abc"
End Sub

End Class
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Nov 18 '05 #2
Hi Dilek,

You're confusing client-side and server-side. An ActiveX control (.ocx) is a
client-side application. It is hosted in the browser. Your HTML is right,
but your CodeBehind is wrong. The ONLY thing you can use CodeBehind for with
an ActiveX Control is to (possibly, if necessary) modify the OBJECT tag that
is sent to the client. The ActiveX Control is fetched by the browser and run
on the client, according to the OBJECT tag in the HTML on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Dilek KARAKAYA" <di*****@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
I must use a component in my ASP.NET project but couldn't do it. There is a mistake anywhere . I use Microsoft Visual Studio.NET 2003
I'm making a new project and add MSFlexGrid to my WebForm1.aspx
I'm adding MSFlexGrid from Project->Add References too

When Run this project it's give an error at WebForm1.aspx.vb at MSFlex.Col = 1
System.Runtime.InteropServices.COMException: The server threw an exception.

My WebForm1.aspx like this

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">

<OBJECT id=MSFlex classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30>
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="Rows" VALUE="2">
<PARAM NAME="Cols" VALUE="2">
<PARAM NAME="FixedRows" VALUE="1">
<PARAM NAME="FixedCols" VALUE="1">
<PARAM NAME="RowHeightMin" VALUE="0">
<PARAM NAME="BackColor" VALUE="-2147483643">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="BackColorFixed" VALUE="-2147483633">
<PARAM NAME="ForeColorFixed" VALUE="-2147483630">
<PARAM NAME="BackColorSel" VALUE="-2147483635">
<PARAM NAME="ForeColorSel" VALUE="-2147483634">
<PARAM NAME="BackColorBkg" VALUE="8421504">
<PARAM NAME="GridColor" VALUE="12632256">
<PARAM NAME="GridColorFixed" VALUE="0">
<PARAM NAME="WordWrap" VALUE="0">
<PARAM NAME="Redraw" VALUE="-1">
<PARAM NAME="AllowBigSelection" VALUE="-1">
<PARAM NAME="ScrollTrack" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="RightToLeft" VALUE="0">
<PARAM NAME="TextStyle" VALUE="0">
<PARAM NAME="TextStyleFixed" VALUE="0">
<PARAM NAME="FocusRect" VALUE="1">
<PARAM NAME="HighLight" VALUE="1">
<PARAM NAME="FillStyle" VALUE="0">
<PARAM NAME="GridLines" VALUE="1">
<PARAM NAME="GridLinesFixed" VALUE="2">
<PARAM NAME="ScrollBars" VALUE="3">
<PARAM NAME="SelectionMode" VALUE="0">
<PARAM NAME="MergeCells" VALUE="0">
<PARAM NAME="AllowUserResizing" VALUE="0">
<PARAM NAME="PictureType" VALUE="0">
<PARAM NAME="BorderStyle" VALUE="1">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="GridLineWidth" VALUE="1">
<PARAM NAME="FormatString" VALUE="">
<PARAM NAME="OLEDropMode" VALUE="0">
</OBJECT>

</form>
</body>
</HTML>
And My WebForm1.aspx.vb like this
Public Class WebForm1
Inherits System.Web.UI.Page
'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub

'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here
Dim MSFlex As MSFlexGridLib.MSFlexGrid
MSFlex = New MSFlexGridLib.MSFlexGrid
MSFlex.Col = 1
MSFlex.Row = 1
MSFlex.Text = "abc"
End Sub

End Class
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &

ASP.NET resources...
Nov 18 '05 #3
I just noticed this conversation. I'm trying to review ASP.Net in a hurry
for the usual reason (sudden job :-) and I have a vague question.

In the most general sense, here is the problem. I've added an Ocx to my
toolbox and put a copy on the aspx page. This ocx somehow supposdly provides
access to a currently running application session through a COM dll.

The problem is that I'm now trying by trial and error to make use of it and
I'm not sure of the best possible approach. In general I would expect that I
would need to make a number of calls to the application and put the data on
the screen.

Given that, what is the general direction I should proceed in? Sorry I
can't be more specific.

"Kevin Spencer" wrote:
Hi Dilek,

You're confusing client-side and server-side. An ActiveX control (.ocx) is a
client-side application. It is hosted in the browser. Your HTML is right,
but your CodeBehind is wrong. The ONLY thing you can use CodeBehind for with
an ActiveX Control is to (possibly, if necessary) modify the OBJECT tag that
is sent to the client. The ActiveX Control is fetched by the browser and run
on the client, according to the OBJECT tag in the HTML on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Dilek KARAKAYA" <di*****@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
I must use a component in my ASP.NET project but couldn't do it. There is

a mistake anywhere .
I use Microsoft Visual Studio.NET 2003
I'm making a new project and add MSFlexGrid to my WebForm1.aspx
I'm adding MSFlexGrid from Project->Add References too

When Run this project it's give an error at WebForm1.aspx.vb at MSFlex.Col

= 1

System.Runtime.InteropServices.COMException: The server threw an

exception.


My WebForm1.aspx like this

<%@ Page Language="vb" AutoEventWireup="false"

Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"

content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">

<OBJECT id=MSFlex classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30>
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="Rows" VALUE="2">
<PARAM NAME="Cols" VALUE="2">
<PARAM NAME="FixedRows" VALUE="1">
<PARAM NAME="FixedCols" VALUE="1">
<PARAM NAME="RowHeightMin" VALUE="0">
<PARAM NAME="BackColor" VALUE="-2147483643">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="BackColorFixed" VALUE="-2147483633">
<PARAM NAME="ForeColorFixed" VALUE="-2147483630">
<PARAM NAME="BackColorSel" VALUE="-2147483635">
<PARAM NAME="ForeColorSel" VALUE="-2147483634">
<PARAM NAME="BackColorBkg" VALUE="8421504">
<PARAM NAME="GridColor" VALUE="12632256">
<PARAM NAME="GridColorFixed" VALUE="0">
<PARAM NAME="WordWrap" VALUE="0">
<PARAM NAME="Redraw" VALUE="-1">
<PARAM NAME="AllowBigSelection" VALUE="-1">
<PARAM NAME="ScrollTrack" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="RightToLeft" VALUE="0">
<PARAM NAME="TextStyle" VALUE="0">
<PARAM NAME="TextStyleFixed" VALUE="0">
<PARAM NAME="FocusRect" VALUE="1">
<PARAM NAME="HighLight" VALUE="1">
<PARAM NAME="FillStyle" VALUE="0">
<PARAM NAME="GridLines" VALUE="1">
<PARAM NAME="GridLinesFixed" VALUE="2">
<PARAM NAME="ScrollBars" VALUE="3">
<PARAM NAME="SelectionMode" VALUE="0">
<PARAM NAME="MergeCells" VALUE="0">
<PARAM NAME="AllowUserResizing" VALUE="0">
<PARAM NAME="PictureType" VALUE="0">
<PARAM NAME="BorderStyle" VALUE="1">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="GridLineWidth" VALUE="1">
<PARAM NAME="FormatString" VALUE="">
<PARAM NAME="OLEDropMode" VALUE="0">
</OBJECT>

</form>
</body>
</HTML>
And My WebForm1.aspx.vb like this
Public Class WebForm1
Inherits System.Web.UI.Page
'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
End Sub

'NOTE: The following placeholder declaration is required by the Web

Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MSFlex As MSFlexGridLib.MSFlexGrid
MSFlex = New MSFlexGridLib.MSFlexGrid
MSFlex.Col = 1
MSFlex.Row = 1
MSFlex.Text = "abc"
End Sub

End Class
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &

ASP.NET resources...

Nov 18 '05 #4
> In the most general sense, here is the problem. I've added an Ocx to my
toolbox and put a copy on the aspx page. This ocx somehow supposdly provides access to a currently running application session through a COM dll.
An ActiveX Control is not a server-side object. It is downloaded and
executed in the client browser. The only thing you should be adding is an
<OBJECT> tag to your client-side HTML.
The problem is that I'm now trying by trial and error to make use of it and I'm not sure of the best possible approach. In general I would expect that I would need to make a number of calls to the application and put the data on the screen.
An ActiveX Control is an application. How it works is, like any other app,
entirely up to the developer who created it in the first place..
Given that, what is the general direction I should proceed in? Sorry I
can't be more specific.
Learn how ActiveX Controls work, how an <OBJECT> tag is used to embed the
ActiveX Control in the web page on the client, and how to use th <OBJECT>
tag to pass parameters to the Control. Other than that, how the Control
works, I can't tell you. Only the developer of the Control could tell you
that.

The following MSDN article should be useful:

http://msdn.microsoft.com/library/de...n_actxcont.asp

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com... I just noticed this conversation. I'm trying to review ASP.Net in a hurry
for the usual reason (sudden job :-) and I have a vague question.

In the most general sense, here is the problem. I've added an Ocx to my
toolbox and put a copy on the aspx page. This ocx somehow supposdly provides access to a currently running application session through a COM dll.

The problem is that I'm now trying by trial and error to make use of it and I'm not sure of the best possible approach. In general I would expect that I would need to make a number of calls to the application and put the data on the screen.

Given that, what is the general direction I should proceed in? Sorry I
can't be more specific.

"Kevin Spencer" wrote:
Hi Dilek,

You're confusing client-side and server-side. An ActiveX control (.ocx) is a client-side application. It is hosted in the browser. Your HTML is right, but your CodeBehind is wrong. The ONLY thing you can use CodeBehind for with an ActiveX Control is to (possibly, if necessary) modify the OBJECT tag that is sent to the client. The ActiveX Control is fetched by the browser and run on the client, according to the OBJECT tag in the HTML on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Dilek KARAKAYA" <di*****@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
I must use a component in my ASP.NET project but couldn't do it. There is
a mistake anywhere .
I use Microsoft Visual Studio.NET 2003
I'm making a new project and add MSFlexGrid to my WebForm1.aspx
I'm adding MSFlexGrid from Project->Add References too

When Run this project it's give an error at WebForm1.aspx.vb at
MSFlex.Col = 1

System.Runtime.InteropServices.COMException: The server threw an

exception.


My WebForm1.aspx like this

<%@ Page Language="vb" AutoEventWireup="false"

Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"

content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">

<OBJECT id=MSFlex classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30>
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="Rows" VALUE="2">
<PARAM NAME="Cols" VALUE="2">
<PARAM NAME="FixedRows" VALUE="1">
<PARAM NAME="FixedCols" VALUE="1">
<PARAM NAME="RowHeightMin" VALUE="0">
<PARAM NAME="BackColor" VALUE="-2147483643">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="BackColorFixed" VALUE="-2147483633">
<PARAM NAME="ForeColorFixed" VALUE="-2147483630">
<PARAM NAME="BackColorSel" VALUE="-2147483635">
<PARAM NAME="ForeColorSel" VALUE="-2147483634">
<PARAM NAME="BackColorBkg" VALUE="8421504">
<PARAM NAME="GridColor" VALUE="12632256">
<PARAM NAME="GridColorFixed" VALUE="0">
<PARAM NAME="WordWrap" VALUE="0">
<PARAM NAME="Redraw" VALUE="-1">
<PARAM NAME="AllowBigSelection" VALUE="-1">
<PARAM NAME="ScrollTrack" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="RightToLeft" VALUE="0">
<PARAM NAME="TextStyle" VALUE="0">
<PARAM NAME="TextStyleFixed" VALUE="0">
<PARAM NAME="FocusRect" VALUE="1">
<PARAM NAME="HighLight" VALUE="1">
<PARAM NAME="FillStyle" VALUE="0">
<PARAM NAME="GridLines" VALUE="1">
<PARAM NAME="GridLinesFixed" VALUE="2">
<PARAM NAME="ScrollBars" VALUE="3">
<PARAM NAME="SelectionMode" VALUE="0">
<PARAM NAME="MergeCells" VALUE="0">
<PARAM NAME="AllowUserResizing" VALUE="0">
<PARAM NAME="PictureType" VALUE="0">
<PARAM NAME="BorderStyle" VALUE="1">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="GridLineWidth" VALUE="1">
<PARAM NAME="FormatString" VALUE="">
<PARAM NAME="OLEDropMode" VALUE="0">
</OBJECT>

</form>
</body>
</HTML>
And My WebForm1.aspx.vb like this
Public Class WebForm1
Inherits System.Web.UI.Page
'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
End Sub

'NOTE: The following placeholder declaration is required by the
Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form

Designer 'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MSFlex As MSFlexGridLib.MSFlexGrid
MSFlex = New MSFlexGridLib.MSFlexGrid
MSFlex.Col = 1
MSFlex.Row = 1
MSFlex.Text = "abc"
End Sub

End Class
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &

ASP.NET resources...

Nov 18 '05 #5
(Ironically enough, the purpose of the ocx to pass stuff out, not in,
specifically a hook to another currently running process.)

Can you point me to a good discussion on interaction betwee OCXs and ASP.Net
code? That other reference you gave seems to be solely focused on ActiveX.

Thanks!

"Kevin Spencer" wrote:
In the most general sense, here is the problem. I've added an Ocx to my
toolbox and put a copy on the aspx page. This ocx somehow supposdly

provides
access to a currently running application session through a COM dll.


An ActiveX Control is not a server-side object. It is downloaded and
executed in the client browser. The only thing you should be adding is an
<OBJECT> tag to your client-side HTML.
The problem is that I'm now trying by trial and error to make use of it

and
I'm not sure of the best possible approach. In general I would expect

that I
would need to make a number of calls to the application and put the data

on
the screen.


An ActiveX Control is an application. How it works is, like any other app,
entirely up to the developer who created it in the first place..
Given that, what is the general direction I should proceed in? Sorry I
can't be more specific.


Learn how ActiveX Controls work, how an <OBJECT> tag is used to embed the
ActiveX Control in the web page on the client, and how to use th <OBJECT>
tag to pass parameters to the Control. Other than that, how the Control
works, I can't tell you. Only the developer of the Control could tell you
that.

The following MSDN article should be useful:

http://msdn.microsoft.com/library/de...n_actxcont.asp

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
I just noticed this conversation. I'm trying to review ASP.Net in a hurry
for the usual reason (sudden job :-) and I have a vague question.

In the most general sense, here is the problem. I've added an Ocx to my
toolbox and put a copy on the aspx page. This ocx somehow supposdly

provides
access to a currently running application session through a COM dll.

The problem is that I'm now trying by trial and error to make use of it

and
I'm not sure of the best possible approach. In general I would expect

that I
would need to make a number of calls to the application and put the data

on
the screen.

Given that, what is the general direction I should proceed in? Sorry I
can't be more specific.

"Kevin Spencer" wrote:
Hi Dilek,

You're confusing client-side and server-side. An ActiveX control (.ocx) is a client-side application. It is hosted in the browser. Your HTML is right, but your CodeBehind is wrong. The ONLY thing you can use CodeBehind for with an ActiveX Control is to (possibly, if necessary) modify the OBJECT tag that is sent to the client. The ActiveX Control is fetched by the browser and run on the client, according to the OBJECT tag in the HTML on the client.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Dilek KARAKAYA" <di*****@yahoo.com> wrote in message
news:O$**************@TK2MSFTNGP12.phx.gbl...
> I must use a component in my ASP.NET project but couldn't do it. There is a mistake anywhere .
> I use Microsoft Visual Studio.NET 2003
> I'm making a new project and add MSFlexGrid to my WebForm1.aspx
> I'm adding MSFlexGrid from Project->Add References too
>
> When Run this project it's give an error at WebForm1.aspx.vb at MSFlex.Col = 1
>
> System.Runtime.InteropServices.COMException: The server threw an
exception.
>
>
> My WebForm1.aspx like this
>
> <%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
> <HEAD>
> <title>WebForm1</title>
> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
> </HEAD>
> <body MS_POSITIONING="GridLayout">
> <form id="Form1" method="post" runat="server">
>
> <OBJECT id=MSFlex classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30>
> <PARAM NAME="_ExtentX" VALUE="2646">
> <PARAM NAME="_ExtentY" VALUE="1323">
> <PARAM NAME="_Version" VALUE="393216">
> <PARAM NAME="Rows" VALUE="2">
> <PARAM NAME="Cols" VALUE="2">
> <PARAM NAME="FixedRows" VALUE="1">
> <PARAM NAME="FixedCols" VALUE="1">
> <PARAM NAME="RowHeightMin" VALUE="0">
> <PARAM NAME="BackColor" VALUE="-2147483643">
> <PARAM NAME="ForeColor" VALUE="-2147483640">
> <PARAM NAME="BackColorFixed" VALUE="-2147483633">
> <PARAM NAME="ForeColorFixed" VALUE="-2147483630">
> <PARAM NAME="BackColorSel" VALUE="-2147483635">
> <PARAM NAME="ForeColorSel" VALUE="-2147483634">
> <PARAM NAME="BackColorBkg" VALUE="8421504">
> <PARAM NAME="GridColor" VALUE="12632256">
> <PARAM NAME="GridColorFixed" VALUE="0">
> <PARAM NAME="WordWrap" VALUE="0">
> <PARAM NAME="Redraw" VALUE="-1">
> <PARAM NAME="AllowBigSelection" VALUE="-1">
> <PARAM NAME="ScrollTrack" VALUE="0">
> <PARAM NAME="Enabled" VALUE="-1">
> <PARAM NAME="RightToLeft" VALUE="0">
> <PARAM NAME="TextStyle" VALUE="0">
> <PARAM NAME="TextStyleFixed" VALUE="0">
> <PARAM NAME="FocusRect" VALUE="1">
> <PARAM NAME="HighLight" VALUE="1">
> <PARAM NAME="FillStyle" VALUE="0">
> <PARAM NAME="GridLines" VALUE="1">
> <PARAM NAME="GridLinesFixed" VALUE="2">
> <PARAM NAME="ScrollBars" VALUE="3">
> <PARAM NAME="SelectionMode" VALUE="0">
> <PARAM NAME="MergeCells" VALUE="0">
> <PARAM NAME="AllowUserResizing" VALUE="0">
> <PARAM NAME="PictureType" VALUE="0">
> <PARAM NAME="BorderStyle" VALUE="1">
> <PARAM NAME="Appearance" VALUE="1">
> <PARAM NAME="MousePointer" VALUE="0">
> <PARAM NAME="GridLineWidth" VALUE="1">
> <PARAM NAME="FormatString" VALUE="">
> <PARAM NAME="OLEDropMode" VALUE="0">
> </OBJECT>
>
> </form>
> </body>
> </HTML>
>
>
> And My WebForm1.aspx.vb like this
>
>
> Public Class WebForm1
> Inherits System.Web.UI.Page
> 'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
> #Region " Web Form Designer Generated Code "
> 'This call is required by the Web Form Designer.
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
> End Sub
>
> 'NOTE: The following placeholder declaration is required by the Web Form Designer.
> 'Do not delete or move it.
> Private designerPlaceholderDeclaration As System.Object
>
> Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
> 'CODEGEN: This method call is required by the Web Form Designer > 'Do not modify it using the code editor.
> InitializeComponent()
> End Sub
>
> #End Region
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> Dim MSFlex As MSFlexGridLib.MSFlexGrid
> MSFlex = New MSFlexGridLib.MSFlexGrid
> MSFlex.Col = 1
> MSFlex.Row = 1
> MSFlex.Text = "abc"
> End Sub
>
> End Class
>
>
> ************************************************** ********************
> Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...


Nov 18 '05 #6
You don't understand. ActiveX has NOTHING to do with .Net. It runs entirely
on its own on the client browser.

An ASPX page delivers an HTML document to the client. An ActiveX Control is
just a bunch of text tags in an HTML document. Think of it as "staic HTML"
if you like. Now, there are some tricks you can do on the server side to
create the tags dynamically if needed, but all you're doing is modifying
text.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
(Ironically enough, the purpose of the ocx to pass stuff out, not in,
specifically a hook to another currently running process.)

Can you point me to a good discussion on interaction betwee OCXs and ASP.Net code? That other reference you gave seems to be solely focused on ActiveX.
Thanks!

"Kevin Spencer" wrote:
In the most general sense, here is the problem. I've added an Ocx to my toolbox and put a copy on the aspx page. This ocx somehow supposdly

provides
access to a currently running application session through a COM dll.


An ActiveX Control is not a server-side object. It is downloaded and
executed in the client browser. The only thing you should be adding is an <OBJECT> tag to your client-side HTML.
The problem is that I'm now trying by trial and error to make use of it
and
I'm not sure of the best possible approach. In general I would expect

that I
would need to make a number of calls to the application and put the
data on
the screen.


An ActiveX Control is an application. How it works is, like any other app, entirely up to the developer who created it in the first place..
Given that, what is the general direction I should proceed in? Sorry
I can't be more specific.


Learn how ActiveX Controls work, how an <OBJECT> tag is used to embed

the ActiveX Control in the web page on the client, and how to use th <OBJECT> tag to pass parameters to the Control. Other than that, how the Control
works, I can't tell you. Only the developer of the Control could tell you that.

The following MSDN article should be useful:

http://msdn.microsoft.com/library/de...n_actxcont.asp
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
I just noticed this conversation. I'm trying to review ASP.Net in a hurry for the usual reason (sudden job :-) and I have a vague question.

In the most general sense, here is the problem. I've added an Ocx to my toolbox and put a copy on the aspx page. This ocx somehow supposdly

provides
access to a currently running application session through a COM dll.

The problem is that I'm now trying by trial and error to make use of it
and
I'm not sure of the best possible approach. In general I would expect

that I
would need to make a number of calls to the application and put the
data on
the screen.

Given that, what is the general direction I should proceed in? Sorry
I can't be more specific.

"Kevin Spencer" wrote:

> Hi Dilek,
>
> You're confusing client-side and server-side. An ActiveX control (.ocx) is a
> client-side application. It is hosted in the browser. Your HTML is

right,
> but your CodeBehind is wrong. The ONLY thing you can use CodeBehind
for with
> an ActiveX Control is to (possibly, if necessary) modify the OBJECT
tag that
> is sent to the client. The ActiveX Control is fetched by the browser
and run
> on the client, according to the OBJECT tag in the HTML on the
client. >
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
> "Dilek KARAKAYA" <di*****@yahoo.com> wrote in message
> news:O$**************@TK2MSFTNGP12.phx.gbl...
> > I must use a component in my ASP.NET project but couldn't do it. There is
> a mistake anywhere .
> > I use Microsoft Visual Studio.NET 2003
> > I'm making a new project and add MSFlexGrid to my WebForm1.aspx
> > I'm adding MSFlexGrid from Project->Add References too
> >
> > When Run this project it's give an error at WebForm1.aspx.vb at

MSFlex.Col
> = 1
> >
> > System.Runtime.InteropServices.COMException: The server threw an
> exception.
> >
> >
> > My WebForm1.aspx like this
> >
> > <%@ Page Language="vb" AutoEventWireup="false"
> Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML>
> > <HEAD>
> > <title>WebForm1</title>
> > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > <meta name="vs_defaultClientScript" content="JavaScript">
> > <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> > </HEAD>
> > <body MS_POSITIONING="GridLayout">
> > <form id="Form1" method="post" runat="server">
> >
> > <OBJECT id=MSFlex
classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30> > > <PARAM NAME="_ExtentX" VALUE="2646">
> > <PARAM NAME="_ExtentY" VALUE="1323">
> > <PARAM NAME="_Version" VALUE="393216">
> > <PARAM NAME="Rows" VALUE="2">
> > <PARAM NAME="Cols" VALUE="2">
> > <PARAM NAME="FixedRows" VALUE="1">
> > <PARAM NAME="FixedCols" VALUE="1">
> > <PARAM NAME="RowHeightMin" VALUE="0">
> > <PARAM NAME="BackColor" VALUE="-2147483643">
> > <PARAM NAME="ForeColor" VALUE="-2147483640">
> > <PARAM NAME="BackColorFixed" VALUE="-2147483633">
> > <PARAM NAME="ForeColorFixed" VALUE="-2147483630">
> > <PARAM NAME="BackColorSel" VALUE="-2147483635">
> > <PARAM NAME="ForeColorSel" VALUE="-2147483634">
> > <PARAM NAME="BackColorBkg" VALUE="8421504">
> > <PARAM NAME="GridColor" VALUE="12632256">
> > <PARAM NAME="GridColorFixed" VALUE="0">
> > <PARAM NAME="WordWrap" VALUE="0">
> > <PARAM NAME="Redraw" VALUE="-1">
> > <PARAM NAME="AllowBigSelection" VALUE="-1">
> > <PARAM NAME="ScrollTrack" VALUE="0">
> > <PARAM NAME="Enabled" VALUE="-1">
> > <PARAM NAME="RightToLeft" VALUE="0">
> > <PARAM NAME="TextStyle" VALUE="0">
> > <PARAM NAME="TextStyleFixed" VALUE="0">
> > <PARAM NAME="FocusRect" VALUE="1">
> > <PARAM NAME="HighLight" VALUE="1">
> > <PARAM NAME="FillStyle" VALUE="0">
> > <PARAM NAME="GridLines" VALUE="1">
> > <PARAM NAME="GridLinesFixed" VALUE="2">
> > <PARAM NAME="ScrollBars" VALUE="3">
> > <PARAM NAME="SelectionMode" VALUE="0">
> > <PARAM NAME="MergeCells" VALUE="0">
> > <PARAM NAME="AllowUserResizing" VALUE="0">
> > <PARAM NAME="PictureType" VALUE="0">
> > <PARAM NAME="BorderStyle" VALUE="1">
> > <PARAM NAME="Appearance" VALUE="1">
> > <PARAM NAME="MousePointer" VALUE="0">
> > <PARAM NAME="GridLineWidth" VALUE="1">
> > <PARAM NAME="FormatString" VALUE="">
> > <PARAM NAME="OLEDropMode" VALUE="0">
> > </OBJECT>
> >
> > </form>
> > </body>
> > </HTML>
> >
> >
> > And My WebForm1.aspx.vb like this
> >
> >
> > Public Class WebForm1
> > Inherits System.Web.UI.Page
> > 'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
> > #Region " Web Form Designer Generated Code "
> > 'This call is required by the Web Form Designer.
> > <System.Diagnostics.DebuggerStepThrough()> Private Sub
> InitializeComponent()
> > End Sub
> >
> > 'NOTE: The following placeholder declaration is required by the Web
> Form Designer.
> > 'Do not delete or move it.
> > Private designerPlaceholderDeclaration As System.Object
> >
> > Private Sub Page_Init(ByVal sender As System.Object, ByVal e

As > System.EventArgs) Handles MyBase.Init
> > 'CODEGEN: This method call is required by the Web Form

Designer
> > 'Do not modify it using the code editor.
> > InitializeComponent()
> > End Sub
> >
> > #End Region
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > Dim MSFlex As MSFlexGridLib.MSFlexGrid
> > MSFlex = New MSFlexGridLib.MSFlexGrid
> > MSFlex.Col = 1
> > MSFlex.Row = 1
> > MSFlex.Text = "abc"
> > End Sub
> >
> > End Class
> >
> >
> > ************************************************** ******************** > > Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> > Comprehensive, categorised, searchable collection of links to ASP & > ASP.NET resources...
>
>
>


Nov 18 '05 #7
Perhaps I shouldn't have used the word interaction. Let me rephrase this
again.

What is the most common way (Is there any common way?) to move data between
ActiveX and ASP.Net? As I look at this problem, I'm thinking along the lines
of a webform button is clicked, triggering a script function which interacts
with an outside process and generates a value. How do I get that value into
an webform control like a textbox?

"Kevin Spencer" wrote:
You don't understand. ActiveX has NOTHING to do with .Net. It runs entirely
on its own on the client browser.

An ASPX page delivers an HTML document to the client. An ActiveX Control is
just a bunch of text tags in an HTML document. Think of it as "staic HTML"
if you like. Now, there are some tricks you can do on the server side to
create the tags dynamically if needed, but all you're doing is modifying
text.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
(Ironically enough, the purpose of the ocx to pass stuff out, not in,
specifically a hook to another currently running process.)

Can you point me to a good discussion on interaction betwee OCXs and

ASP.Net
code? That other reference you gave seems to be solely focused on

ActiveX.

Thanks!

"Kevin Spencer" wrote:
> In the most general sense, here is the problem. I've added an Ocx to my > toolbox and put a copy on the aspx page. This ocx somehow supposdly
provides
> access to a currently running application session through a COM dll.

An ActiveX Control is not a server-side object. It is downloaded and
executed in the client browser. The only thing you should be adding is an <OBJECT> tag to your client-side HTML.

> The problem is that I'm now trying by trial and error to make use of it and
> I'm not sure of the best possible approach. In general I would expect
that I
> would need to make a number of calls to the application and put the data on
> the screen.

An ActiveX Control is an application. How it works is, like any other app, entirely up to the developer who created it in the first place..

> Given that, what is the general direction I should proceed in? Sorry I > can't be more specific.

Learn how ActiveX Controls work, how an <OBJECT> tag is used to embed the ActiveX Control in the web page on the client, and how to use th <OBJECT> tag to pass parameters to the Control. Other than that, how the Control
works, I can't tell you. Only the developer of the Control could tell you that.

The following MSDN article should be useful:

http://msdn.microsoft.com/library/de...n_actxcont.asp
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
> I just noticed this conversation. I'm trying to review ASP.Net in a hurry > for the usual reason (sudden job :-) and I have a vague question.
>
> In the most general sense, here is the problem. I've added an Ocx to my > toolbox and put a copy on the aspx page. This ocx somehow supposdly
provides
> access to a currently running application session through a COM dll.
>
> The problem is that I'm now trying by trial and error to make use of it and
> I'm not sure of the best possible approach. In general I would expect
that I
> would need to make a number of calls to the application and put the data on
> the screen.
>
> Given that, what is the general direction I should proceed in? Sorry I > can't be more specific.
>
> "Kevin Spencer" wrote:
>
> > Hi Dilek,
> >
> > You're confusing client-side and server-side. An ActiveX control (.ocx) is a
> > client-side application. It is hosted in the browser. Your HTML is
right,
> > but your CodeBehind is wrong. The ONLY thing you can use CodeBehind for with
> > an ActiveX Control is to (possibly, if necessary) modify the OBJECT tag that
> > is sent to the client. The ActiveX Control is fetched by the browser and run
> > on the client, according to the OBJECT tag in the HTML on the client. > >
> > --
> > HTH,
> > Kevin Spencer
> > ..Net Developer
> > Microsoft MVP
> > I get paid good money to
> > solve puzzles for a living
> >
> > "Dilek KARAKAYA" <di*****@yahoo.com> wrote in message
> > news:O$**************@TK2MSFTNGP12.phx.gbl...
> > > I must use a component in my ASP.NET project but couldn't do it. There is
> > a mistake anywhere .
> > > I use Microsoft Visual Studio.NET 2003
> > > I'm making a new project and add MSFlexGrid to my WebForm1.aspx
> > > I'm adding MSFlexGrid from Project->Add References too
> > >
> > > When Run this project it's give an error at WebForm1.aspx.vb at
MSFlex.Col
> > = 1
> > >
> > > System.Runtime.InteropServices.COMException: The server threw an
> > exception.
> > >
> > >
> > > My WebForm1.aspx like this
> > >
> > > <%@ Page Language="vb" AutoEventWireup="false"
> > Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > <HTML>
> > > <HEAD>
> > > <title>WebForm1</title>
> > > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
> > > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > > <meta name="vs_defaultClientScript" content="JavaScript">
> > > <meta name="vs_targetSchema"
> > content="http://schemas.microsoft.com/intellisense/ie5">
> > > </HEAD>
> > > <body MS_POSITIONING="GridLayout">
> > > <form id="Form1" method="post" runat="server">
> > >
> > > <OBJECT id=MSFlex classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30> > > > <PARAM NAME="_ExtentX" VALUE="2646">
> > > <PARAM NAME="_ExtentY" VALUE="1323">
> > > <PARAM NAME="_Version" VALUE="393216">
> > > <PARAM NAME="Rows" VALUE="2">
> > > <PARAM NAME="Cols" VALUE="2">
> > > <PARAM NAME="FixedRows" VALUE="1">
> > > <PARAM NAME="FixedCols" VALUE="1">
> > > <PARAM NAME="RowHeightMin" VALUE="0">
> > > <PARAM NAME="BackColor" VALUE="-2147483643">
> > > <PARAM NAME="ForeColor" VALUE="-2147483640">
> > > <PARAM NAME="BackColorFixed" VALUE="-2147483633">
> > > <PARAM NAME="ForeColorFixed" VALUE="-2147483630">
> > > <PARAM NAME="BackColorSel" VALUE="-2147483635">
> > > <PARAM NAME="ForeColorSel" VALUE="-2147483634">
> > > <PARAM NAME="BackColorBkg" VALUE="8421504">
> > > <PARAM NAME="GridColor" VALUE="12632256">
> > > <PARAM NAME="GridColorFixed" VALUE="0">
> > > <PARAM NAME="WordWrap" VALUE="0">
> > > <PARAM NAME="Redraw" VALUE="-1">
> > > <PARAM NAME="AllowBigSelection" VALUE="-1">
> > > <PARAM NAME="ScrollTrack" VALUE="0">
> > > <PARAM NAME="Enabled" VALUE="-1">
> > > <PARAM NAME="RightToLeft" VALUE="0">
> > > <PARAM NAME="TextStyle" VALUE="0">
> > > <PARAM NAME="TextStyleFixed" VALUE="0">
> > > <PARAM NAME="FocusRect" VALUE="1">
> > > <PARAM NAME="HighLight" VALUE="1">
> > > <PARAM NAME="FillStyle" VALUE="0">
> > > <PARAM NAME="GridLines" VALUE="1">
> > > <PARAM NAME="GridLinesFixed" VALUE="2">
> > > <PARAM NAME="ScrollBars" VALUE="3">
> > > <PARAM NAME="SelectionMode" VALUE="0">
> > > <PARAM NAME="MergeCells" VALUE="0">
> > > <PARAM NAME="AllowUserResizing" VALUE="0">
> > > <PARAM NAME="PictureType" VALUE="0">
> > > <PARAM NAME="BorderStyle" VALUE="1">
> > > <PARAM NAME="Appearance" VALUE="1">
> > > <PARAM NAME="MousePointer" VALUE="0">
> > > <PARAM NAME="GridLineWidth" VALUE="1">
> > > <PARAM NAME="FormatString" VALUE="">
> > > <PARAM NAME="OLEDropMode" VALUE="0">
> > > </OBJECT>
> > >
> > > </form>
> > > </body>
> > > </HTML>
> > >
> > >
> > > And My WebForm1.aspx.vb like this
> > >
> > >
> > > Public Class WebForm1
> > > Inherits System.Web.UI.Page
> > > 'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
> > > #Region " Web Form Designer Generated Code "
> > > 'This call is required by the Web Form Designer.
> > > <System.Diagnostics.DebuggerStepThrough()> Private Sub
> > InitializeComponent()
> > > End Sub
> > >
> > > 'NOTE: The following placeholder declaration is required by the Web
> > Form Designer.
> > > 'Do not delete or move it.
> > > Private designerPlaceholderDeclaration As System.Object
> > >
> > > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles MyBase.Init
> > > 'CODEGEN: This method call is required by the Web Form
Designer
> > > 'Do not modify it using the code editor.
> > > InitializeComponent()
> > > End Sub
> > >
> > > #End Region
> > >
> > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles MyBase.Load
> > > 'Put user code to initialize the page here
> > > Dim MSFlex As MSFlexGridLib.MSFlexGrid
> > > MSFlex = New MSFlexGridLib.MSFlexGrid
> > > MSFlex.Col = 1
> > > MSFlex.Row = 1
> > > MSFlex.Text = "abc"
> > > End Sub
> > >
> > > End Class
> > >
> > >
> > > ************************************************** ******************** > > > Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> > > Comprehensive, categorised, searchable collection of links to ASP & > > ASP.NET resources...
> >
> >
> >


Nov 18 '05 #8
An ActiveX Control is an application running on the client. ASP.Net is an
application running on the server. As they are both applications, there are
any number of ways they can communicate over a TCP/IP network. There is no
"most common way" for such communication to occur. It's all a matter of how
each app is built.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
Perhaps I shouldn't have used the word interaction. Let me rephrase this
again.

What is the most common way (Is there any common way?) to move data between ActiveX and ASP.Net? As I look at this problem, I'm thinking along the lines of a webform button is clicked, triggering a script function which interacts with an outside process and generates a value. How do I get that value into an webform control like a textbox?

"Kevin Spencer" wrote:
You don't understand. ActiveX has NOTHING to do with .Net. It runs entirely on its own on the client browser.

An ASPX page delivers an HTML document to the client. An ActiveX Control is just a bunch of text tags in an HTML document. Think of it as "staic HTML" if you like. Now, there are some tricks you can do on the server side to
create the tags dynamically if needed, but all you're doing is modifying
text.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
(Ironically enough, the purpose of the ocx to pass stuff out, not in,
specifically a hook to another currently running process.)

Can you point me to a good discussion on interaction betwee OCXs and

ASP.Net
code? That other reference you gave seems to be solely focused on

ActiveX.

Thanks!

"Kevin Spencer" wrote:

> > In the most general sense, here is the problem. I've added an Ocx to
my
> > toolbox and put a copy on the aspx page. This ocx somehow
supposdly > provides
> > access to a currently running application session through a COM dll. >
> An ActiveX Control is not a server-side object. It is downloaded and
> executed in the client browser. The only thing you should be adding is an
> <OBJECT> tag to your client-side HTML.
>
> > The problem is that I'm now trying by trial and error to make use
of it
> and
> > I'm not sure of the best possible approach. In general I would
expect > that I
> > would need to make a number of calls to the application and put the data
> on
> > the screen.
>
> An ActiveX Control is an application. How it works is, like any
other app,
> entirely up to the developer who created it in the first place..
>
> > Given that, what is the general direction I should proceed in?
Sorry I
> > can't be more specific.
>
> Learn how ActiveX Controls work, how an <OBJECT> tag is used to
embed the
> ActiveX Control in the web page on the client, and how to use th

<OBJECT>
> tag to pass parameters to the Control. Other than that, how the
Control > works, I can't tell you. Only the developer of the Control could tell you
> that.
>
> The following MSDN article should be useful:
>
>

http://msdn.microsoft.com/library/de...n_actxcont.asp >
> --
> HTH,
> Kevin Spencer
> ..Net Developer
> Microsoft MVP
> I get paid good money to
> solve puzzles for a living
>
>
> "B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
> news:3C**********************************@microsof t.com...
> > I just noticed this conversation. I'm trying to review ASP.Net in a hurry
> > for the usual reason (sudden job :-) and I have a vague question.
> >
> > In the most general sense, here is the problem. I've added an Ocx
to my
> > toolbox and put a copy on the aspx page. This ocx somehow
supposdly > provides
> > access to a currently running application session through a COM dll. > >
> > The problem is that I'm now trying by trial and error to make use of it
> and
> > I'm not sure of the best possible approach. In general I would
expect > that I
> > would need to make a number of calls to the application and put the data
> on
> > the screen.
> >
> > Given that, what is the general direction I should proceed in?
Sorry I
> > can't be more specific.
> >
> > "Kevin Spencer" wrote:
> >
> > > Hi Dilek,
> > >
> > > You're confusing client-side and server-side. An ActiveX control

(.ocx)
> is a
> > > client-side application. It is hosted in the browser. Your HTML
is > right,
> > > but your CodeBehind is wrong. The ONLY thing you can use CodeBehind for
> with
> > > an ActiveX Control is to (possibly, if necessary) modify the
OBJECT tag
> that
> > > is sent to the client. The ActiveX Control is fetched by the
browser and
> run
> > > on the client, according to the OBJECT tag in the HTML on the

client.
> > >
> > > --
> > > HTH,
> > > Kevin Spencer
> > > ..Net Developer
> > > Microsoft MVP
> > > I get paid good money to
> > > solve puzzles for a living
> > >
> > > "Dilek KARAKAYA" <di*****@yahoo.com> wrote in message
> > > news:O$**************@TK2MSFTNGP12.phx.gbl...
> > > > I must use a component in my ASP.NET project but couldn't do
it. There
> is
> > > a mistake anywhere .
> > > > I use Microsoft Visual Studio.NET 2003
> > > > I'm making a new project and add MSFlexGrid to my
WebForm1.aspx > > > > I'm adding MSFlexGrid from Project->Add References too
> > > >
> > > > When Run this project it's give an error at WebForm1.aspx.vb at > MSFlex.Col
> > > = 1
> > > >
> > > > System.Runtime.InteropServices.COMException: The server threw an > > > exception.
> > > >
> > > >
> > > > My WebForm1.aspx like this
> > > >
> > > > <%@ Page Language="vb" AutoEventWireup="false"
> > > Codebehind="WebForm1.aspx.vb" Inherits="geoview.WebForm1"%>
> > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > > <HTML>
> > > > <HEAD>
> > > > <title>WebForm1</title>
> > > > <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> > > > > <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
> > > > <meta name="vs_defaultClientScript" content="JavaScript">
> > > > <meta name="vs_targetSchema"
> > > content="http://schemas.microsoft.com/intellisense/ie5">
> > > > </HEAD>
> > > > <body MS_POSITIONING="GridLayout">
> > > > <form id="Form1" method="post" runat="server">
> > > >
> > > > <OBJECT id=MSFlex

classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30>
> > > > <PARAM NAME="_ExtentX" VALUE="2646">
> > > > <PARAM NAME="_ExtentY" VALUE="1323">
> > > > <PARAM NAME="_Version" VALUE="393216">
> > > > <PARAM NAME="Rows" VALUE="2">
> > > > <PARAM NAME="Cols" VALUE="2">
> > > > <PARAM NAME="FixedRows" VALUE="1">
> > > > <PARAM NAME="FixedCols" VALUE="1">
> > > > <PARAM NAME="RowHeightMin" VALUE="0">
> > > > <PARAM NAME="BackColor" VALUE="-2147483643">
> > > > <PARAM NAME="ForeColor" VALUE="-2147483640">
> > > > <PARAM NAME="BackColorFixed" VALUE="-2147483633">
> > > > <PARAM NAME="ForeColorFixed" VALUE="-2147483630">
> > > > <PARAM NAME="BackColorSel" VALUE="-2147483635">
> > > > <PARAM NAME="ForeColorSel" VALUE="-2147483634">
> > > > <PARAM NAME="BackColorBkg" VALUE="8421504">
> > > > <PARAM NAME="GridColor" VALUE="12632256">
> > > > <PARAM NAME="GridColorFixed" VALUE="0">
> > > > <PARAM NAME="WordWrap" VALUE="0">
> > > > <PARAM NAME="Redraw" VALUE="-1">
> > > > <PARAM NAME="AllowBigSelection" VALUE="-1">
> > > > <PARAM NAME="ScrollTrack" VALUE="0">
> > > > <PARAM NAME="Enabled" VALUE="-1">
> > > > <PARAM NAME="RightToLeft" VALUE="0">
> > > > <PARAM NAME="TextStyle" VALUE="0">
> > > > <PARAM NAME="TextStyleFixed" VALUE="0">
> > > > <PARAM NAME="FocusRect" VALUE="1">
> > > > <PARAM NAME="HighLight" VALUE="1">
> > > > <PARAM NAME="FillStyle" VALUE="0">
> > > > <PARAM NAME="GridLines" VALUE="1">
> > > > <PARAM NAME="GridLinesFixed" VALUE="2">
> > > > <PARAM NAME="ScrollBars" VALUE="3">
> > > > <PARAM NAME="SelectionMode" VALUE="0">
> > > > <PARAM NAME="MergeCells" VALUE="0">
> > > > <PARAM NAME="AllowUserResizing" VALUE="0">
> > > > <PARAM NAME="PictureType" VALUE="0">
> > > > <PARAM NAME="BorderStyle" VALUE="1">
> > > > <PARAM NAME="Appearance" VALUE="1">
> > > > <PARAM NAME="MousePointer" VALUE="0">
> > > > <PARAM NAME="GridLineWidth" VALUE="1">
> > > > <PARAM NAME="FormatString" VALUE="">
> > > > <PARAM NAME="OLEDropMode" VALUE="0">
> > > > </OBJECT>
> > > >
> > > > </form>
> > > > </body>
> > > > </HTML>
> > > >
> > > >
> > > > And My WebForm1.aspx.vb like this
> > > >
> > > >
> > > > Public Class WebForm1
> > > > Inherits System.Web.UI.Page
> > > > 'Protected WithEvents MSFlex As MSFlexGridLib.MSFlexGrid
> > > > #Region " Web Form Designer Generated Code "
> > > > 'This call is required by the Web Form Designer.
> > > > <System.Diagnostics.DebuggerStepThrough()> Private Sub
> > > InitializeComponent()
> > > > End Sub
> > > >
> > > > 'NOTE: The following placeholder declaration is required

by the
> Web
> > > Form Designer.
> > > > 'Do not delete or move it.
> > > > Private designerPlaceholderDeclaration As System.Object
> > > >
> > > > Private Sub Page_Init(ByVal sender As System.Object, ByVal
e As
> > > System.EventArgs) Handles MyBase.Init
> > > > 'CODEGEN: This method call is required by the Web Form
> Designer
> > > > 'Do not modify it using the code editor.
> > > > InitializeComponent()
> > > > End Sub
> > > >
> > > > #End Region
> > > >
> > > > Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As
> > > System.EventArgs) Handles MyBase.Load
> > > > 'Put user code to initialize the page here
> > > > Dim MSFlex As MSFlexGridLib.MSFlexGrid
> > > > MSFlex = New MSFlexGridLib.MSFlexGrid
> > > > MSFlex.Col = 1
> > > > MSFlex.Row = 1
> > > > MSFlex.Text = "abc"
> > > > End Sub
> > > >
> > > > End Class
> > > >
> > > >
> > > >

************************************************** ********************
> > > > Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> > > > Comprehensive, categorised, searchable collection of links to
ASP &
> > > ASP.NET resources...
> > >
> > >
> > >
>
>
>


Nov 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.