Click here to Skip to main content
15,921,841 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralModeless dialog with Child style Pin
DionChen9-Jul-03 10:04
DionChen9-Jul-03 10:04 
GeneralRe: Modeless dialog with Child style Pin
Toni789-Jul-03 13:04
Toni789-Jul-03 13:04 
GeneralPrinting PDF SDK Pin
OBRon9-Jul-03 9:39
OBRon9-Jul-03 9:39 
GeneralAggrivating Dialog Problem Pin
Null Monkey9-Jul-03 8:59
Null Monkey9-Jul-03 8:59 
GeneralRe: Aggrivating Dialog Problem Pin
Toni789-Jul-03 13:07
Toni789-Jul-03 13:07 
GeneralRe: Aggrivating Dialog Problem Pin
Null Monkey10-Jul-03 4:29
Null Monkey10-Jul-03 4:29 
GeneralRe: Aggrivating Dialog Problem Pin
Toni7810-Jul-03 17:53
Toni7810-Jul-03 17:53 
GeneralLink Error: Please help me out Pin
lsanil9-Jul-03 8:17
lsanil9-Jul-03 8:17 
Hi,

I am getting link error when I complied a program from Microsoft SDK that used PSAPI. I could not figure out whats going on and I tried using unicode and ANSI flags in link settings. No luck. Can someone help me out please? Here is the code

#include <windows.h>
#include <stdio.h>
#include <psapi.h>
void PrintProcessNameAndID( DWORD processID )
{
char szProcessName[MAX_PATH] = "unknown";

// Get a handle to the process.

HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ,
FALSE, processID );

// Get the process name.

if (NULL != hProcess )
{
HMODULE hMod;
DWORD cbNeeded;

if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod),
&cbNeeded) )
{
GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName) );
}
else return;
}
else return;

// Print the process name and identifier.

printf( "%s (Process ID: %u)\n", szProcessName, processID );

CloseHandle( hProcess );
}

void main( )
{
// Get the list of process identifiers.

DWORD aProcesses[1024], cbNeeded, cProcesses;
unsigned int i;

if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
return;

// Calculate how many process identifiers were returned.

cProcesses = cbNeeded / sizeof(DWORD);

// Print the name and process identifier for each process.

for ( i = 0; i < cProcesses; i++ )
PrintProcessNameAndID( aProcesses[i] );
}


Link Errors:
Linking...
ProcessInfo.obj : error LNK2001: unresolved external symbol _GetModuleBaseNameA@16
ProcessInfo.obj : error LNK2001: unresolved external symbol _EnumProcessModules@16
ProcessInfo.obj : error LNK2001: unresolved external symbol _EnumProcesses@12
Debug/ProcessInfo.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
ProcessInfo.exe - 4 error(s), 0 warning(s)

I am using Windows 2000 Professional SP4 and VC++ 6.0 with SP5. I got this sample from Platform SDK under PSAPI. Please help me out. I am lost.

Thanks in Advance,
AnilConfused | :confused:
GeneralRe: Link Error: Please help me out Pin
John M. Drescher9-Jul-03 8:33
John M. Drescher9-Jul-03 8:33 
GeneralRe: Link Error: Please help me out Pin
lsanil9-Jul-03 8:38
lsanil9-Jul-03 8:38 
GeneralRe: Link Error: Please help me out Pin
Keith D9-Jul-03 8:34
Keith D9-Jul-03 8:34 
GeneralNavigate(url) in OnTitleChange Pin
vishkhush9-Jul-03 8:05
vishkhush9-Jul-03 8:05 
GeneralBrowse Informaiton (BSC) Files Pin
compiler9-Jul-03 7:44
compiler9-Jul-03 7:44 
GeneralRe: Browse Informaiton (BSC) Files Pin
Neville Franks9-Jul-03 12:23
Neville Franks9-Jul-03 12:23 
GeneralRe: Browse Informaiton (BSC) Files Pin
compiler10-Jul-03 6:38
compiler10-Jul-03 6:38 
Generalmouse event Pin
andyg.1019-Jul-03 7:26
andyg.1019-Jul-03 7:26 
GeneralRe: mouse event Pin
Keith D9-Jul-03 7:33
Keith D9-Jul-03 7:33 
GeneralRe: mouse event Pin
andyg.1019-Jul-03 8:39
andyg.1019-Jul-03 8:39 
GeneralRe: mouse event Pin
Cedric Moonen9-Jul-03 20:17
Cedric Moonen9-Jul-03 20:17 
GeneralRe: mouse event Pin
andyg.1019-Jul-03 22:35
andyg.1019-Jul-03 22:35 
GeneralRe: mouse event Pin
Cedric Moonen9-Jul-03 22:58
Cedric Moonen9-Jul-03 22:58 
GeneralODBC; Multiple rows updated. Pin
RalfPeter9-Jul-03 7:13
RalfPeter9-Jul-03 7:13 
GeneralRe: ODBC; Multiple rows updated. Pin
perlmunger9-Jul-03 7:32
perlmunger9-Jul-03 7:32 
GeneralRe: ODBC; Multiple rows updated. Pin
Anonymous9-Jul-03 10:57
Anonymous9-Jul-03 10:57 
GeneralRe: ODBC; Multiple rows updated. Pin
Toni789-Jul-03 13:14
Toni789-Jul-03 13:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.