Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
<DllImport("kernel32.dll", SetLastError := False)> _
Public Shared Function BeginUpdateResource(ByVal pFileName As String, _
<DllImport("kernel32.dll", SetLastError := False)>
Public Function BeginUpdateResource(ByVal pFileName As String,
<MarshalAs(UnmanagedType.Bool)> ByVal bDeleteExistingResources As Boolean) As IntPtr
End Function
User-Defined Types:
None.
Notes:
calls SetLastError. the last error can be retrieved with Marshal.GetLastWin32Error().
Tips & Tricks:
Please add some!
Sample Code:
internal void DelFile(ArrayList fileNames) {
IntPtr hResource = BeginUpdateResource(mFileName, false);
if (hResource.ToInt32() == 0) {
throw new Win32Exception(Marshal.GetLastWin32Error());
}
foreach (String fileName in fileNames) {
if (UpdateResource(hResource, "FILE", fileName,
MakeLangId(LANG_ENGLISH, SUBLANG_ENGLISH_US), null, 0) == false) {
throw new Win32Exception(Marshal.GetLastWin32Error());
}
}
if (EndUpdateResource(hResource, false) == false) {
throw new Win32Exception(Marshal.GetLastWin32Error());
}
}
Please add some!
Alternative Managed API:
Do you know one? Please contribute it!
The BeginUpdateResource API
9/30/2009 7:03:44 AM - tsahi-217.132.117.209
The SetLastError API
1/26/2016 3:27:33 AM - -124.148.167.58
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).