473,408 Members | 1,874 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,408 software developers and data experts.

ActiveX Cab File - How to use in C#

Short Version of Question:

Can anyone provide an example of how I should embed the ActiveX and license,
and then use it in a function?


LongerVersion:
I am attempting to convert an asp file to a asp.net file using C#.

The original file has an ActiveX control which is contained in a cab file.

The cab file contains the .ocx file which connects to a socket and transfers
client info to a server, as well as several .dlls

The cab file also references another cab file which contains files to
install on the client machine in case they do not have VBRuntime6 installed
on their machine.

We have obtained a Microsoft license for the ActiveX control.

My problem is, how to call or reference the control in my .net page. I have
researched and am doing what I have seen, but am getting errors.

The original code has the ActiveX embedded in the html like so:
<form runat="server" name="trade_entry_verify" method="post">
..
..
..
<P>
<OBJECT CLASSID="clsid:blah_blah_blah"
id="Microsoft_Licensed_Class_Manager_1_0"1 VIEWASTEXT>
<PARAM NAME="LPKPath" VALUE="NAME.lpk">
</OBJECT>
<OBJECT id=IDNAME2 height=0 width=0
classid=clsid:blah_blah_blah codeBase="CABNAME.CAB#version=1,0,0,0"
VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="873">
<PARAM NAME="_ExtentY" VALUE="847">
</OBJECT>
</P>
..
..
..
</form>


One of the functions is like so (note- : trade_entry_verify is the form
name):
<script language="vbscript">
..
..
..
function doSubmit()
trade_entry_verify.IDNAME2.CloseSocket
trade_entry_verify.IDNAME2.HostAddress = "ip.address.0.0"
trade_entry_verify.IDNAME2.Port = "portnum"
Result = trade_entry_verify.citcp2.ConnectToHost
end function
..
..
..
</script>


In my C# code, I have embedded the two objects in the html as shown above
since the examples I have found seem to do the same.

Yet, when I try to preview the page in IE, I get the following error:

Compiler Error Message: BC30451: Name 'trade_entry_verify' is not declared.

Source Error:
Line 85:
Line 86: function doSubmit()
Line 87: trade_entry_verify.CITCP2.CloseSocket
Line 88: trade_entry_verify.CITCP2.HostAddress = "ipaddressIuse"
Line 89: trade_entry_verify.CITCP2.Port = "2000"

trade_entry_verify is simply the form name, so I tried removing it and then
I get:
Compiler Error Message: BC30451: Name 'CITCP2' is not declared.

Source Error:
Line 85:
Line 86: function doSubmit()
Line 87: CITCP2.CloseSocket
Line 88: CITCP2.HostAddress = "ipaddressIuse"
Line 89: CITCP2.Port = "2000"

for this page, to get started and for testing purposes, I simply cut and
pasted the VBScript function within the script tags. Ultimately, I wish to
rewrite it as C#.

Can anyone provide an example of how I should embed the ActiveX and license,
and then use it in a function? Any help would be really, really appreciated.
Dec 1 '05 #1
1 5137
ActiveX controls with CAB files can be used in ASP.NET in the same fashion as
they are used in HTML or classic ASP.

However, they normally cannot be used as server-side objects. You will need
to script the standard HTML object tag within the ASPX page. Normally ActiveX
controls must be instantiated at the client-side. The developer will be
responsible for passing data back and forth between the server and the client
systems.

If you have an example code where the component is actually instantiated as
a COM component in server-side VBScript for example, it might be possible to
translate that to the equivalent C# code and mark the ASP.NET page with
ASPCOMPAT=true.

Hope this helps.
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Frank" wrote:
Short Version of Question:

Can anyone provide an example of how I should embed the ActiveX and license,
and then use it in a function?


LongerVersion:
I am attempting to convert an asp file to a asp.net file using C#.

The original file has an ActiveX control which is contained in a cab file.

The cab file contains the .ocx file which connects to a socket and transfers
client info to a server, as well as several .dlls

The cab file also references another cab file which contains files to
install on the client machine in case they do not have VBRuntime6 installed
on their machine.

We have obtained a Microsoft license for the ActiveX control.

My problem is, how to call or reference the control in my .net page. I have
researched and am doing what I have seen, but am getting errors.

The original code has the ActiveX embedded in the html like so:
<form runat="server" name="trade_entry_verify" method="post">
..
..
..
<P>
<OBJECT CLASSID="clsid:blah_blah_blah"
id="Microsoft_Licensed_Class_Manager_1_0"1 VIEWASTEXT>
<PARAM NAME="LPKPath" VALUE="NAME.lpk">
</OBJECT>
<OBJECT id=IDNAME2 height=0 width=0
classid=clsid:blah_blah_blah codeBase="CABNAME.CAB#version=1,0,0,0"
VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="873">
<PARAM NAME="_ExtentY" VALUE="847">
</OBJECT>
</P>
..
..
..
</form>


One of the functions is like so (note- : trade_entry_verify is the form
name):
<script language="vbscript">
..
..
..
function doSubmit()
trade_entry_verify.IDNAME2.CloseSocket
trade_entry_verify.IDNAME2.HostAddress = "ip.address.0.0"
trade_entry_verify.IDNAME2.Port = "portnum"
Result = trade_entry_verify.citcp2.ConnectToHost
end function
..
..
..
</script>


In my C# code, I have embedded the two objects in the html as shown above
since the examples I have found seem to do the same.

Yet, when I try to preview the page in IE, I get the following error:

Compiler Error Message: BC30451: Name 'trade_entry_verify' is not declared.

Source Error:
Line 85:
Line 86: function doSubmit()
Line 87: trade_entry_verify.CITCP2.CloseSocket
Line 88: trade_entry_verify.CITCP2.HostAddress = "ipaddressIuse"
Line 89: trade_entry_verify.CITCP2.Port = "2000"

trade_entry_verify is simply the form name, so I tried removing it and then
I get:
Compiler Error Message: BC30451: Name 'CITCP2' is not declared.

Source Error:
Line 85:
Line 86: function doSubmit()
Line 87: CITCP2.CloseSocket
Line 88: CITCP2.HostAddress = "ipaddressIuse"
Line 89: CITCP2.Port = "2000"

for this page, to get started and for testing purposes, I simply cut and
pasted the VBScript function within the script tags. Ultimately, I wish to
rewrite it as C#.

Can anyone provide an example of how I should embed the ActiveX and license,
and then use it in a function? Any help would be really, really appreciated.

Dec 1 '05 #2

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

Similar topics

1
by: wang xiaoyu | last post by:
Hello: i want use activex in wxpython program,but when i use MakeActiveXClass an exception occurs. this is my source code dealing the DICOM ocx.I must note that in this program "hwtxcontrol" is...
12
by: A.M. | last post by:
Hi at all, how can I do to insert into a HTML page a file .txt stored in the same directory of the server where is the html file that must display the text file.txt? Thank you very much P.Pietro
5
by: Turner | last post by:
Hi there, I'm not a flash programmer myself but I work with some of them. It seems whenever I browse to a page developped by these folks the browser receives it as if there were ActiveX content...
0
by: Ike | last post by:
I have an Activex Control created in VB6, which, displays no problem on any machine I have, but, on some machines of others, it does not. All machines are running either XP or Windows 2000, and all...
1
by: Craig | last post by:
I am having problems getting an ActiveX DLL written in VB6 to call a method in a C# class library component. My C# DLL is called CSharpProject.dll and contains a public class called CSharpClass....
21
by: Strath-Clyde | last post by:
I'm a die hard c# developer, developing win32 and web based enterprise apps for last few years. The development team I'm on is going down a path I feel is wrong. I scoping out the web to knock...
5
by: Andrew | last post by:
Hi all, I am still getting into ASP/VB.net and have a concern about something I see coming. Currently our entire website is classic ASP, yet the feelings from on high is that we need to start...
0
by: Frank | last post by:
Short Version of Question: Can anyone provide an example of how I should embed the ActiveX and license, and then use it in a function?
3
by: eusebiu | last post by:
Hello... I am developing a MFC ActiveX that I want to self register when IE promts to Install it. I have added the VALUE "OLESelfRegister", "\0" to activex's resource file (.rc) and I have...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.