I'm trying to set the priority class for a process, but I keep receiving "Error 49: Bad DLL Calling Convention".

Here's the code I'm using. It works fine except for the last line which gives me the error.

Dim lngRetValStartDoc As Long
Dim pptName As String
Dim appName As String

pptName = "Microsoft PowerPoint - [C-Mac Slides_0503_English]"


'Initialize variables within a data type
With processAtt
.lpSecurityDescriptor = 0
.bInheritHandle = True
.nLength = Len(processAtt)
End With

With threadAtt
.lpSecurityDescriptor = 0
.bInheritHandle = True
.nLength = Len(threadAtt)
End With

appName = "C:\program files\microsoft office\office\powerpnt.exe"

'Create a new process
lngRetValCreateProcess = CreateProcess(appName, vbNullString, processAtt, threadAtt, _
False, CREATE_NO_WINDOW, Null, vbNullString, startUp, processInfo)

lngThreadID = processInfo.dwThreadId
lngProcessID = processInfo.dwProcessId

lngRetValStartDoc = StartDoc("C-Mac Slides_0503_English.ppt")

lngWindowName = FindWindow(vbNullString, pptName)

lngRetValGetPriority = GetPriorityClass(lngWindowName)

lngRetValSetPriority = SetPriorityClass(lngWindowName, NORMAL_PRIORITY_CLASS)