DLLでC側からVBA側へ文字列を渡す

VBA側宣言のByVal x As Stringと VBA側でStringの領域を確保しておくのがミソVC++側 extern "C" __declspec (dllexport) int __stdcall Test2(char *X, char *Y); extern "C" __declspec (dllexport) int __stdcall Test2(char *X, char *Y) { Y[0] = 'A'; Y[1] = 'Z'; Y[2] = '@'; return 0; }VB側 Private Declare Funct…