Thursday, May 17th 2012, 7:27pm UTC+2

You are not logged in.

  • Login
  • Register

Anton

Beginner

1

Sunday, October 17th 2010, 11:26pm

'As Any' doesn't work. 'ByVal' doesn't work.

Private WinApi Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long)

Any way around this? thanks.

CopyMemory host,ByVal gethostbyname(address), Len(host)

Any way around this also? thanks.

OlimilO

Intermediate

Posts: 277

Location: Germany

Occupation: software engineer

2

Monday, October 18th 2010, 10:34am

'ByVal' works really good!

Quoted

'As Any' doesn't work

As Any in VB means just push a pointer to the stack



Quoted

'ByVal' doesn't work.

NO!
It's more like: ByRef does'nt work
but yes there is a workaround please have a look at this:
How to use pointer with Jabaco



But it would be better for you to forget about the old VB-hacks with the intensive usage of CopyMemory.
Show us your code, maybe there are already any Java classes that solves your problems in another way.



good luck

OlimilO

Rate this thread
WoltLab Burning Board