473,739 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error with TreeView Control (MSCOMCTL.OCX) via COM Interop from ASP.NET and Service Pack

I have an ASP.NET (VB.NET) application that calls all VB6 COM DLL via
Interop. The DLL uses functionality contained in a Custom OCX Control
(Also VB6) that in turn contains a standard TreeView control. The
Custom OCX is not used for visual purposes, but has some functionality
that we require (hence hosting an OCX in a DLL).

Everything worked fine until we installed the latest service pack for
each respective windows operating system:
Windows 2003 Server - Service Pack 1
Windows XP - Service Pack 2
Windows 2000 Server - Service Pack 4

Now whenever our COM object attempts to load a form containing the
treeview control the COM object "dies" - by which I mean despite
error-trapping on the VB6 COM side, the application throws an exception
back on the ASP.NET side:

"Object reference not set to an instance of an object."

This occurs immediately after a successful call to the same COM
object, so it's not that the object or method or NULL.
It also appears the issue is happening outside of the error handling of
VB6 - i.e. after the Load(Object) call, but before any user-accessible
hook on the newly created form (extensive logging during debugging
shows the load is the last thing called).

This occurs on calling the Load operation of the form (either
explicitly with a Load(Object) call, or implicity by referencing a
property on the instantiated form); the instantiation of the object
containing the TreeView-hosting form is fine.

If I run my ASP.NET application under the context of the machine
Administrator account (via Impersonation) this still happens - testing
returns the security context from the VB6-side and it is Administrator
as well in this scenario. If I run a comparable VB.NET console
application (even under a less-privileged account than Admin) it works
fine.

STEPS TO REPRODUCE:
1. Create a VB6 DLL - add a form and drag a standard Microsoft TreeView
control onto the form. Name the form "frmTreeVie w".
2. Add a Class to your DLL with the following code:

Option Explicit
Private myForm As frmTreeView

Public Function StepOne() As String
On Error GoTo err1

Set myForm = New frmTreeView
StepOne = "StepOne Success"
Exit Function
err1:
StepOne = "Error in StepOne: " & Err.Number & ": " &
Err.Description
End Function

Public Function StepTwo() As String
On Error GoTo err2

Call Load(myForm)
StepTwo = "StepTwo Success"
Exit Function
err2:
StepTwo = "Error in StepTwo: " & Err.Number & ": " &
Err.Description
End Function

3. Compile and register your DLL

4. Create a simple ASP.NET application that has a COM-Interop reference
to the DLL. Add a page like:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

Dim myTree As New pceWidget.clsPc eTreeViewClass

Try
Response.Write( "StepOne: " & myTree.StepOne & "<br />")
Response.Write( "StepTwo : " & myTree.StepTwo & "<br />")
Catch ex As Exception
Response.Write( "TreeView Exception: " & ex.StackTrace & " - " &
ex.Message & "<br />")
End Try

myTree = Nothing
End Sub

5. Run the application. If you are running an OS without the above
mentioned service packs it *should* work, but will fail under any of
the SP-scenarios above. I say *should* as there are potential
situations where a Microsoft HotFix (that is now rolled-up in the SP)
causes the same behaviour.

I figure it's a security issue, but nothing as simple as the security
context of the executing app - something more inline with threading
security changes or COM - also, everything is running on the same box
(no cross-machine boundaries).

Any help will be greatly appreciated!

Thanks,
Mark

Nov 19 '05 #1
0 2486

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

Similar topics

0
7126
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 are running MSIE6.x, woth security settings set to display this control. For the life of me, I cannot figure out how such a simple control can be so sporadic in it;s showing on a page. It always downloads - it just doesn't always show. I'm...
6
4751
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
4
10372
by: What-a-Tool | last post by:
Is possible to use the windows image list for icon display in my treeview control? Would appreciate it you could point me towards a code sample or Key phrase to use in a google search. Thanks --
42
11548
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
5
8779
by: andy.g.ward | last post by:
I keep getting this when trying to create an MFC activex control in a c# windows service - anyone got any ideas what the missing module could be??? Exception thrown : System.IO.FileNotFoundException: The specified module could not be found. at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid) at System.Windows.Forms.AxHost.CreateWithoutLicense() at...
77
14432
by: Tark Siala | last post by:
hi i working with TreeView in VB6, and have good Properity Named (Key) with the Key i can goto Any Node i know hes Key. but in VB.NET i can find the Key :( please tell me where i can find the key in TreeView.Net... ----------------------------------------------- Best Regards From Tark
3
9694
by: Benny Raymond | last post by:
I get the following error message when trying to use the Excel Interop on my wife's machine however I don't get it on my own - we have the same version of Office installed - what could be the cause? ************** Exception Text ************** System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies....
8
2748
by: las | last post by:
(Originally posted to framework.aspnet.webservices, but I am casting a larger net and trying again) I am using a library supplied by a third-party vendor. Although the library has no UI, the vendor supplies it as an .OCX control. I need to utilize this library in an ASP.Net Web Service. My Web Service does not expose the OCX control's functionality directly, but utilizes the OCX for its own internal purposes.
4
4783
by: hsonny | last post by:
Hi there, I have an ASP page using the treeview control from mscomctl.ocx that was running just fine. We updated our browsers with this package ( details at http://support.microsoft.com/kb/912945/en-us) so I get "Unhandled exception at 0x275888cf in IEXPLORE.EXE: 0xC0000005: Access violation writing location 0x0000000b." The other mscomctl.ocx's controls (ListView, MonthView, ImageList...)
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9341
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9269
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9211
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8216
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6756
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6056
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4572
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.