Thread: VB Strings
View Single Post
  #1 (permalink)  
Old 09-09-2008, 06:16 PM
reniery reniery is offline
Learning Programmer
 
Join Date: May 2008
Posts: 43
Credits: 0
Rep Power: 3
reniery is on a distinguished road
Default VB Strings

I've been working in integrating my vb6 app with a scanner and have come upon a small problem. I´m using the dll´s provided by the scanner manufacturer.

Ok what i'm trying to do is pass a string variable to a dll.

This is from the sdk documentation

To set a string, use a pointer to the string.
To get the string, allocate 256 bytes of memory and
set a pointer to that memory. The string is copied
to the memory.


This I think is my problem

Code:
strTemp="test"
 ScannerPrint STRING, StrPtr(strTemp)
Using this the only thing passed to the dll is the first letter in this case ´t´.
The reason is cause strptr only returns the adress in memory of the first char in the string so how do I pass the whole string.

Help please
Reply With Quote

Sponsored Links