int _tmain(int argc, _TCHAR* argv[]) { OutputDebugStringW(L"OMG !"); std::cout << "LOL" << std::endl; entry_main(argc, argv); system("pause"); return 0; }
static void dispatcher(char **ppstring, int (*entry_main)(int argc, char **argv)) { int argc = 0; char *argv[16]; while(1) { char *args = _get_next_arg( ppstring ); if( args==NULL ) { entry_main( argc, argv ); break; } else if( strcmp( args, "|" )==0 ) { argv[argc] = NULL; entry_main( argc, argv ); argc = 0; } else argv[argc++] = args; } }