include stdafx include Windows include locale typedef int __cdecl Dlin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#include "stdafx.h"
#include <Windows.h>
#include <locale.h>
typedef int(__cdecl* Dlina)(char*);
int _tmain(int argc, _TCHAR* argv[])
{
setlocale(LC_ALL,"RUSSIAN");
Dlina lenstr;
char str1[16];
strcpy(str1,"privet-alo");
HINSTANCE hDll = LoadLibraryA("ConsoleApplication19.dll");
lenstr =(Dlina)GetProcAddress(hDll,"Len");
printf("Строка: %s\n",str1);
printf("Длина этой строки равна %d",lenstr(str1));
getchar();
FreeLibrary(hDll);
return 0;
}