Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Com Interop VB6 Dll call in asp.net application

$
0
0
Hey guys,

I've written an application that calls functions from a com dll in my asp.net application(asp.net or vb.net the issue at hand is no different for either so I picked the more active forum). After using the CreateObject method to declare a new instance of my com dll class called Primary. I then use a simple function built in to return a string of the applications path, and it works fine. The problem I'm having is when I pass 3 string arrays byref to a few of the sub routines it returns a type mismatch error. The problem is not in finding the dll, or accessing the dll, it's something to do with the byref but in these particular functions I can't think of any way the developer can rewrite those functions to return the 3 arrays because from what I've read the error definitely has to do with the ByRef tag in the arguments. I've tried making sure the application is set for x86 to access the 32-bit dll. When I try to reference the dll directly all goes well, but after I instance the dll class

Dim k as New Nelk.Primary



It crashes showing me the following error

"Unable to cast COM object of type 'NelK.PrimaryClass' to interface type 'NelK._Primary'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B565523D-FF81-4005-A88E-574B704BDAFE}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."

I'm not sure why it says NelK.PrimaryClass as it's called NelK.Primary but maybe just a typo any who the rest of the error I have searched high and low to solve and cannot even find a real clue pertaining to the conditions of my problem. Any help is really appreciated thank you.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>