I've never tried use the VS GUI to compile a XS DLL since VS doesn't know what xsubpp is, plus there are many macros that are defined at the cmd line. You can compile on the command line then debug the DLL in the VS GUI. In the makefile.pl put "XSOPT => ' -nolinenumbers '," in the %config EUMM hash so you see the original C file in the debugger and not the XS file which isn't valid C code.

On second thought, you are not using XS and are not making a DLL and have no makefile, you are embedding the Perl Interp. Choice 1, switch the project in the VS GUI from UNICODE mode to MBCS mode . See http://www.d3dcoder.net/Data/Book2/Book2Setup.pdf#5

Choice 2, is to manually define a PROCESSENTRY32A that MS never created. From my around 2003 platform sdk.
typedef struct tagPROCESSENTRY32W { DWORD dwSize; DWORD cntUsage; DWORD th32ProcessID; // this process ULONG_PTR th32DefaultHeapID; DWORD th32ModuleID; // associated exe DWORD cntThreads; DWORD th32ParentProcessID; // this process's parent process LONG pcPriClassBase; // Base priority of process's thre +ads DWORD dwFlags; WCHAR szExeFile[MAX_PATH]; // Path } PROCESSENTRY32W; typedef PROCESSENTRY32W * PPROCESSENTRY32W; typedef PROCESSENTRY32W * LPPROCESSENTRY32W; ......................... typedef struct tagPROCESSENTRY32 { DWORD dwSize; DWORD cntUsage; DWORD th32ProcessID; // this process ULONG_PTR th32DefaultHeapID; DWORD th32ModuleID; // associated exe DWORD cntThreads; DWORD th32ParentProcessID; // this process's parent process LONG pcPriClassBase; // Base priority of process's thre +ads DWORD dwFlags; CHAR szExeFile[MAX_PATH]; // Path } PROCESSENTRY32; typedef PROCESSENTRY32 * PPROCESSENTRY32; typedef PROCESSENTRY32 * LPPROCESSENTRY32; #ifdef UNICODE #define Process32First Process32FirstW #define Process32Next Process32NextW #define PROCESSENTRY32 PROCESSENTRY32W #define PPROCESSENTRY32 PPROCESSENTRY32W #define LPPROCESSENTRY32 LPPROCESSENTRY32W #endif // !UNICODE
Choice 3 is to undef those last 3 lines and use the A postfix functions. Choice 4, if you HAVE to have use the wide APIs, and pass unicode into Perl language, that is a completely different topic, I suggest doing exactly what is done here https://github.com/jandubois/win32/blob/841409b37dea45266c2afb68919d80c4e5dea657/Win32.xs#L174 for converting UTF16 into "Perl Unicode".

You can also rethink your design and make a XS module instead of embedding Perl into your own application. There has to be some Perl language code you want to run right?

In reply to Re^3: wchar_t*, char* and perl XS by bulk88
in thread wchar_t*, char* and perl XS by xiaoyafeng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.