473,659 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.InvalidC astException: QueryInterface for interface ... erro

A VB.NET 2003 application accesses a custom VB 6 DLL. It has run successfully
several months, and has been modified without problem a few times during that
period. Recently another set of changes were made to both the VB.NET code and
the DLL. The new version was successfully installed on our production server,
and ran without problem for 2 weeks until a scheduled reboot of the server
occurred. Since the reboot, the application always fails with the following
exception messages whenever the DLL is accessed. As far as can be
ascertained, no patches or further changes were applied either to the
application or to the server between installing the application and the
subsequent reboot.

The DLL in question is CmCalclib2.DLL, and PIACE.BaCPM.Com pressor is defined
in VB.NET code.

Error: ---System.InvalidC astException: QueryInterface for interface
CmCalclib2._Com pressor failed.
at CmCalclib2.Comp ressorClass.set _Config(CMCompr essor )
at PIACE.BaCPM.Com pressor.Initial iseCompressor()
--- End of inner exception stack trace ---
at PIACE.BaCPM.Com pressor.Initial iseCompressor()
at PIACE.BaCPM.Com pressor.ACECalc ulations()

The program still runs successfully on a development server under the
debugger. There do not appear to be any security issues to prevent the DLL
being executed by the application (and in any case, no configuration changes
were made when the server was rebooted).
Dec 18 '07 #1
9 2140
Sounds like one problem with two symptoms. I would bet on someone
breaking compatibility in CmCalclib2.dll two weeks (or more) earlier,
but it did not become evident on the server until the reboot because
the old version was cached.

Check your new CmCalclib2.dll interface GUIDs, make sure they match
the old version. If they don't, go back and recompile CmCalclib2.dll
with binary compatibility and redeploy, reboot.

If you don't care about maintaining compatibility, (no other
application is using CmCalclib2.dll) , just unreference and rereference
CmCalclib2.dll in your VB.NET project references.
Dec 18 '07 #2
You are right - the change to CmCalclib2.dll did break binary compatibility.
The application in question is the only application to use it. I have already
unreferenced and rereferenced the DLL and rebuilt and reregistered the DLL,
and rebuilt and reinstalled the VB.NET project, more than once in an attempt
to fix it, but it hasn't helped. (The production server has not been rebooted
again - but you don't appear to say that rebooting is necessary if
compatibility doesn't have to be maintained.)
Dec 18 '07 #3
D,

Option strict is set to on in the top of your code?

Cor

"D Jarvie" <ja***@newsgrou p.nospamschreef in bericht
news:19******** *************** ***********@mic rosoft.com...
>A VB.NET 2003 application accesses a custom VB 6 DLL. It has run
successfully
several months, and has been modified without problem a few times during
that
period. Recently another set of changes were made to both the VB.NET code
and
the DLL. The new version was successfully installed on our production
server,
and ran without problem for 2 weeks until a scheduled reboot of the server
occurred. Since the reboot, the application always fails with the
following
exception messages whenever the DLL is accessed. As far as can be
ascertained, no patches or further changes were applied either to the
application or to the server between installing the application and the
subsequent reboot.

The DLL in question is CmCalclib2.DLL, and PIACE.BaCPM.Com pressor is
defined
in VB.NET code.

Error: ---System.InvalidC astException: QueryInterface for interface
CmCalclib2._Com pressor failed.
at CmCalclib2.Comp ressorClass.set _Config(CMCompr essor )
at PIACE.BaCPM.Com pressor.Initial iseCompressor()
--- End of inner exception stack trace ---
at PIACE.BaCPM.Com pressor.Initial iseCompressor()
at PIACE.BaCPM.Com pressor.ACECalc ulations()

The program still runs successfully on a development server under the
debugger. There do not appear to be any security issues to prevent the DLL
being executed by the application (and in any case, no configuration
changes
were made when the server was rebooted).
Dec 18 '07 #4
Option Strict is set to on. I also saw some comments on the internet about
turning it off, so I tried that as well, but it didn't help.
Dec 18 '07 #5
D,

That it does succesful run in the debugger does not mean that everything is
correct.

Did you already set the references again to be sure that you are actually
pointing to the same DLL/s

Cor

Dec 19 '07 #6
It would need to be rebooted, for the same reason the problem did not
show up for 2 weeks after your changes. The previous CmCalclib2.dll
is still in cache despite you copying a new version to the server.

On Tue, 18 Dec 2007 09:36:09 -0800, D Jarvie <ja***@newsgrou p.nospam>
wrote:
>You are right - the change to CmCalclib2.dll did break binary compatibility.
The application in question is the only application to use it. I have already
unreferenced and rereferenced the DLL and rebuilt and reregistered the DLL,
and rebuilt and reinstalled the VB.NET project, more than once in an attempt
to fix it, but it hasn't helped. (The production server has not been rebooted
again - but you don't appear to say that rebooting is necessary if
compatibilit y doesn't have to be maintained.)
Dec 19 '07 #7
Hi,

You may also check the interop assembly (generated by Visual Studio when
you add reference to a COM component and copied to your output directory),
it contains the interface ID of your COM component. You can use Reflector
(http://www.aisto.com/roeder/dotnet/) to open it and check if the GUIDs are
correct. You can use Oleview to view your VB6 COM component to determine
correct GUIDs.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 19 '07 #8
"Grok" wrote:
It would need to be rebooted, for the same reason the problem did not
show up for 2 weeks after your changes. The previous CmCalclib2.dll
is still in cache despite you copying a new version to the server.
Is there no way to update the cache other than rebooting? Rebooting the
production server has implications for other processes, and is not something
which can be done lightly.
Dec 19 '07 #9
Yes. You need to unload the process which loaded CmCalclib2.dll.

You can use Process Explorer from SysInternals to locate which process
has it loaded. If as you say only one process uses it, just exit
that. If that one process is a website on IIS5 or IIS6, and your IIS
is configured for separate application spaces, simply unload that
website. I think you're out of luck if it's IIS4, you'll have to stop
IIS and restart. But server does not require rebooting.

In any event, End Process will do the trick in Process Explorer. Once
the process using CmCalclib2.dll is unloaded, you can start it back up
and it should grab the new, correctly-referenced version.

On Wed, 19 Dec 2007 03:23:02 -0800, D Jarvie <ja***@newsgrou p.nospam>
wrote:
>"Grok" wrote:
>It would need to be rebooted, for the same reason the problem did not
show up for 2 weeks after your changes. The previous CmCalclib2.dll
is still in cache despite you copying a new version to the server.

Is there no way to update the cache other than rebooting? Rebooting the
production server has implications for other processes, and is not something
which can be done lightly.
Dec 19 '07 #10

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

Similar topics

1
4528
by: Peter Sparago | last post by:
I am working with the MSHTML editor control. I used win32com.client.gencache.EnsureModule on the MSHTML type library to generate the necessary IDispatch support for all the various interfaces used by MSHTML. I have just implemented some of the necessary custom COM interfaces/gateways to allow me to take control of MSHTML's right-click menu. One of the callbacks that MSHTML makes (and I've implemented) is
0
417
by: Jason | last post by:
I'm writing a small console app in .NET that needs to reference a 3rd party dll. I wrote the app by adding a reference to the 3rd party dll in my project and my code builds and executes perfectly. However, when I made a setup file and installed it on another box, I get: System.InvalidCastException: QueryInterface for interface...Failed. when the console app tires to reference the dll. I can see that the
7
4708
by: Julien | last post by:
Hi !!! I hav a problem when I try to initialize my workbook (opening or creation) in my windows form... I got the Exception 'System.InvalidCastException' : QueryInterface for interface Excel._Application failed I tried to change de CultureInfo but it doesn't work better.
4
4912
by: Ram | last post by:
I am running a test web site on my own Win2k professional computer. I have a VB6 COM component (running on COM+) on a seperate application runnint as "Server". When running an ASP.NET page calling this component, it works fine, but When I try and debug the Com+ process using the VB6.0 IDE, I get the following error: "Exception Details: System.InvalidCastException: QueryInterface for interface MyObject._MyCls failed." When I the same...
0
1104
by: Michal | last post by:
Hi. I've been searching all over the internet, and I didn't find solution of my problem :( I hope someone can help me here... The problem is: Im writing a library in C# (COM Library). This library will be used by an application, which is wrote in VB6. I will call it "MainApp".
1
1323
by: adiel_g | last post by:
Hello, I have created a activeX dll in vb6 that contains some functions I am using in .NET. I created the dll in vb6 with: Instancing = 5-Multiuse MTSTransactionMode = 2-RequiresTransaction Persistable = 0-NotPersistable I then created a COM+ application, set the user to an admin in the COM+ settings and added the dll above as a component. Then from ASP.NET, I added a reference to the dll created above. Everything was fine (on my
2
4720
by: Michael | last post by:
Hello all and thanks in advance, I'm running a vb.net program and part of it copies files from one server to another. It generally works fine but once in a while I get this error: System.InvalidCastException: QueryInterface for interface Scripting.IFileSystem3 failed.
5
1477
by: Geoff Kell (Lockdesign Ltd) | last post by:
I have just started using VB.Net and I am developing a class to provide data to clients from an IBM-MQ queue. I have developed a class which connects to the queue and issues a read. When a message comes in an event is raised back to the client containing (at the moment) only the message id. This all works fine but the MQ read call blocks and prevents other processing. To overcome this I have created the object and then start the...
6
4080
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible, having been advised by several luminaries that that is a "good thing to do"... :-) However, I'm experiencing a problem with the IEnumerable interface. (N.B. I understand fully that I should be using the LDAP provider instead of the WinNT provider...
0
8427
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
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
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
7356
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
6179
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
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.