Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

help in delphi 8

Featured Replies

Posted
function VolSerialNumber(DriveChar: Char): DWORD; unsafe;varNotUsed: DWORD;VolFlags: DWORD;VolSerNumber: DWORD;Buf: array [0..MAX_PATH] of Char;beginGetVolumeInformation ((PChar(DriveChar + ':\'), Buf, sizeof(Buf), @VolSerNumber, NotUsed, VolFlags, nil, 0));Result := VolSerNumber;end;

please help for error

this code work well in delphi 7 but after upgrade delphi 8 error in GetVolumeInformation ((PChar(DriveChar + ':\'), Buf, sizeof(Buf), @VolSerNumber, NotUsed, VolFlags, nil, 0));

[Error] WinForm.pas(89): Invalid typecast

[Error] WinForm.pas(89): There is no overloaded version of 'GetVolumeInformation' that can be called with these arguments

 

  • Check how many parameters GetVolumeInformation takes in delphi 8.

If there is no problems with number of parameters I suspect that it takes a wide char instead. So change Buff to array of WChar, and use GetVol(PWChar(DriveChar + ':\'). 

Try that and see how it goes. 

Delphi 8 is a really, really horrible .NET-only version. Unless you really must use it, I strongly suggest you to switch to Delphi 10 or Delphi 2007. :)

 

Look how the definition of GetVolumeInformation looks like in D8:

function GetVolumeInformation(lpRootPathName: string; lpVolumeNameBuffer: StringBuilder;  nVolumeNameSize: DWORD; out lpVolumeSerialNumber: DWORD;  out lpMaximumComponentLength, lpFileSystemFlags: DWORD;  lpFileSystemNameBuffer: StringBuilder; nFileSystemNameSize: DWORD): BOOL; overload;function GetVolumeInformation(lpRootPathName: string; lpVolumeNameBuffer: StringBuilder;  nVolumeNameSize: DWORD; lpVolumeSerialNumber: IntPtr;  out lpMaximumComponentLength, lpFileSystemFlags: DWORD;  lpFileSystemNameBuffer: StringBuilder; nFileSystemNameSize: DWORD): BOOL; overload;function GetVolumeInformationA(lpRootPathName: string; lpVolumeNameBuffer: StringBuilder;  nVolumeNameSize: DWORD; out lpVolumeSerialNumber: DWORD;  out lpMaximumComponentLength, lpFileSystemFlags: DWORD;  lpFileSystemNameBuffer: StringBuilder; nFileSystemNameSize: DWORD): BOOL;function GetVolumeInformationW(lpRootPathName: string; lpVolumeNameBuffer: StringBuilder;  nVolumeNameSize: DWORD; out lpVolumeSerialNumber: DWORD;  out lpMaximumComponentLength, lpFileSystemFlags: DWORD;  lpFileSystemNameBuffer: StringBuilder; nFileSystemNameSize: DWORD): BOOL;
lpVolumeNameBuffer is not PChar anymore, you must use StringBuilder instead.

@mdj Tell me about your avatar, is it from some game?

The avatar is from the game "Warcraft III - Frozen Throne"...


Look here -> 12919102962212ff232d8.jpeg


Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.