Re: how to perform memset?
From: Daimy (daimy_at_21cn.com.disscuss)
Date: 12/15/04
- Next message: Stephany Young: "Re: Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Previous message: Mike: "Re: Recommend a scanner?"
- In reply to: Mike D Sutton: "Re: how to perform memset?"
- Next in thread: Mike D Sutton: "Re: how to perform memset?"
- Reply: Mike D Sutton: "Re: how to perform memset?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Dec 2004 09:04:56 +0800
Thanks!
But why .NET doesn't provide methods like that? :(
"Mike D Sutton" <EDais@mvps.org> wrote in message
news:%23mJkwPc4EHA.3120@TK2MSFTNGP12.phx.gbl...
>> how to do this by C# ?
>>
>> byte[] buffer=new byte[8192];
>>
>> memset(buffer, 'U', 8192);
>
> Have a look at the RtlFillMemory() API call (which AFAIK simply calls
> memset() or the equivalent of):
>
> '***
> Private Declare Function RtlFillMemory Lib "Kernel32.dll" ( _
> ByRef Destination As Any, ByVal Length As Long, ByVal Fill As Byte) As
> Long
>
> ...
>
> Const BufSize As Long = 8192
>
> Dim buffer(0 to (BufSize - 1)) As Byte
> Call RtlFillMemory(buffer(0), BufSize, Asc("U"))
> '***
>
> Note; this is a VB (Classic) solution, if you're after a VB.NET solution
> then you're in the wrong place; try the groups here:
> http://EDais.mvps.org/DotNet/
> Hope this helps,
>
> Mike
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@mvps.org
> WWW: http://EDais.mvps.org/
>
>
- Next message: Stephany Young: "Re: Problem When Calling Web Method Of Web Service From Pocket PC 2003."
- Previous message: Mike: "Re: Recommend a scanner?"
- In reply to: Mike D Sutton: "Re: how to perform memset?"
- Next in thread: Mike D Sutton: "Re: how to perform memset?"
- Reply: Mike D Sutton: "Re: how to perform memset?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|