Re: how to perform memset?

From: Daimy (daimy_at_21cn.com.disscuss)
Date: 12/15/04


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/
>
>



Relevant Pages

  • Re: Modifying A Pixel in a Pictures color
    ... BTW, very nice site Mike. ... then you won't be able to use the VB picture box anyway ... >> and you'll have to use the various API methods. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to suspend Windows?
    ... Mike, I think what he wants to do is modalize (and possibly make it appear ... I don't think that can be done with the Power Management API ... So you didn't download the API Guide using the link that Steve ...
    (microsoft.public.vb.general.discussion)
  • Re: GDI+
    ... Thanks again Mike, but it does not access the API in a visible way... ... > class is only a wrapper class to access the GDI Flat APIs. ... >> This UDF returns the fullpath of the temporary bitmap created by the ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Onoe for Mike D
    ... I guess I am asking how to elevate my programs rights so that I can do all ... my API tricks...in Vista ... |> Mike, ...
    (microsoft.public.vb.general.discussion)
  • Re: @see in Javadoc not working
    ... > Hi Mike. ... > javadocs of the standard API. ... In other words: the javadoc tool doesn't ...
    (comp.lang.java.help)