DllResources lab6 cpp Defines the entry point for the console applicat

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// DllResources(lab6).cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
#define IDS_String 111
int _tmain(int argc, _TCHAR* argv[])
{
int len;
HANDLE COut;
TCHAR Str[32];
HINSTANCE hDll=LoadLibraryA("CreateDll.dll");
COut=GetStdHandle(STD_OUTPUT_HANDLE);
len=LoadString(hDll,IDS_String,Str,sizeof(Str)/sizeof(TCHAR));
_tcprintf(L"imported string: %s\n",Str);
_tcprintf(L"number of symbols in string: %d\n", len);
return 0;
}
//Resource.rc
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Английский (США) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE 25, 1
STRINGTABLE
BEGIN
IDS_String "Импортная строчка"
END