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

writing COM controls to work in ASP.NET

We have an OCX that we wrote some time ago for people to use in
VB/VC forms. Now we tried using it in an ASP.NET project to add
a web interface to our application. Problem is, we get server
errors from ASP such as the following:

[AccessViolationException: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.]
System.RuntimeType.ForwardCallToInvokeMember( ... )
ELABELINFOLib.ELabelInfoClass.set_FormatName(Strin g)
PrintPreview.Page_Load( ... )
System.Web.UI.Control.OnLoad(EventArgs e)
....
I read in MSDN Knowledge base article KB243603 (PRB: calling third
party component fails from active server pages) that some components
just don't work correctly from ASP.

What I am looking for are some guidelines as to how to modify our
control so that it does work correctly under ASP. The KB article
gives general info, but that does not tell me what I need to get
this to work correctly.

Any hints or pointers to other information would be greatly appreciated.

Neal
Dec 6 '07 #1
1 1083
it needs to be thread safe, and support mta or sta. also it will not have
access to the window or the window loop. messagebox calls will fail as they
require access to the desktop.

you also need to be carefull of accessing registery profile information, as
its running as a service.

if its a sta com object, then the page must be run in aspcompat mode.

-- bruce (sqlwork.com)
"Neal Bade" wrote:
We have an OCX that we wrote some time ago for people to use in
VB/VC forms. Now we tried using it in an ASP.NET project to add
a web interface to our application. Problem is, we get server
errors from ASP such as the following:

[AccessViolationException: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.]
System.RuntimeType.ForwardCallToInvokeMember( ... )
ELABELINFOLib.ELabelInfoClass.set_FormatName(Strin g)
PrintPreview.Page_Load( ... )
System.Web.UI.Control.OnLoad(EventArgs e)
....
I read in MSDN Knowledge base article KB243603 (PRB: calling third
party component fails from active server pages) that some components
just don't work correctly from ASP.

What I am looking for are some guidelines as to how to modify our
control so that it does work correctly under ASP. The KB article
gives general info, but that does not tell me what I need to get
this to work correctly.

Any hints or pointers to other information would be greatly appreciated.

Neal
Dec 6 '07 #2

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

Similar topics

0
by: CoreyMas | last post by:
Hello everyone, I am in a bit of a dilema trying to write an HTML <br> tag into a panel or placeholder. Here is the situation I have 4 tables that represent 4 levels of data (level4 is...
4
by: JP | last post by:
Okay - I have incorporated some of the advise I got on the first post and have gone ahead and setup a simple test project to demonstrate the trouble I am having. Any help is GREATLY appreciated: ...
5
by: Helen | last post by:
Is there a generic way to deal with html form elements in ASP.NET? A couple of the components I've written only really need to know that they're dealing with an element that has a value and can do...
2
by: philipp | last post by:
Hi I want to write a customControl, which shows a login-component containing textboxes for the username and password and a login-button. As soon as a user logs in, the textboxes and the button...
0
by: spacehopper_man | last post by:
hi - I am writing a "tab" control. - but it's losing the viewstate of the content pane when I switch between tabs. can anyone shed any light on why I'm losing ViewState based on my simple...
16
by: iwdu15 | last post by:
how can i open a file i saved and place the info into different text boxes?
10
by: cj | last post by:
I'm having a problem writing an insert command to work with a datatable. I've looked at what the sqldataadapter creates and created my insert command to look the same. I have:...
2
by: Nathan Sokalski | last post by:
I am an ASP.NET developer who would like to start learning about writing ASP.NET custom controls using VB.NET. I already have a reasonable amount of knowledge with making ASP.NET pages, and am...
2
by: | last post by:
I want to use codebehind to pass property values to a control that I've embedded INSIDE of a user control. In other words, let's say I have the following: MyPage.aspx ....with the following...
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: 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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.