• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

error C2064: term does not evaluate to a function

I am loading the netapi32.dll and calling the function NetScheduleJobEnum(). It returns a pointer to an array of AT_ENUM data structures.  For some reason, when I try to access the array it gives me "error C2064: term does not evaluate to a function"..Any clues? here is my code.  I am using MFC and have undefined #define VC_EXTRALEAN in stdafx.h like msdn says to..

typedef NET_API_STATUS (WINAPI *PFNNSJD1) (LPCWSTR,LPBYTE *,DWORD,LPDWORD,LPDWORD,LPDWORD);
            
PFNNSJD1 pfnNetScheduleJobEnum;
NET_API_STATUS returnValue;
AT_ENUM *lpBuffer = new AT_ENUM[20];
LPDWORD lpdwEntriesRead, lpdwTotalEntries;
pfnNetScheduleJobEnum = (PFNNSJD1)GetProcAddress(hNetAPI32, "NetScheduleJobEnum");

returnValue = pfnNetScheduleJobEnum(NULL, (LPBYTE*)&lpBuffer, MAX_PREFERRED_LENGTH, lpdwEntriesRead, lpdwTotalEntries, NULL);

if (lpBuffer[0].JobId() == 0)
  MessageBox(NULL, "horray", "test", MB_OK);


Please help!            
0
dorkSHOE
Asked:
dorkSHOE
1 Solution
 
jkrCommented:
Change

if (lpBuffer[0].JobId() == 0)
  MessageBox(NULL, "horray", "test", MB_OK);

to read

if (lpBuffer[0].JobId == 0)
  MessageBox(NULL, "horray", "test", MB_OK);

And it should work...

Feel free to ask if you encounter problems!
0
 
dorkSHOEAuthor Commented:
Great! Thanks a lot!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now