I've been in development for a few months on a large project. Upon upgrading to SP6 the OleInPlace module breaks. This code was from www.vbaccelerator.com
. Now this site has been down for over a month now, so now I'm either having to remove SP6 and return to SP5 or I need to find another solution.
BTW the code now breaks in the mIOleInPlaceActiveObject.b
Public Type IPAOHookStruct 'IOleInPlaceActiveObjectHo
lpVTable As Long 'VTable pointer
IPAOReal As IOleInPlaceActiveObject 'Un-AddRefed pointer for forwarding calls
TBEx As ListView 'Un-AddRefed native class pointer for making Friend calls
ThisPointer As Long
Private Function TranslateAccelerator(This As IPAOHookStruct, lpMsg As VBOleGuids.msg) As Long
Dim hRes As Long
' Check if we want to override the handling of this key code:
hRes = S_FALSE
hRes = This.TBEx.TranslateAcceler
If hRes Then
' If not pass it on to the standard UserControl TranslateAccelerator method:
hRes = This.IPAOReal.TranslateAcc
TranslateAccelerator = hRes
Basically, the TBEx is a place holder for the object that you want to take control of.
The object of the game is to make a structure that you can remove the pointer reference and point it to the object of your choice and intercept the ALT, TAB or the Accelerator keys.
The issue appears to be that the VB IDE is doing a "better" job of type checking.
Since it's declared as type ListView it's really just a placeholder.
CopyMemory takes this 4 byte region and points the form of your choice to here, and it has the member function TranslateAccelerator. Late binding. You can't change this to type Object because a Variant can't be coerced unless in a public module.
So if anyone has found a solution yet, or another way of intercepting the Accelerators it would be most helpful.