Thread: string to LPCVOID

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    44
    this is my code

    Code:
        if(!WriteProcessMemory(hProcess, str, lpszDllPath.c_str(), lpszDllPath.length() + 1, 0))
    and this is my error

    Code:
    error C2664: 'WriteProcessMemory' : cannot convert parameter 3 from 'const char *' to 'void *'
    and "lpszDllPath" is string.. thanks for reply and sory my english..

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Quote Originally Posted by koyboy
    error C2664: 'WriteProcessMemory' : cannot convert parameter 3 from 'const char *' to 'void *'
    Quote Originally Posted by MSDN
    Code:
    BOOL WriteProcessMemory(HANDLE hProcess,
                            LPVOID lpBaseAddress,
                            LPCVOID lpBuffer,
                            SIZE_T nSize,
                            SIZE_T* lpNumberOfBytesWritten);
    You should update your Platform SDK. See this thread for links: http://cboard.cprogramming.com/showthread.php?t=79619
    In the meantime, open up your <winbase.h> and change the 3rd parameter type to LPCVOID.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM