MSMQ trigger app causes exception

S

SunshineGirl

I'm trying to trigger an app with the following code from a message queue. It works with only the message box voilà! enabled. But it causes the exception below when it is triggered with the rest of the code. This application works fine when executed by double-clicking on the filename in Explorer. Any ideas?


public MonitorForm()
{
InitializeComponent();
try
{
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
//MessageBox.Show("Voilà!");
foreach(SHDocVw.InternetExplorer ie in shellWindows)
{
//MessageBox.Show("ie.Location:" + ie.LocationURL);
ie.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(MonitorForm.ie_BeforeNavigate2);
}
}
catch(Exception exception)
{
MessageBox.Show("InternetExplorerMonitor.exe exception.Message:" + exception.Message);
}
}

static public void ie_BeforeNavigate2(object disp, ref object url, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
{
MessageBox.Show("BeforeNavigate2: " + url.ToString());
}

Exception:
COM object with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is either not valid or not registered.

Thank you.
 
T

Tian Min Huang

Hello,

Thanks for your post. As I understand, the problem you are facing is that
your application does not work properly when started from a MSMQ trigger.
Please correct me if there is any misunderstanding. I think more
information is needed before moving forward:

1. Does the problem occur when it is not started from a MSMQ trigger?

2. What's the operating system of your machine, Windows 2000 or Windows
Server 2003?

3. Please go to "Control Panel" -> "Administrative Tools" -> "Services",
open the property page of the service "Message Queuing Triggers", select
the "Log On" panel, and check if its "Log on as" is set to "Local System
account" with "Allow service to interact with desktop".

I look forward to your response.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
S

SunshineGirl

Thanks for your reply.

1. The problem doesn't occur when the application is not started from an
MSMQ trigger.
2. OS: Windows 2000 SP4.
3. The service Message Queing Triggers is set to log on as Local System and
"Allow service to interact with desktop" is checked.
 
T

Tian Min Huang

Hi,

Thanks for your response. I am performing research on my side and will
update you with my information.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
T

Tam

Hi,
Based on the error message it seems you are invoking a COM Component from
the MSMQ Trigger Service. Can you confirm if this article applies to your
COM Component
http://support.microsoft.com/?id=257289

Also can you confirm that enabling the Messages Box Resolves your Issue and
you don't see any error messages?

Thanks,

Gautam
Microsoft Corporation

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

SunshineGirl

The guid mentioned in the exception message belongs to Internet Explorer,
which exposes the IDispatch interface and therefore it should work from a
trigger.

Enabling the message box does not solve the problem.

Thanks.
 
T

Tam

Hi,
Please confirm if you can Invoke other COM Components? I an trying to
isolate the issue to this particulr com Component or to any other component
in general.
Also What is the version of trigger service that you are running. Verify
the version info for trigobj.dll

Thanks,

Gautam

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

SunshineGirl

It works when invoking other COM components.
For example, I can do the following:
Word.Application app = new Word.ApplicationClass();
app.Visible = true;

The line that generates the exception is: static private
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();

I can't find trigobj.dll, but trigserv.exe is at version 1.1.0.23.

Thanks.
 
T

Tam

Hi,
I recommend that you open a Support Incident with Microsoft Support. This
is not a known issue and not something that we can troubleshoot via news
groups since it requires more detailed troubleshooting.

Thanks,

Gautam

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top