Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie Question about pointers..
#1
I can't make this work... please help
Code:
'$INCLUDE:'Win\kernel32.bi'

dim shared hcom as integer
dim shared rx(1 to 91) as ubyte ,prx as ubyte ptr,lrx
dim shared tx(1 to 91) as ubyte ,ptx as ubyte ptr,ltx
.
.
hcom=open_com_1  
.
.
.
fill_tx
ltx=91
ptx=@tx(1)
rawprint ptx,ltx                                <<this call to rawprint works
fsuccess=WriteFile(hcom, ptx ,ltx,num,byval 0)
.
.

prx=@rx(1)                      
fsuccess=Readfile(hcom,prx,91,lrx,byval 0)
rawprint prx,lrx                                <<this call to rawprint  
                                                  returns only lf lrx=0  
.
.
close_com_1
end
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sub rawprint (byval ptt as ubyte ptr,byval l)
dim i,ptx as ubyte ptr,a
ptx=ptt-1
for i=1 to l
   ptx=ptx+1
   print a,ptx
   a=*ptx       <<<< the second call to rawprint breaks here
next
end sub
Antoni
Reply
#2
Code:
for i = l to l
?
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#3
I solved my problem passing prx by value to ReadFile. Guess why...
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)