#define _CRT_SECURE_NO_WARNINGS #define _UNICODE #define UNICODE #include #include #include #include #include #include #include #include #include #include #include extern __declspec(dllimport) void printCreateDirectory(); int main(void) { HINSTANCE mylib = LoadLibrary(L"MyLib.dll"); if (mylib == NULL) { _tprintf(_T("Ошибука")); return 1; } typedef void (*SystemParameters)(wchar_t *); SystemParameters printSystemParametersInfo; printSystemParametersInfo = (SystemParameters)GetProcAddress(mylib,"printSystemParametersInfo"); // программа только для UNICODE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! const wchar_t str[] = L"help"; const wchar_t str1[] = L"exit"; const wchar_t str2[] = L"systemP"; const wchar_t str3[] = L"getD"; const wchar_t str4[] = L"getP"; const wchar_t str5[] = L"setC"; _setmode(_fileno(stdin), _O_U16TEXT); _setmode(_fileno(stdout), _O_U16TEXT); _setmode(_fileno(stderr), _O_U16TEXT); printCreateDirectory(); wchar_t comand[50]; //setlocale(LC_ALL, ".UTF8"); _tprintf(_T("Здравствуйте, в связи с атакой террористов на мое воображение эта программа получила название \"Программа3\"\n")); while (1) { _tprintf(_T("Введите команду: ")); fgetws(comand, sizeof(comand), stdin); comand[wcslen(comand) - 1] = 0; if (!wcscmp(comand, str)) { _tprintf(_T("Тут должен быть список доступных команд, но его нет - как жаль(\n")); } else if (!wcscmp(comand, str1)) { _tprintf(_T("Произошел выход из программы!\n")); break; } else if (!wcscmp(comand, str2)) { wchar_t str[255]; printSystemParametersInfo(str, 255); _tprintf(_T("Рисунок с рабочего стола лежит в: %s!\n"), str); } else { _tprintf(_T("Неверная команда!\n")); } } return 0; }