You can easily just wrap your single or double value into an array, and use Marshal.Copy's current overload. For example, for a Single value:
void CopyToPointer(IntPtr copyTarget, float myFloat)
{
Marhsall.Copy(new float[] { myFloat }, 0, copyTarget, 1);
}
The result of this will be identical, since you're copying by value in any case.
Reed Copsey, Jr. -
http://reedcopsey.com