|
-
Feb 23rd, 2016, 07:32 AM
#16
Hyperactive Member
Re: [VB6] Call Functions By Pointer (Universall DLL Calls)
Dear Lavolpe,
Thankyou very much for the awesome reply.Now swapping works fine.
In the following test code given I want to know
1.How to differentiate between public,private members/methods.
2.If I comment Exit Do and run the code how to make it give all total members/methods without crashing.Here &H33 and &HE9 are used.How to know about this constants.
3.You said that is far more difficult and generally never needed unless attempting to call a private method that is not exposed by IDispatch.What are those private methods not exposed by IDispatch.
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
Private Sub zProbe(o As Object)
Dim nStart As Long, nAddr As Long
Dim nEntry As Long, bSig As Byte
If o Is Nothing Then Exit Sub
CopyMemory nStart, ByVal ObjPtr(o), 4&
nAddr = nStart
Do
CopyMemory nEntry, ByVal nAddr, 4&
If nEntry <> 0& Then
CopyMemory bSig, ByVal nEntry, 1&
If bSig = &H33 Or bSig = &HE9 Then ' native or pcode signature
Debug.Print "first method from vTable "; nStart; " is "; nAddr - Start
Exit Do
End If
End If
nAddr = nAddr + 4&
Loop
End Sub
regards,
jsvenu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|