<div dir="ltr"><div></div><div><br></div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Why not do:<br>
<br>
Private Extern TakeAndReturn(value As Integer) As Long In "liblibTest"<br></blockquote><div><br></div><div>Not sure, maybe you could in some situation read some trash along the right answer (32 bits is written to output, but 64 bits are read, what are the rest?). But most certainly the problem would arise when trying to read output, which consist of multiple variables (arrays, structures, etc). <br></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">This would be my way to do the conversion:</div><div class="gmail_quote"><br></div><div class="gmail_quote">Public Sub UnsignedIntegerToLong(X As Integer) As Long<br><br> If BTst(x, 31) = False Then<br> Return x<br> Else<br> Return CLong(BClr(x, 31)) + 2 ^ 31<br> Endif<br><br>End<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">And thus:</div><div class="gmail_quote">UnsignedIntegerToLong(-1) = 4294967295<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Note that my earlier example was one bit off (confusing!), but apparently it's not that easy to crash program with one variable.</div><div class="gmail_quote"> However, the main point still remains. Stick with correct bit number!<br><div><br></div><div><br></div><div>Jussi<br></div><div> <br></div></div><br></div></div></div>