C++/CLI

C++/CLIでString^(UTF-16)とchar*(UTF-8)の相互変換を調べたのでメモ。

久し振りに仕事でちょっとしたフレームワーク作ってます。 昔を思い出すこの感じ。嫌いじゃないです。 ※Shift-JISは一切考慮してません #include "msclr/marshal.h" #include "msclr/marshal_windows.h" #include "msclr/marshal_cppstd.h" #include "msclr/…

C++でファイルサイズ取得

C++でファイルサイズを取得する // for win32api #include <Windows.h> // for ifstream #include <fstream> // for stat #include <sys/types.h> #include <sys/stat.h> int main(int argc, char* argv[]) { const char* filepath = "C:\\Windows\\Media\\Windows Shutdown.wav"; // for win32api HANDLE </sys/stat.h></sys/types.h></fstream></windows.h>…

String^ ⇔ array^ の相互変換

String^ ⇔ array^ の相互変換を行うメソッドです。

C++/CLI で#define

C++/CLIは#defineマクロが使えることをすっかり忘れていたので、 忘れないうちにちょっとメモ