| [文字列 Message] Leng=11 | 
前田稔(Maeda Minoru)の超初心者のプログラム入門


| 
// Char.h
extern "C"
{
    __declspec(dllexport) void  CharMsg(wchar_t *msg);
}
 | 
| 
//Char.cpp
#include <stdio.h>
#include <string.h>
#include <locale.h>
#include "Char.h"
void  CharMsg(wchar_t *msg)
{
    setlocale(LC_ALL, "japanese");
    wprintf(L"[%s] Leng=%d", msg,wcslen(msg));
}
 | 


| 
// Main.cpp
#include <stdio.h>
#include <conio.h>
#include "Char.h"
#pragma comment(lib,"Dll.lib")
int main(void)
{
    CharMsg(L"文字列 Message");
    _getch();
    return 0;
}
 | 
| [文字列 Message] Leng=11 | 
