2616.html
来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 25 行
HTML
25 行
<html>
<head>
<title>我有没有写错??</title>
</head>
<BODY BACKGROUND="" BGCOLOR="white" TEXT="black" LINK="red" VLINK="#808080" ALINK="">
<center>
<h1>我有没有写错??</h1>
</center>
<HR><p>
Posted by <a href="mailto:william@huge.net.hk">Rpg之鬼</a> on April 17, 1998 at 05:02:17:<p>
Option Explicit<br>Dim APIMem As APIMEMory<br>Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal dst As Any, ByVal src As Any, ByVal size As Long)<p>Sub Form_Load()<p>Set APIMem = New APIMEMory<p>Dim FileSize As Long<br>Dim ReadString As String<br>Dim WriteString As String<p>FileSize = FileLen("c:\program files\vb\winapi\win32api.txt")<br>APIMem.Memsize = FileSize<br>APIMem.GAlloc<br>APIMem.Glock<p>ReadString = Space(FileSize)<br>WriteString = Space(FileSize)<p>Open "c:\program files\adobe\Demon_s\bmp\Ds_01.cg" For Binary Access Read As #1<br>Get #1, , ReadString<br>Close #1<p>Call CopyMemory(APIMem.MemPointer, ReadString, FileSize)<br>Call CopyMemory(WriteString, APIMem.MemPointer, FileSize)<p>APIMem.GUnlock<br>APIMem.GFree<br>text1.Text = ReadString<br>End Sub<p>"ApiMemory.Cls"<p>Private Declare Function GlobalSize Lib "kernel32" (ByVal hMem As Long) As Long<br>Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long<br>Private Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long<br>Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long<br>Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long<p>Const GMEM_ZEROINIT = &H40<br>Const GEMEM_MOVEABLE = &H2<p>Dim m_MenSize As Long<br>Dim m_MemHandle As Long<br>Dim m_MemPointer As Long<p>Public Property Let Memsize(l As Long)<br> m_MEMsize = l<br>End Property<br>Public Property Get Memsize() As Long<br> Memsize = m_MEMsize<br>End Property<br>Public Property Let Memhandle(l As Long)<br> m_MemHandle = l<br>End Property<br>Public Property Get Memhandle() As Long<br>Memhandle = m_MemHandle<br>End Property<br>Public Property Let MemPointer(l As Long)<br> m_MemPointer = l<br>End Property<br>Public Property Get MemPointer() As Long<br> MemPointer = m_MemPointer<br>End Property<br>Public Sub GAlloc()<br> m_MemHandle = GlobalAlloc(GEMEM_MOVEABLE Or GMEM_ZEROINIT, m_MEMsize)<br>End Sub<br>Public Sub Glock()<br> m_MemPointer = GlobalLock(m_MemHandle)<br>End Sub<br>Public Sub GUnlock()<br>Dim Throm As Long<br> Throm = GlobalUnlock(m_MemHandle)<br>End Sub<br>Public Sub GFree()<br>Dim Throm As Long<br> Throm = GlobalFree(m_MemHandle)<br>End Sub<br>Public Function GSize() As Long<br> GSize = GlobalSize(m_MemHandle)<br>End Function<p>请问上述程式是否把"Ds_01.cg"Copy to Memory??<br>那么Call CopyMemory(WriteString, APIMem.MemPointer, FileSize)又是什么
<br>
<p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 2616-->
<!--top: 2618--><li><a href="2618.html"><b>Re: 我有没有写错??</b></a> cww <i>19:16:19 4/17/98</i>
(<!--responses: 2618-->0)
<ul><!--insert: 2618-->
</ul><!--end: 2618-->
</ul><!--end: 2616-->
<br><HR><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?