• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 348
  • Last Modified:

Has Anyone Found out how to compile the pJournalRecordHook project code from vbAccelerator?

I get a type mismatch compile error in the frmJournalRecordHook Load Event

Private Sub Form_Load()
   enableUIControls False
   InstallHook Me, WH_JOURNALRECORD
End Sub

This calls GHook.InstallHook

Public Function InstallHook( _
      ByVal IHook As IWindowsHook, _
      ByVal eType As EHTHookTypeConstants _
   ) As Boolean
   InstallHook = mWindowsHook.InstallHook(IHook, eType)
End Function

The user defined type, IWindowsHook is not found anywhere in the project.
Although my guess is that it should be defined in the IWindowsHook.cls module.

What do I need to do?
0
Dovberman
Asked:
Dovberman
1 Solution
 
OHDev2004Commented:
Hello ...

This Link may be Usefull to you:[VBAccelerator.com]
http://www.vbaccelerator.com/home/VB/Code/Libraries/Hooks/vbAccelerator_Hook_Library/VB6_Windows_Hook_Library_Full_Source_zip_IWindowsHook_cls.asp


Download the Project and It Includes a Sample of how to Implement a Hook Operation ...

Can you tell us What exactly do you want to hook ?
OHDev2004
0
 
DovbermanAuthor Commented:
My question stems from trying to compile the downloaded source code from the referenced link.

The project is full of omissions that cause compile errors.

I fixed several of them. See my other open question about vbAccelerator.

I EMailed vbAccelerator but have not yet received a reply.

Has anyone found out how to fix this specific compile error ?

0
 
DreamMasterCommented:
Implements IWindowsHook

Have you used that line yet?

Example:

Implements IWindowsHook
 
Private Const WM_USER = &H400
 
Private Sub Form_Load()
  InstallHook Me, WH_GETMESSAGE
End Sub
 
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  RemoveHook Me, WH_GETMESSAGE
End Sub
 
'After the hook is installed, the IWindowsHook_HookProc function will be called
'each time a Windows Message is received.
'This function exists because we are implementing IWindowsHook
 
Private Function IWindowsHook_HookProc(ByVal eType As EHTHookTypeConstants,_
                                       ByVal nCode As Long, ByVal wParam As Long,_
                                       ByVal lParam As Long, bConsume As Boolean) As Long
 
Dim Msg As Long
 
Msg = GetMsglParam(lParam).Message
 
If Msg = (WM_USER + 10) Then
    'Call GetNextMessage to process the received Meedio Message
End If
 
End Function

Regards,
Max.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DovbermanAuthor Commented:
The suggestions are probably correct.

My issue is that none of your suggested code is in the downloaded pJournalRecordHook project source example.

I am trying to get the example to work as is.  I should not need to re-write what should be a working example.

Thanks,
0
 
DreamMasterCommented:
Only thing you can do is check if my suggestion works...if so, there is something you are missing...

Regards,
Max.
0
 
EDDYKTCommented:
I use the above link

and i can download the zip file

http://www.vbaccelerator.com/home/VB/Code/Libraries/Hooks/vbAccelerator_Hook_Library/VB6_Windows_Hook_Library_Full_Source.zip

and i don't have problem to compile
0
 
DovbermanAuthor Commented:
Perfect.  This project compiles without errors.

Thank you.
0
 
DovbermanAuthor Commented:
To EDDYKT

Sorry,  This is not the download that would not compile.

This is the one that is full of errors.

http://www.vbaccelerator.com/home/VB/Code/Libraries/Hooks/Journal_Record_Hooks/VB6_Journal_Record_Hook_Sample.asp
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now