CHAR array to LPCTSTR

Discussion in 'C' started by Saustin_Ben, Sep 8, 2010.

  1. Saustin_Ben

    Saustin_Ben New Member

    Joined:
    Sep 8, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi;

    I'm coding in C and I'm using the CreateFile function inside of Windows API which is:
    HANDLE WINAPI CreateFile(
    __in LPCTSTR lpFileName,
    __in DWORD dwDesiredAccess,
    __in DWORD dwShareMode,
    __in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
    __in DWORD dwCreationDisposition,
    __in DWORD dwFlagsAndAttributes,
    __in_opt HANDLE hTemplateFile
    );
    In the first argument, lpFieName will NOT accept a 'normal' character array.

    I've tried numerous methods to convert the string, and I've used CreateFileA for ANSI compilation, however they both do NOT work.

    Any suggestions?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice