Jump to content

Recommended Posts

Posted (edited)

Hello!

I think that it is finaly time for me to learn how to practicly do some dll calls, and I found this reference point at msdn and I thought that this would be a good start.

How would I get the total physical memory for example, the reference is: MSDN link

Ps. I do know some c++ / win32 programming, but just a little :P

Edited by monoceres

Broken link? PM me and I'll send you the file!

  • Moderators
Posted

  monoceres said:

Hello!s say

I think that it is finaly time for me to learn how to practicly do some dll calls, and I found this reference point at msdn and I thought that this would be a good start.

How would I get the total physical memory for example, the reference is: MSDN link

Ps. I do know some c++ / win32 programming, but just a little :P

If you know "some" C++ ... you know that's not a call to a dll right?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

Yes, but I need to work out how you use this in the Psapi.dll dll call.

Edited by monoceres

Broken link? PM me and I'll send you the file!

  • Moderators
Posted (edited)

  monoceres said:

Yes, but I need to work out how you use this in the Psapi.dll dll call.

Which Psapi.dll function are you trying to use?

Edit:

Anyone having an issue with Psapi.dll and GetPerformanceInfo? I keep getting function unknown :P\

Edit2:

I have to run now, here's a "non" working version:

Local $aPERFORMANCE_INFORMATION[15] = ["", "cb", "CommitTotal", "CommitLimit", _
    "PhysicalTotal", "PhysicalAvailable", "SystemCache", "KernelTotal", "KernelPaged", _
    "KernelNonpaged", "PageSize", "HandleCount", "ProcessCount", "ThreadCount"]
    
Local $nCB = 80000
Local $tPERFORMANCE_INFORMATION = DllStructCreate("dword;int[10];dword[3]")
Local $aGPI = DllCall("Psapi.dll", "int", "GetPerformanceInfo", "ptr", DllStructGetPtr($tPERFORMANCE_INFORMATION), "dword", $nCB)
If IsArray($aGPI) Then
    Local $sHold = ""
    For $i = 1 To 14
        $sHold &= $aPERFORMANCE_INFORMATION[$i] & " = " & DllStructGetData($tPERFORMANCE_INFORMATION, $i) & @CRLF
    Next
    MsgBox(64, "Info", $sHold)
EndIf
I can't figure out why it says that the function doesn't exist (I checked, it does)... I'm obviously calling it wrong, and my struct must be set up wrong.... maybe someone would like to take over where I left off... Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

I can The code runs for me, but the only values I get is the CommitTotal, CommitLimit and CB, everything is zero.

But your code is good anyhow because now I more about structs in dll's, thanks!

Broken link? PM me and I'll send you the file!

  • 1 month later...
Posted

SmOke_N

  Quote

I can't figure out why it says that the function doesn't exist

Maybe this will explain it:

  ' said:

PSAPI.DLL (Process Status Helper) is one of the possible DLLs may cause error in Windows system. You may get some error message such as below during the boot up process:

Procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library. PSAPI.DLL

According to Microsoft, there is only one PSAPI.DLL file in your PC and it is under the Windows\System 32 folder. Additional PSAPI.DLL file may be installed by third party programs such as SmartBridge, often the older version. If you have other versions of the PSAPI.DLL file in the system, it can cause your IE 7 or other windows programs that interact with IE7 to crash when you start it up. Beside, you may have annoying error message like above too.

To solve the PSAPI.DLL incompatibility issue and overcome this problem, search your PC or check the program folder of the application that crashes for a PSAPI.DLL file:

Open up Search from Start Menu.

Find all instances PSAPI.DLL on your PC.

Rename all extra copies of PSAPI.DLL files found EXCEPT the one located in \Windows\System32\ folder to some other names like PSAPIOLD.DLL (never delete or do anything with the PSAPI.DLL file in your Windows or Windows/System 32 folder).

Reboot the system.

It work for me if i use full path to system dir, i.e. DllCall(@SystemDir & "\Psapi.dll"....) :).

BTW, the Psapi.dll wil present on all Windows platforms, or only on WIN NT 4? (accourding to the help file).

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

noob help

dll?

cheers C.W

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...