nerdexam
Microsoft

98-372 · Question #239

You want to access a native Win32 function from a .NET application. You import the function. Which two keywords should you use to define the function? (Each correct answer presents part of the…

The correct answer is C. Public D. Lib. look at the ability to place a computer into hibernation through the Win32 API. The IsPwrHibernateAllowed function of Powrprof.dll returns a true (non-zero) value if hibernation is permitted, false (zero) if not. Public Declare Function IsPwrHibernateAllowed Lib "Powrprof.dll"…

Understanding .NET Framework Concepts

Question

You want to access a native Win32 function from a .NET application. You import the function. Which two keywords should you use to define the function? (Each correct answer presents part of the solution. Choose two.)

Options

  • ADeclare
  • BPrivate
  • CPublic
  • DLib

How the community answered

(33 responses)
  • A
    18% (6)
  • B
    6% (2)
  • C
    76% (25)

Explanation

look at the ability to place a computer into hibernation through the Win32 API. The IsPwrHibernateAllowed function of Powrprof.dll returns a true (non-zero) value if hibernation is permitted, false (zero) if not. Public Declare Function IsPwrHibernateAllowed Lib "Powrprof.dll" _ Alias "IsPwrHibernateAllowed" () As Integer Public Declare Function SetSuspendState Lib "Powrprof.dll" _ Alias "SetSuspendState" (ByVal Hibernate As Integer, ByVal ForceCritical As Integer, ByVal DisableWakeEvent As Integer) As Integer If (Win32API.IsPwrHibernateAllowed() <> 0) Then Win32API.SetSuspendState(1, 0, 0)

Topics

#P/Invoke#Win32 interop#Declare keyword#Lib keyword

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice