Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVC2008 IDE enviornment showing 2 files with same name Pin
VCProgrammer5-Mar-09 18:39
VCProgrammer5-Mar-09 18:39 
Questionlinking of MFC dialog based application with Resource DLL Pin
Purish Dwivedi5-Mar-09 17:48
Purish Dwivedi5-Mar-09 17:48 
AnswerRe: linking of MFC dialog based application with Resource DLL Pin
«_Superman_»5-Mar-09 18:00
professional«_Superman_»5-Mar-09 18:00 
QuestionRe: linking of MFC dialog based application with Resource DLL Pin
Purish Dwivedi5-Mar-09 18:23
Purish Dwivedi5-Mar-09 18:23 
QuestionCalling child class methods from parent class pointers Pin
mjackson115-Mar-09 17:41
mjackson115-Mar-09 17:41 
AnswerRe: Calling child class methods from parent class pointers Pin
«_Superman_»5-Mar-09 17:48
professional«_Superman_»5-Mar-09 17:48 
GeneralRe: Calling child class methods from parent class pointers Pin
mjackson116-Mar-09 4:59
mjackson116-Mar-09 4:59 
Questionstring class help needed Pin
CHYGO5-Mar-09 16:36
CHYGO5-Mar-09 16:36 
i ues string class in a Win32 Console Application(build by VC++ 6),here is the code and errors, how can i fix it?
#include "stdafx.h"


//add
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include "Psapi.h"
#include <iostream.h>
#include  <string>    
  using   namespace   std;   

void PrintProcessNameAndID( DWORD processID )
{
	string  szProcessName;

    // 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) )
        {
			int len = lstrlen(szProcessName);
            GetModuleBaseName( hProcess, hMod, szProcessName, 
                               len);
			//theProName = szProcessName;
        }

	if(lstrcmp(szProcessName, "smss.exe"))
		_tprintf( TEXT("%s  (PID: %u)\n"), szProcessName, processID );
    }

    CloseHandle( hProcess );
}

int main(int argc, char* argv[])
{
...
	return 0;
}


errors:
... : error C2664: 'lstrlenA' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
... : error C2664: 'GetModuleBaseNameA' : cannot convert parameter 3 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
... : error C2664: 'lstrcmpA' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

i 've tried ,then i have no regret

AnswerRe: string class help needed Pin
Naveen5-Mar-09 16:52
Naveen5-Mar-09 16:52 
GeneralRe: string class help needed Pin
CHYGO5-Mar-09 19:45
CHYGO5-Mar-09 19:45 
GeneralRe: string class help needed Pin
CHYGO5-Mar-09 20:18
CHYGO5-Mar-09 20:18 
GeneralRe: string class help needed Pin
Naveen5-Mar-09 20:22
Naveen5-Mar-09 20:22 
GeneralRe: string class help needed Pin
CHYGO5-Mar-09 21:06
CHYGO5-Mar-09 21:06 
GeneralRe: string class help needed Pin
David Crow6-Mar-09 3:31
David Crow6-Mar-09 3:31 
QuestionIs Volume online and ready? Pin
Peter Weyzen5-Mar-09 14:59
Peter Weyzen5-Mar-09 14:59 
QuestionRational Number constructor Pin
aab199025-Mar-09 13:20
aab199025-Mar-09 13:20 
AnswerRe: Rational Number constructor Pin
Cedric Moonen5-Mar-09 20:22
Cedric Moonen5-Mar-09 20:22 
QuestionRe: Rational Number constructor Pin
CPallini5-Mar-09 21:09
mveCPallini5-Mar-09 21:09 
QuestionRe: Rational Number constructor Pin
David Crow6-Mar-09 3:40
David Crow6-Mar-09 3:40 
QuestionIterating string to add escape sequence. Pin
mmayur5-Mar-09 11:27
mmayur5-Mar-09 11:27 
AnswerRe: Iterating string to add escape sequence. Pin
«_Superman_»5-Mar-09 17:22
professional«_Superman_»5-Mar-09 17:22 
QuestionRe: Iterating string to add escape sequence. Pin
David Crow6-Mar-09 3:43
David Crow6-Mar-09 3:43 
QuestionFirst C++ class Pin
aab199025-Mar-09 11:18
aab199025-Mar-09 11:18 
AnswerRe: First C++ class Pin
Yusuf5-Mar-09 11:29
Yusuf5-Mar-09 11:29 
GeneralRe: First C++ class Pin
aab199025-Mar-09 11:36
aab199025-Mar-09 11:36 

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.