Jump to content

need help getting memory address of a variable


Recommended Posts

hi gang,

In vb, if you wish to obtain the memory address of a variable,

you can use the VarPtr function.

Yes, yes, I do know that autoit doesn't have a varptr function,

but it DOES have dllcall.

The "api-way" to get the memory address of a variable is this:

Declare Function VarPtr Lib "msvbvm50.dll" (ByRef Var As Any) As Long

I can't see how to convert this to dllcall. As I understand it, it

has to be "ByRef" because you want to get the actual address of

the parameter, not the address of a copy of the parameter (i.e.,

"ByVal").

any help would be appreciated, jw

p.s. if you are tempted to "flame" me for wishing to deal with

absolute memory addresses, kindly stifle yourself. Although you

may not agree, there are legit reasons for doing this.

Link to comment
Share on other sites

hi gang,

In vb, if you wish to obtain the memory address of a variable,

you can use the VarPtr function.

Yes, yes, I do know that autoit doesn't have a varptr function,

but it DOES have dllcall.

The "api-way" to get the memory address of a variable is this:

Declare Function VarPtr Lib "msvbvm50.dll" (ByRef Var As Any) As Long

I can't see how to convert this to dllcall. As I understand it, it

has to be "ByRef" because you want to get the actual address of

the parameter, not the address of a copy of the parameter (i.e.,

"ByVal").

any help would be appreciated, jw

p.s. if you are tempted to "flame" me for wishing to deal with

absolute memory addresses, kindly stifle yourself. Although you

may not agree, there are legit reasons for doing this.

there are udf's in the scripts and scraps forum that may be of use to you for memory address interaction. Personally i don't flame anybody, but i'm not too sure how good of an idea it is to start off that defensively...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...