Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

Cannot create COM instance at runtime

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike D - 28 Nov 2006 23:25 GMT
We're developing with a third party ActiveX component in VB.NET 2005.
I am able to create instances from the component using both early and
late binding if I run from within visual studio.  However, when I build
the project and run the executable on the same machine I get an
exception.

Early binding gives the following exception during the New statement:
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.

Late binding gives the following exception during the CreateObject
call:
System.Exception: Cannot create ActiveX component.

Since I can create an instance using either method during debug mode,
it seems almost certain that this is a permission or security problem.
I've signed the assembly, signed the ClickOnce manifests, and enabled
the full trust application ClickOnce security setting.  I've even tried
setting what I believe is the corresponding DCOM config properties to
full access for Everyone in the Component Services MMC.

Just to be clear, this really is the entire code:

Module Module1
 Sub Main()
   Dim app As New Application
 End Sub
End Module

Module Module2
 Sub Main()
   Dim app As Object = CreateObject(APP_TYPE_NAME)
 End Sub
End Module

Any help would be greatly appreciated,
Mike D
Mike D - 29 Nov 2006 16:02 GMT
I believe my problem may be related to CAS somehow.  I've tried giving
both the interop type library and the assembly exe full trust minimum
permissions through the Increase Assembly Trust wizard on the .NET
Framework 2.0 Configuration runtime security page.  The result however
is the same exception.  I assume that it would be pointless to try to
give full trust to the com object dll, since the runtime security seems
to only apply to .NET managed code.

I have verified that I was wrong in my earlier assumption that I was
modifying the correct DCOM config.  The API we're using is just COM.

Again, the issue is that my code works just fine when run in the IDE,
but it crashes on creating a COM instance when the build is run.

Thanks,
Mike D

> We're developing with a third party ActiveX component in VB.NET 2005.
> I am able to create instances from the component using both early and
[quoted text clipped - 33 lines]
> Any help would be greatly appreciated,
> Mike D

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.