Possible Help Provider bug!

S

Samuel Dass

Hi!

I have a strange problem with connecting help file to windows forms. I am
using the helpprovider and attaching the help in the usual way via designer.

I have another popup form and whenever I open that form, the help stops
working. So, after I start my application and open the popup form, and close
it, then if I press F1 on the main form, the help does not come up (seems
like the cursor changes to busy momnetarily and then dies).

However, if I open the help file once before opening the popup form,
everything works fine (even after the popup closes). I am using COM interop
on the popup form (that may be screwing it up...)

Any ideas...? here is the code on the main form.

private System.Windows.Forms.HelpProvider helpProvider1;
this.helpProvider1 = new System.Windows.Forms.HelpProvider();
this.helpProvider1.HelpNamespace = "../Help/octogo.chm";
this.helpProvider1.SetHelpKeyword(this, "Emailpasswd.htm");
this.helpProvider1.SetHelpNavigator(this,
System.Windows.Forms.HelpNavigator.Topic);
this.helpProvider1.SetShowHelp(this, true);
Help.ShowHelp(this, helpProvider1.HelpNamespace, HelpNavigator.Topic,
this.helpProvider1.GetHelpKeyword(this));

Thanks for any pointers
 
Y

Ying-Shen Yu[MSFT]

Hi Samuel,

I did some test with the HelpProvider class on my system using the steps in
your description, however this issue could not be reproduced. In your
words, the problem only occurs if you open the pop-up form (which uses COM
Interop) before opening the help popup. I think we need first check if this
issue is related to the COM interop.

I'd like you try temporarily commentting out the COM Interop codes in your
popup form, and then try the steps again, will you meet this issue if no
COM interop involves?

If the Help popup works correctly, this issue might be caused by the COM
interop, could you give more description on the COM interop? such as what
COM component are you calling, is there any complex data marshalling when
invoking COM methods? You may use enable "break into debugger when an
exception is thrown" on "CLR exceptions" in Exception dialog ( from menu
"Debug"->"Exceptions"), it might be helpful to see if there is any internal
exception happens.

If this could not help, could you seperate this issue into a small program
and sent it to me by e-mail, so that I can help to take a look at it.

Thanks!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
S

Samuel Dass

Hi Ying-Shen Yu,

I tried as you suggested and found that commenting the COM component fixes
the helpprovider problem. So, I tried to go a little bit deeper.

The COM-Interop I have is for a program that is linked with extended MAPI.
The problem comes when you destroy the COM object (i.e. it gets disposed).
Some nasty windows exception comes. So far I am not able to catch it by
setting the debugging parameters or enabling the JIT option in vs.net (it
still says that jit is disabled). However, I noticed something
interesting...

If I keep the COM component alive thoughout my application session (i.e.
till the Application.Exit is called), everything works fine (but the
helpprovider gives problem as discussed). It only gives this error when the
COM object gets disposed. I am not sure what else to do as I looked into the
relevant usenet articles with no results. Most of the time the error does
not give me any other option except to report the problem to microsoft. The
detail windows on "Report to Microsoft" gave me the following,

AppName: offline.exe AppVer: 0.5.1.1 ModName: mspst32.dll
ModVer: 11.0.5604.0 Offset: 000034ce

Sometimes I get this error without mspst32.dll (as above), it just says
<unknown>.

I am quite sure this is an Interop problem, as I tried to run the C++ code
in a loop separately and it worked fine!.

I shall be thankful if you can tell me what else I should try.

Thanks


"Ying-Shen Yu[MSFT]" said:
Hi Samuel,

I did some test with the HelpProvider class on my system using the steps in
your description, however this issue could not be reproduced. In your
words, the problem only occurs if you open the pop-up form (which uses COM
Interop) before opening the help popup. I think we need first check if this
issue is related to the COM interop.

I'd like you try temporarily commentting out the COM Interop codes in your
popup form, and then try the steps again, will you meet this issue if no
COM interop involves?

If the Help popup works correctly, this issue might be caused by the COM
interop, could you give more description on the COM interop? such as what
COM component are you calling, is there any complex data marshalling when
invoking COM methods? You may use enable "break into debugger when an
exception is thrown" on "CLR exceptions" in Exception dialog ( from menu
"Debug"->"Exceptions"), it might be helpful to see if there is any internal
exception happens.

If this could not help, could you seperate this issue into a small program
and sent it to me by e-mail, so that I can help to take a look at it.

Thanks!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
Y

Ying-Shen Yu[MSFT]

Hi Samuel,

Thanks for your reply.
Consider this issue is probably caused by COM interop,
Could you paste some code COM interop snippet as well as the COM definition
you used in your program?

In your description, you could not catch this exception when debugging in
VS.NET IDE, then you may try executing this program in Windbg, maybe we
could see more information about this exception.

Also you may try this tool, it will enable several debug probes to help you
get more information in COM interop.
<CLR Spy>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=c7b95
5c7-231a-406c-9fa5-ad09ef3bb37f

Good Luck!
Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 

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