Solved

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

Posted on 2003-10-29
4
211 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now