writing COM controls to work in ASP.NET

  • Thread starter Thread starter Neal Bade
  • Start date Start date
N

Neal Bade

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(String)
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
 
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)
 
Back
Top