?
Solved

MDIforms: Couldnt load CHM help in some forms (Urgent)

Posted on 2003-10-29
4
Medium Priority
?
252 Views
Last Modified: 2010-05-03
I have my program @ www.geocities.com/saiseng84/myCoding.zip
Can you guys take a look what happened to my program?
my program couldnt load the chm help file after login
some forms can but some forms couldnt load the chm help.

Username Pswd
- admin abc123
- user abc123

thanks.
saiseng
0
Comment
Question by:SaiSeng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
fantasy1001 earned 1000 total points
ID: 9648057
There are problem with the sendkey method, you api:

Add this declaration on top of your mdiform code
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Change this sub

Private Sub mnHelpManual_Click()
'    SendKeys ("{F1}")
    keybd_event 112, 0, 0, 0
    keybd_event 112, 0, &H2, 0
End Sub

I have test it out and it works fine at my computer.

Thanks
Fantasy
0
 

Author Comment

by:SaiSeng
ID: 9648911
~ weird things happened after apply the solution given by Fantasy,
it works but the following situation happened to me, does it to you??? ~
[01]
after user have run the application, then close the product view THEN
   click help button OR "F1"
   the help file doesnt show straight away, user will have to click on the help button again
   then only shows the help file

[02]
IF
login as user
AND straight away click the help
OR   click "delete order" button
OR   click "my profile" button
THEN
   click help button OR "F1"
   the help file doesnt show straight away, user will have to click on the help button again
   then only shows the help file
END IF

[03]
IF
login as admin
AND straight away click the help
OR   click "customer maintenance" all sub buttons
OR   click "ordermaintenance > new order & delete order" button
OR   click "product maintenance" all sub buttons
OR   click "change password" button
THEN
   click help button OR "F1"
   the help file doesnt show straight away, user will have to click on the help button again
   then only shows the help file
END IF


Thanks Fantasy ;P
0
 
LVL 5

Expert Comment

by:fantasy1001
ID: 9648985
Donn't use keybd_event, try to open the chm directly,

add this line to the top of the code
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

add this line
Private Sub mnHelpManual_Click()
    Dim ret As Long
    ret = ShellExecute(Me.hwnd, vbNullString, App.HelpFile, vbNullString, App.Path, 1)
end sub

Thanks,
~ fantasy ~
0
 

Author Comment

by:SaiSeng
ID: 9650629
YES!!! done.. thanks Fantasy. ;P
it works!!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question