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?

I did this ages ago, but the other way arround. Its a right pain, Try reading this specifically this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.