Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / You VB :Netters out there... A quick question.

Author
Message
MicroMan
21
Years of Service
User Offline
Joined: 19th Aug 2003
Location: Stockholm, Sweden
Posted: 18th Dec 2003 16:28
I did a quick and dirty hack in VB 6 to get a large chunk of data into a byte array for transmission with TCP using VarPtr, StrPtr and ObjPtr and CopyMem.

I've tried to find the answer, but the documentation only talks about the AddressOf function, which only deals with pointers to procedures and not data. Online searches have not helped either. There doesn't seem to be any explicit declaration keywords or operators for pointers either...

What I did in VB 6 was just go to the address, scan the bytes from that point and ahead to the size of the data into a byte array... So, how the hell to you coerce pointers in VB. Net?

I'm lost!

-----
They SAID that given enough time a million monkeys with typewriters could recreate the collected works of William Shakespeare... Internet sure proved them wrong.
-----
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Dec 2003 17:00
Post a snippet of the original vb6 code and I will take a look.

-RUST-

VB.NET makes me all goose-pimply!
MicroMan
21
Years of Service
User Offline
Joined: 19th Aug 2003
Location: Stockholm, Sweden
Posted: 18th Dec 2003 18:25 Edited at: 18th Dec 2003 18:41
Well, it's not a lot and it's scattered all over the place, but here's what I mean...




Microsoft has removed the varptr function. With varptr you could get at the address of the variable. How do you do that now?

Appreciate an answer.

-----
They SAID that given enough time a million monkeys with typewriters could recreate the collected works of William Shakespeare... Internet sure proved them wrong.
-----

Login to post a reply

Server time is: 2024-09-20 22:28:01
Your offset time is: 2024-09-20 22:28:01