Link to home
Start Free TrialLog in
Avatar of skuhn
skuhn

asked on

Directly read a byte of memory using an address

I have an instrument which uses a DLL to read some data.

The DLL gives me a pointer to the location in memory.

I want to read the bytes.

The instrument actually gives 32k bytes of Data.

How do I take the pointer given by the DLL code and read the 32k bytes of data.


Avatar of cvidler
cvidler

you won't do it with VB. Try with C/Pascal
Avatar of skuhn

ASKER

Adjusted points to 140
Avatar of skuhn

ASKER

Adjusted points to 150
ASKER CERTIFIED SOLUTION
Avatar of chris_a
chris_a

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skuhn

ASKER

Thankyou very much for the answer.

I am new to visual basic and would appreciate a bit more detail.

I will try to test the answer, but a few lines of detail from you will probably save me hours.
Try something like:

####################################
Dim m_abDATA(0 to 255) as BYTE

MemCopy(m_abData, BufAddr, 256)
Debug.print m_abData(0) ' print 1st byte
####################################

I use these rotines to extract data from binary messages recieved over a serial/tcip link to VB structures, I haven't tried it with the shared memory data aquisition scheme you mention, there should be no problem except for synchronisation, do you have to obey/maintain a semaphore?

Avatar of skuhn

ASKER

Thankyou, I still have to sort out the details but I am now on track.

I searched  microsoft.com for

"RtlMoveMemory" and found more information