|
-
Sep 20th, 2000, 06:57 AM
#1
Thread Starter
New Member
Why is it that evertime some body starts a thread, somebody else has to chip in a question and take the original thread totally off topic? If you question doesn't pertain to the original thread, post it else where. Just my 2 cents...
Anyways, In regards to my previous post on CPU Info. Is there anyway to do Inline Assembly in VB4? I want to use the CPUID asm instruction to find CPU information since the API calls are so limited, plus the asm usage would also work in Win 3.xx since this app I'm working on is 16-bit.
Benjamin Hannon
Williamsport, PA
-
Sep 20th, 2000, 09:40 AM
#2
Frenzied Member
I don't speak ASM So I'm not sure If this will work too well, but give it a go.
Declare a large Byte Array to contain your ASM Code, and write the code into it manually, (If you want the address of any particular byte use the VarPtr Function (VarPtr(MyCode(N) returns the address of the Nth member of the array)
You must write the code like a function that takes four long integer parameters and returns a long integer. Then you can call it using the Call WindowProc API
Code:
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
'And to call your ASM
retval = CallWindowProc(VarPtr(MyCode(0)), MyParam1, MyParam2, MyParam3, MyParam4)
As I say I don't speak ASM, so you might want an array of long integers or something, but That's the general Idea. I don't know if it works or not, I know you can copy memory from a procedure (using the addressof operator) into a byte array and run that, so It might work.
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
|