Solved

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

Posted on 2003-10-29
4
226 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
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
fantasy1001 earned 250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Concatenate 2 userform comboboxes to a userform text box 4 64
Excel - Save a copy of work book 13 85
Getting warning: You are about to delete 1 row(s) 9 50
TT Auto Dashboard 13 92
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

831 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