D&Dされた絶対パスが一つ一つNULLで区切られているものだと仮定して、下記のようなコードを組んだのですが、表示結果はめちゃくちゃになります。
正確に言うと、一つ目のNULLが出現するまでの文字列はちゃんとした文字列ですが、それ以降の表示結果は文字列だとは言えないものになっています。
↓ソースコード
#define _CRT_SECURE_NO_DEPRECATE
#include "DxLib.h"
#include <vector>
#include <string>
namespace o{
std::vector<std::string> nullice(const char * str, size_t num){
std::vector<std::string> vs;
vs.push_back("");
size_t strNum=0;
for(size_t i=0;i<num;i++){
while(str[strNum] != NULL) vs[i] += str[strNum], strNum++;
vs.push_back("");
strNum++;
}
return vs;
}
}
std::vector<std::string> DDpath(){
std::vector<std::string> vs;
if(size_t num = GetDragFileNum() ){
char * c = new char[1000];
GetDragFilePath(c);
vs = o::nullice(c, num);
DragFileInfoClear();
delete c;
}
return vs;
}
int WINAPI WinMain(HINSTANCE hI, HINSTANCE hP, LPSTR lpC, int nC){
ChangeWindowMode(true);
SetOutApplicationLogValidFlag(false);
SetWindowText("DxLib");
if(DxLib_Init() == -1) return(-1);
SetAlwaysRunFlag(false);
SetDrawScreen(DX_SCREEN_BACK);
SetDragFileValidFlag(true);
std::vector<std::string> show;
SetFontSize(12);
while(ProcessMessage() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0){
ClsDrawScreen();
std::vector<std::string> r = DDpath();
if(r.size() ) show = r;
for(size_t i=0;i<show.size();i++) DrawString(0,15*i, show[i].c_str(), 0xffffff);
ScreenFlip();
}
DxLib_End();
return(0);
}