mfc >> New Issue with using HtmlHelp

by aarya » Tue, 28 Mar 2006 19:06:46 GMT

Hi All,
I am launching a .chm file for Help using HtmlHelp().Now I
want the Help file to be closed whenever the dialog is closed by
pressing OK & CANCEL buttons.

So I am closing the Help file using the following code in both OnOk() &
OnCancel() functions-

if((NULL != m_hHelpWnd) && IsWindow(m_hHelpWnd))
{
HtmlHelp(NULL,NULL,HH_CLOSE_ALL,0);
}
m_hHelpWnd is the handle of the help file.

But the issue is,when the Help file is open,if I press the buttons it
is closing the help file, but if the Help file is not launched at all
and if I press Ok or cancel buttons there is a time lag.

Any other ideas to close the help file explicitly so that there will
not be any delay when Help is not at all invoked.

Note: I ve already used ::SendMessage(hHelpWnd, WM_CLOSE, 0, 0);
.....it is giving rise to some crashes.

Thanks in advance



Similar Threads

1. HtmlHelp() causing HtmlHelp.h and HtmlHelp.lib Linker Error Frustration

2. open .chm using HTMLHelp() from VC++VS2005 - HIDE Table of content

Hi All,

how could I launch/open a .chm file from my app(VC++ - VS2005), where in the 
.chm has to open by default without any TOC(table of contents) in the .chm.

In detail,I am using 

::HtmlHelp(GetSafeHwnd(), sFileName, HH_DISPLAY_TOPIC,0); 

where sFileName is the path including the .chm file name.
Now, when i execute the above piece of code I am getting .chm launched but 
with EXPANDED TOC, which i dont require for my functionality.

Can any one suggest, How by default the TOC can be hidden and the .chm can 
be launched ??

I mean currently HIDE, BACKWARD,FORWARD, PRINT are the Menu items that come 
for the .chm, how could one change that to SHOW, BACKWARD, FORWARD, PRINT 
menus in the .chm by default ?
-- 
Thanks in advance,
Shankar G.

3. Using existing object when using New? - CSharp/C#

4. New to Delegates. Having Issues

I have not used Delegates before and I am having trouble using them in my 
app.  Here is what I am doing.

1.	I have created a C# InterOp Dll that I make calls to, that in turn calls 
methods in a 3rd party WIN32 API dll.  My InterOp complies fine with no 
errors.  Here is the lines of code where I use my Delegate in my InterOp:
a.	public delegate int CallbackFunction([MarshalAs(UnmanagedType.LPWStr)] 
string reason, [MarshalAs(UnmanagedType.LPWStr)] string phoneNumber, 
[MarshalAs(UnmanagedType.LPWStr)] string columnNames, 
[MarshalAs(UnmanagedType.LPWStr)] string fieldValues);
            
b.	[DllImport(DLLName, EntryPoint = "Logon", CallingConvention = 
CallingConvention.Cdecl, CharSet = CharSet.Auto, SetLastError = true)]
c.	public static extern int Logon(string agentID, string stationID, 
[MarshalAs(UnmanagedType.FunctionPtr)] CallbackFunction callbackFunction);

2.	I have a VB.net App which I have added my C# InterOp reference to.  Here 
is the code snippet of the Function in my VB.net App that uses my InterOp:
a.	    Private Sub cmdLogon_Click(ByVal eventSender As System.Object, ByVal 
eventArgs As System.EventArgs) Handles cmdLogon.Click

b.	        Dim CallBack As Interop.pinvoke.CallbackFunction
		
c.	        agentIDString = TextAgentID.Text
d.	        stationIDString = TextStationID.Text

e.	        CallBack = AddressOf CallBackfunction
f.	        currentResultInteger = Interop.pinvoke.Logon(agentIDString, 
stationIDString, CallBack)

g.	    End Sub


Can anyone show me what I am doing wrong and how to correct the following 
error when I click the cmdLogon button:

CallbackOnCollectedDelegate was detected
Message: A callback was made on a garbage collected delegate of type 
'Interop.!Interop.pinvoke+CallbackFunction::Invoke'. This may cause 
application crashes, corruption and data loss. When passing delegates to 
unmanaged code, they must be kept alive by the managed application until it 
is guaranteed that they will never be called.

I sure it something obvious that I am blind to that I am not seeing at 
the moment.

Thanks,

5. New to Delegates. Having Issues - CSharp/C#

6. issue with the new VC .NET #import for smart pointers

OK.  this is my second issue with the new VC .NET #import for smart pointers.

for the following declaration in an ODL

dispinterface IFoo
{
methods:
 [id(1)] IDispatch* GetFoo2();
}

dispinterface IFoo2
{
}

I get in VC 6 these wrappers:
_COM_SMARTPTR_TYPEDEF(IFoo, __uuidof(IDispatch));
_COM_SMARTPTR_TYPEDEF(IFoo2, __uuidof(IDispatch));

in VC 7 I get
_COM_SMARTPTR_TYPEDEF(IFoo, __uuidof(IFoo));
_COM_SMARTPTR_TYPEDEF(IFoo2, __uuidof(IFoo2));

The problem is that I am having difficulting utilizing the generated 
wrappers because IFoo2 is not returned what is returned is IDispatch.  I know 
I can access these without the wrappers but that just seems stupid.  Probably 
I need to make a minor modifications on how I use the smart pointer but I am 
at a loss for what that would be.


Any help or insight would be appreciated.

- BAZ

 
 
 
    

7. new - delete issue

8. Post Frankfurt mailing and new core and library issues lists available