getSingle関数の使い方?

返信する


答えを正確に入力してください。答えられるかどうかでスパムボットか否かを判定します。

BBCode: ON
[img]: ON
[url]: ON
スマイリー: OFF

トピックのレビュー
   

展開ビュー トピックのレビュー: getSingle関数の使い方?

by konisi » 2008年7月11日(金) 19:39

バグですね。
次のように回避してください。

コード: 全て選択

#prompt
dim tmp as single
dim temp as double
dim buf[7] as byte
buf[3]=&hc3:buf[2]=&h28:buf[1]=&hb9:buf[0]=&h6b
buf[7]=&hc3:buf[6]=&h28:buf[5]=&hb9:buf[4]=&h6b

print getSingle2(buf)
memcpy(VarPtr(tmp),buf,4)
print tmp

print getDouble(buf)
memcpy(VarPtr(temp),buf,8)
print temp

Function getSingle2(lpSingle As VoidPtr) As Single
	SetDWord(VarPtr(getSingle2),GetDWord(lpSingle))
End Function

getSingle関数の使い方?

by ゲスト » 2008年7月11日(金) 18:09

下記のようなことをしてみたのですが、getSingle関数の戻り値が変(0)です。
使い方を間違っているのでしょうか?
Doubleの方は、期待値どおりなんですが。
使っているのは、4.24.00です。

#prompt
dim tmp as single
dim temp as double
dim buf[7] as byte
buf[3]=&hc3:buf[2]=&h28:buf[1]=&hb9:buf[0]=&h6b
buf[7]=&hc3:buf[6]=&h28:buf[5]=&hb9:buf[4]=&h6b

print getSingle(buf)
memcpy(VarPtr(tmp),buf,4)
print tmp

print getDouble(buf)
memcpy(VarPtr(temp),buf,8)
print temp

ページトップ