出100分..请大侠指点一下begin UpdateResourcer的问题!!! ( 积分: 100 )

  • 主题发起人 主题发起人 风叶人
  • 开始时间 开始时间

风叶人

Unregistered / Unconfirmed
GUEST, unregistred user!
我想删除程序中的资源....总不成功..请大侠看看我的代码错在哪里了???<br><br>function TFORM1.MyDelRes(const UPRESStubFile, UPRESNAME, UPRESDATANAME:pchar):Bool;<br>VAR<br>ResourceHandle, DELResourceHandle: THandle;<br>ResourceLocation , hResLoad: HRSRC;<br>ResourcePointer: Pointer;<br>ResourceSize: LongWord;<br>BEGIN<br>Result:=False;<br>if not FileExists(UPRESStubFile) then <br> begin<br> MessageBox(Handle,pchar(UPRESStubFile+' 没找到.'),pchar<br> (Application.Title),MB_ICONERROR);<br> exit;<br> end;<br>ResourceHandle := LoadLibrary(UPRESStubFile);<br>ResourceLocation := FindResource(ResourceHandle,(UPRESDATANAME), (UPRESNAME));<br>hResLoad := LoadResource(ResourceHandle, ResourceLocation);<br>ResourcePointer := LockResource(hResLoad);<br>ResourceSize := SizeofResource(ResourceHandle, hResLoad);<br>DELResourceHandle := BeginUpdateResource(Pchar(UPRESStubFile),True);<br>if(DELResourceHandle=0) then <br> begin<br> MessageBox(Handle,pchar('错误的资源!.'),pchar<br> (Application.Title),MB_ICONERROR);<br> exit;<br> end;<br>IF UpdateResource (DELResourceHandle,UPRESNAME,UPRESDATANAME,LANG_NEUTRAL+SUBLANG_NEUTRAL,ResourcePointer,ResourceSize)<br> THEN EndUpdateResource(DELResourceHandle,FALSE);<br>if not result then <br> begin<br> MessageBox(Handle,pchar('删除资源失败!'),pchar<br> (Application.Title),MB_ICONERROR);<br> exit;<br> end;<br>end;
 
我想删除程序中的资源....总不成功..请大侠看看我的代码错在哪里了???<br><br>function TFORM1.MyDelRes(const UPRESStubFile, UPRESNAME, UPRESDATANAME:pchar):Bool;<br>VAR<br>ResourceHandle, DELResourceHandle: THandle;<br>ResourceLocation , hResLoad: HRSRC;<br>ResourcePointer: Pointer;<br>ResourceSize: LongWord;<br>BEGIN<br>Result:=False;<br>if not FileExists(UPRESStubFile) then <br> begin<br> MessageBox(Handle,pchar(UPRESStubFile+' 没找到.'),pchar<br> (Application.Title),MB_ICONERROR);<br> exit;<br> end;<br>ResourceHandle := LoadLibrary(UPRESStubFile);<br>ResourceLocation := FindResource(ResourceHandle,(UPRESDATANAME), (UPRESNAME));<br>hResLoad := LoadResource(ResourceHandle, ResourceLocation);<br>ResourcePointer := LockResource(hResLoad);<br>ResourceSize := SizeofResource(ResourceHandle, hResLoad);<br>DELResourceHandle := BeginUpdateResource(Pchar(UPRESStubFile),True);<br>if(DELResourceHandle=0) then <br> begin<br> MessageBox(Handle,pchar('错误的资源!.'),pchar<br> (Application.Title),MB_ICONERROR);<br> exit;<br> end;<br>IF UpdateResource (DELResourceHandle,UPRESNAME,UPRESDATANAME,LANG_NEUTRAL+SUBLANG_NEUTRAL,ResourcePointer,ResourceSize)<br> THEN EndUpdateResource(DELResourceHandle,FALSE);<br>if not result then <br> begin<br> MessageBox(Handle,pchar('删除资源失败!'),pchar<br> (Application.Title),MB_ICONERROR);<br> exit;<br> end;<br>end;
 
好了......自己已经搞定了....晕...
 
100分不要浪费呀砸我吧
 
后退
顶部