[HELP]Calling a Sub/Object with the Address

Posts 115 of 15 · Page 1 of 1
[HELP]Calling a Sub/Object with the Address
I have a class with of which i want to call a sub from only an pointer/address..

I have done it in C++ but i want to know how to do it in visual basic

int* MyInt = (int*) 0x95222AE5
// and to get the int it would of been *MyInt
I read and tried many different things, and I think I found the right thing.

Code:
Dim MyInt As Integer = CInt(&H95222AE5L)
' and to get the int it would of been *MyInt
You can use pointers and dereferencing in VB? O__O

Pointers (as known from C) are not supported in VB .NET. Maybe you want
to set a reference?!
Quote Originally Posted by master131 View Post
You can use pointers and dereferencing in VB? O__O
i dont kno thats why i am asking.
Simple answer = Yes/

A pointer is essentially nothing more then a value that holds the address of another value in memory.

I suggest you research Unsafe Code in VB and Pointers, Accessing values in memory is very simplistic work.
@Master: Yes, easy as pie ;]
Agree, it is very easy. But reading a full article will giving you the benefit of understanding it in VB.
Marshal class and GCHandle is the answer to everything related to memory. Marshal class is one of my favorite class that truly delivers amazing power to VB.NET.
Ok i read a page on Usinh Pointers in VB. What I dont kno is if it will work for Subs and how really will it be done.
Heres a decent article on delegates/
Code:
http://www.developerfusion.com/article/5251/delegates-in-vbnet/3/
Quote Originally Posted by wtfiwantthatname View Post
Heres a decent article on delegates/
Code:
http://www.developerfusion.com/article/5251/delegates-in-vbnet/3/
The fuck have delegates to do with this topic?

Delegates are mainly used in multithreading to avoid threads accessing GUI controls directly.

You may also just set Control.Checkforillegalcrossthreads to false and you don't need any delegates, not minding that this has nothing 2 do with this topic...
Quote Originally Posted by Blubb1337 View Post
The fuck have delegates to do with this topic?

Delegates are mainly used in multithreading to avoid threads accessing GUI controls directly.

You may also just set Control.Checkforillegalcrossthreads to false and you don't need any delegates, not minding that this has nothing 2 do with this topic...
But CheckForIllegalCrossThreadCalls will blindside you when something that HAS to be delegated fucks up and you have no idea why because it's not throwing an illegal crossthread call.
Quote Originally Posted by Jason View Post


But CheckForIllegalCrossThreadCalls will blindside you when something that HAS to be delegated fucks up and you have no idea why because it's not throwing an illegal crossthread call.
Well, this isn't thread relating at all anyway, that is my point.
You guys lost me.
Quote Originally Posted by topblast View Post
You guys lost me.
That's what happens when everyone goes off topic and spams....
Posts 115 of 15 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?