Problem when i am accessing ActiveX DLL from VB.NET - vb.net

Good morning.
I have to access the active x dll which is installed on my system from VB.net.
I added as reference and followed all the steps as given in
I have declared
private mycomponent as activexcomponent.libclass
and i gave constructor for this i.e. creating the object for this class in the constructor of the main form as
mycomponet = new activexcomponent.libclass()
Then the following expection is coming when i tried to run the program.
System.InvalidOperationException: An
error occurred creating the form. See
Exception.InnerException for details.
The error is: Creating an instance of
the COM component with CLSID
{D8A27DFF-A4B8-440E-8571-71A37D39403E}
from the IClassFactory failed due to
the following error: 800a0196. --->
System.Runtime.InteropServices.COMException:
Creating an instance of the COM
component with CLSID
{D8A27DFF-A4B8-440E-8571-71A37D39403E}
from the IClassFactory failed due to
the following error: 800a0196.
I have registered the activex dll. I tried my best to figure out the problem but could not succeed in this.
Please can any one help me out?
Thanks a lot.

As far as I know, that's not a standard HRESULT so you should really read the documentation or contact the developers of the ActiveX control to find out from them what it means. However, I did find comments that for some control it meant that it needs to be shown as modal, so you could try making the form modal (show it using ShowDialog) and see if that makes any difference.

Related

How do I find out what called my shared function

I have a function in vb.net that is shared. At one point it throws an error that says an 'open datareader already exists'. But this function is called from several different places in the program. How can I find out which part of the program called the function when it errors out?
You go to the Debug menu, show the Exceptions window, put a tick next to CLR exceptions and then run your program until it errors. As soon as the exception is raised VS will break, you will be able to see the call stack, and find out where the code was before. Note that this causes VS to stop on every exception, handled or not; it can become tedious to get to where you want to be - untick the "always break when this type of exception is thrown" in the exception helper if you just keep getting irrelevant exceptions breaking before this error you're trying to chase
It sounds like you're perhaps not creating/disposing of your DB access resources properly, especially if this is a static/shared context. Are you trying to reuse one DB connection? It wouldn't hurt to post the code of the faulting module

Failure in creation of feature class: Unable to create object class extension COM component

I am working with ArcGIS 10.5, installed on-premise, and are developing our feature class in .NET.
I have an issue with registering feature classes. We have created a Feature Class and registered the DLL through “ESRIRegAsm.exe”, and it appears in ArcCatalog:
Trigger appearing image
But when I try to create the Feature Class, I get the following error:
Failed to create feature class. Unable to create object class extension COM Component
Which isn't very helpful, unfortunately.
The odd thing is, that we have another trigger registered on another Feature Class, that works as expected. And the new trigger is based on a copy of the old trigger's code (with changed GUID's).
The steps I have done so far:
I have tried to add the feature class to the component category using categories.exe.
Registered it using ESRIRegAsm.exe for both Desktop and Engine.
Checked that there are .ecfg config files - and there are.
Checked that the CLSID's appear in the windows registry.
The essential parts of our trigger source-code can be found here: here.
Any help would be greatly appreciated, as we are stuck on this.
Our issue was that our ID's were wrong in the code.
The ClassExtensionCLSID should return the same ID as TriggerExtension has.
Moreover, InstanceCLSID should always return 52353152-891A-11D0-BEC6-00805F7C4268, and should hence not get a new ID.

Tracking COM object error in application

I was using an application and it was working perfect. After some months of not using it, I tried to run it and it doesn't work. It shows a message box saying that it cannot instance a COM object.
Do any know how to track errors in COM objects?
You can use ProcessMonitor and try to find the registry key that may be incorrect.
The other option is to use http://www.moduleanalyzer.com, it intercepts CoCreateInstance showing all created COM objects and the return values.
Run Depends tool on COM object DLL to verify it has all the necessary dlls, re-register the COM dll/exe.
Any HRESULTS from debugging/logs? Any changes in apartment models?
You cannot change the apartment type once you've set one. So if the object cannot use one of the models and you try to CoCreate it, it will fail. That's why you never call CoInit from inside DLL main thread.

MSSOAP30 Object error: 0x80004002: Interface does not exist (VB)

I'm well and truly stuck with MS SOAP 3.0, which I'm currently running from VBA Excel in Office 2003. I have used MS SOAP Toolkit 3 to create a proxy class which I am using. If I don't use it, I don't get the error, but then I'd have to write out the entire proxy class by hand and it's massive.
When my program is first run, I get "Class not registered". If I run it again I get "Interface not supported". The error messge is:
run-time error: '-2147467262'
SoapMapper: The SoapMapper for element
callContextIn could not be created
HRESULT=0x80004002: No such interface
supported.
-WSDLOperation:Initialisation of a SoapMapper for operation getSNFormat
HRESULT=0x80004002: No such interfce
supported.
The error occurs when:
Set sc_PartService = New SoapClient30
Help would be greatly appreciated.
Thanks
Just now I deleted "Set", got an error of course, put it back and it ran properly. Once. Not again, and I've been unable to recreate this. Never encountered anything like that before!
HAve you checked if the COM object exists / is registered?

How to Instantiate ObjectFrame in VB.NET

I am trying to reach methods and properties of ObjectFrame through vb.net.
But when I declared this as
Dim objOLEObject As ObjectFrame
and then trying to instantiate it as
ObjOLEObject = New ObjectFrame
it shows error like:
"429: Retriveing the COM class factory for component with CLSID {3806e95d-e47c-11-cd-8701-00aa003f0f7} failed due to the following error: 80040154"
To resolve this we re-installed both MS-Office 2003 and VS-2005, but could not get the solution.
Could anyone suggest me how to declare and use this in vb.net?
Thanks.
Make sure the dll has been registered using regsvr32. Verify by looking in the registry for the CLSID.
Make sure all dependant dll's are available.
I believe this is a class not registered error.
Adding to what Josh is saying, have you checked that all the dependency files are present?
This thread might help.
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/88a6ea68-f476-4231-822f-27fabe59f458/