Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

In Line Assembler in VB6

399 views
Skip to first unread message

Peter Stephen Drage

unread,
Apr 26, 2003, 2:02:36 PM4/26/03
to
Hi

Does anyone out there know how to access ASM commands under VB6 on Win2k /
Win9x. I have a requirement to get CPU ID, Type and Speed.

I have an application written in C++ which does the job but I need to port
it to VB. I have had little success finding anything that is of any use
other than VBASM.DLL which is very old and 16bit. I would like to not have
to use external / additional dll but use something that is native to the
operating system.

Any suggestions

Regards

Peter Drage


Timo Kunze

unread,
Apr 26, 2003, 2:25:50 PM4/26/03
to
Take a look at www.vbAccelerator.com, they have some samples. If I remember
right you'll need to CopyMemory() the assembler code in hex format to the
address of a fake method.

Hope this helps.
Timo
--
www.TimoSoft-Software.de
"Peter Stephen Drage" <Peter...@caveman.co.uk> schrieb im Newsbeitrag
news:eECWi3BD...@TK2MSFTNGP11.phx.gbl...

Christian Blackburn

unread,
Apr 27, 2003, 12:24:23 AM4/27/03
to
Hi Guys,
That information is in the registry. However it may be in slightly
different locations on different versions of Windows.
On Win2K it's:
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor

Perhaps some other OS users would be willing to contribute the locations on
different platforms.
Cheers,
Christian


"Timo Kunze" <TKunz...@gmx.de> wrote in message
news:OwbwEFCD...@TK2MSFTNGP12.phx.gbl...

Peter Stephen Drage

unread,
Apr 27, 2003, 12:40:48 AM4/27/03
to
That only applies to win NT OS and not Win 9x


"Christian Blackburn" <Christian...@hotmail.com> wrote in message
news:#RxpeTHD...@TK2MSFTNGP10.phx.gbl...

sfbm

unread,
Apr 27, 2003, 9:05:22 AM4/27/03
to
On Sat, 26 Apr 2003 19:02:36 +0100, "Peter Stephen Drage"
<Peter...@caveman.co.uk> wrote:

Hi,

Check Out - TwealVB - http://www.tweakvb.com/index.html Or Check This
Devx Article ...Take Control of the Compile Process Take an in-depth
look at how VB's compiler works, view your app's object source, and
link in C or assembly... -
http://archive.devx.com/upload/registered/features/vbpj/1999/11nov99/jc1199/jc1199.asp

James

mayayana

unread,
Apr 27, 2003, 12:31:32 PM4/27/03
to
Matthew Curland covers it in Advanced Visual Basic 6
(Addison/Wesley), though I've never tried it myself.

--
--
Peter Stephen Drage <Peter...@caveman.co.uk> wrote in message
news:eECWi3BD...@TK2MSFTNGP11.phx.gbl...

Michael Culley

unread,
Apr 27, 2003, 8:44:54 PM4/27/03
to
You will need to compile the asm code outside vb, then in vb you can stick
the byte code into a byte array and call this using CallWndProc. The example
below adds 101 to the hWnd parameter and returns this value.

Option Explicit

Private 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

Private Sub Form_Load()
Dim Code(10) As Byte

'mov eax,[esp+4]
Code(0) = &H8B
Code(1) = &H44
Code(2) = &H24
Code(3) = &H4
'add eax,101
Code(4) = &H83
Code(5) = &HC0
Code(6) = 101
'ret 04
Code(7) = &HC2
Code(8) = &H14
Code(9) = 0
'MsgBox Hex$(VarPtr(Code(0)))
MsgBox CallWindowProc(VarPtr(Code(0)), 5, 0, 0, 0)
End Sub

--
Michael Culley


"Peter Stephen Drage" <Peter...@caveman.co.uk> wrote in message
news:eECWi3BD...@TK2MSFTNGP11.phx.gbl...

mariu...@gmail.com

unread,
Apr 14, 2014, 12:32:09 AM4/14/14
to
0 new messages