I've been looking my self on how to do this. But all the codes are vb6 code sad.gif

So there is no vb.net pointers and hence all the marshal thingy.

Let me try to understand.

In vb6 there is no pointer either, but there is a reference, which is a pointer automatically dereferenced. So by putting the variable to the API it's as good as inputting the address of the pointer.

Hmm.... Why can't we do the same thing for vb.net and change "as any" to "as object"

Let's take a look at this:
BOOL InternetSetOption(
__in HINTERNET hInternet,
__in DWORD dwOption,
__in LPVOID lpBuffer,
__in DWORD dwBufferLength
);


So we need to insert pointer right?

My understanding is, instead of putting the address of a variable using & in C++, in vb, we insert the variable name straight.

Then we understand that reference is a pointer that's automatically dereferenced.

If that's the case, why can't we just declare lpBuffer as object? Why this sample http://www.dreamincode.net/forums/in...4&#entry845624 must use marshall thingy