Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

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.

Empfohlene Antworten

Veröffentlicht

BOOL CSystemInfo::GetDiscFreeSpace(LPCTSTR lpszPath, DWORDLONG* pnFree, DWORDLONG* pnTotal)

{

BOOL bRet = FALSE;

HINSTANCE hInstance;

hInstance = LoadLibrary("KERNEL32.DLL");

if(hInstance)

{

FARPROC lpfnDLLProc = NULL;

lpfnDLLProc = GetProcAddress((HMODULE)hInstance, "GetDiskFreeSpaceEx");

if(lpfnDLLProc)

{

ULARGE_INTEGER nTotalBytes;

ULARGE_INTEGER nTotalFreeBytes;

ULARGE_INTEGER nTotalAvailable;

if(lpfnDLLProc(lpszPath, &nTotalAvailable, &nTotalBytes, &nTotalFreeBytes))

{

*pnFree = nTotalAvailable.QuadPart;

*pnTotal = nTotalBytes.QuadPart;

bRet = TRUE;

}

}

FreeLibrary(hInstance);

}

//ansonsten muss man GetDiskFreeSpace()

if(!bRet)

{

ULONG secpercluster, bytespersec, nooffreeclusters, totalnoofclusters;

if(GetDiskFreeSpace(lpszPath, &secpercluster, &bytespersec,

&nooffreeclusters, &totalnoofclusters))

{

*pnFree = (nooffreeclusters * secpercluster * bytespersec);

*pnTotal = totalnoofclusters * secpercluster * bytespersec;

bRet = TRUE;

}

}

return bRet;

}

there I get the error : too many actual parameters

Can someone help me why I get the error?

thx

Hi,

also:

1. es ist nicht notwendig die kernel32.dll zu laden, weil sie sowieso geladen wird.

man braucht nur GetModuleHandle("kernel32.dll").

2. In Deinem Fall wäre es so:

...

typedef void (CALLBACK *FP)(LPCTSTR,PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);

FP lpfnDLLProc = NULL;

lpfnDLLProc = (FP)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetDiskFreeSpaceExW");

if(lpfnDLLProc)

{

ULARGE_INTEGER nTotalBytes;

ULARGE_INTEGER nTotalFreeBytes;

ULARGE_INTEGER nTotalAvailable;

(*lpfnDLLProc)(lpszPath, &nTotalAvailable, &nTotalBytes, &nTotalFreeBytes);

...

}

Für die Erklärung siehe Artikel Q117428 MSDN.

Ich hoffe, ich habe Dir geholfen.

Gruß

neff

Danke, aber das war nicht das problem!

Es lag nur an den Pointer, den musste ich erst definieren, wie er aufgebaut wird!

also ein typedef!!!

Aber trotzdem danke !!! ;)

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.