Question : Visual  2010 C++ Expess Error trying to compile source code

I have an old copy of psloggedom from sysinternals.

It is a great tool I have the the source code for the older version, they no longer let you download code for the new version.
I would like to just change the print statement so that when it finds a locally logged on user wit will print
localuser:username

I downloaded visual c++ 2010 express, thinking it would let me change and compile it.

the loggedon.c file has the following header info:

#include <tchar.h>
#include <stdio.h>
#include <assert.h>
#include <windows.h>
#include <lm.h>

Can someone tell me how to load the files needed to compile

and the proper steps.

Thanks,
Mark
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
here are the error I get when trying to compile it.

loggedon.c
loggedon.c(44) : warning C4133: 'function' : incompatible types - from 'LPWSTR' to 'LPSTR'
loggedon.c(178) : warning C4133: 'function' : incompatible types - from 'LPWSTR' to 'LPCSTR'
loggedon.c(190) : warning C4133: 'function' : incompatible types - from 'TCHAR [1024]' to 'const wchar_t *'
loggedon.c(191) : warning C4133: 'function' : incompatible types - from 'TCHAR [1024]' to 'LPWSTR'
loggedon.c(207) : warning C4133: 'function' : incompatible types - from 'TCHAR [260]' to 'const wchar_t *'
loggedon.c(208) : warning C4133: 'function' : incompatible types - from 'TCHAR [260]' to 'const wchar_t *'
loggedon.c(213) : warning C4133: 'function' : incompatible types - from 'TCHAR [260]' to 'const wchar_t *'
loggedon.c(261) : warning C4133: 'function' : incompatible types - from 'LPWSTR' to 'LPCSTR'
loggedon.c(277) : warning C4133: 'function' : incompatible types - from 'TCHAR [1024]' to 'const wchar_t *'
loggedon.c(282) : warning C4133: 'function' : incompatible types - from 'TCHAR [260]' to 'LPWSTR'
loggedon.c(386) : warning C4133: 'function' : incompatible types - from 'LPWSTR' to 'LPCSTR'
loggedon.c(387) : warning C4133: 'function' : incompatible types - from 'LPWSTR' to 'LPCSTR'
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:loggedon.exe 
loggedon.obj 
loggedon.obj : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function _GetLocalLogonTime
loggedon.obj : error LNK2019: unresolved external symbol __imp__RegQueryInfoKeyA@48 referenced in function _GetLocalLogonTime
loggedon.obj : error LNK2019: unresolved external symbol __imp__RegOpenKeyA@12 referenced in function _GetLocalLogonTime
loggedon.obj : error LNK2019: unresolved external symbol __imp__FreeSid@4 referenced in function _DisplayLocalLogons
loggedon.obj : error LNK2019: unresolved external symbol __imp__LookupAccountSidA@28 referenced in function _DisplayLocalLogons
loggedon.obj : error LNK2019: unresolved external symbol __imp__AllocateAndInitializeSid@44 referenced in function _DisplayLocalLogons
loggedon.obj : error LNK2019: unresolved external symbol __imp__RegEnumKeyExA@32 referenced in function _DisplayLocalLogons
loggedon.obj : error LNK2019: unresolved external symbol __imp__RegConnectRegistryA@12 referenced in function _DisplayLocalLogons
loggedon.obj : error LNK2019: unresolved external symbol _NetApiBufferFree@4 referenced in function _DisplaySessionLogons
loggedon.obj : error LNK2019: unresolved external symbol __imp__LookupAccountNameA@28 referenced in function _DisplaySessionLogons
loggedon.obj : error LNK2019: unresolved external symbol _NetSessionEnum@36 referenced in function _DisplaySessionLogons
loggedon.obj : error LNK2019: unresolved external symbol _NetServerEnum@36 referenced in function _wmain
loggedon.exe : fatal error LNK1120: 12 unresolved externals

Answer : Visual  2010 C++ Expess Error trying to compile source code

afxres.h is an MFC header.

Rather than try to fix the paths or fix problems with or without the SDK...  You might try just deleting the VERSION resource (in the RC file).  It does not seem to be critical to the program.

Random Solutions  
 
programming4us programming4us