2)Длл ресурсов

 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
53
54
55
// Dll Resources.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Dll Resources.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#define IDS_STRING3000 3000
// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
HMODULE hModule = ::GetModuleHandle(NULL);
if (hModule != NULL)
{
// initialize MFC and print and error on failure
if (!AfxWinInit(hModule, NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
HINSTANCE dll = AfxLoadLibrary(_T("C:\\Users\\Константин\\Documents\\Visual Studio 2012\\Projects\\MFC\\Dll Resources\\Debug\\Dll.dll"));
CString StrRes;
StrRes.LoadStringW(IDS_STRING3000);
AfxMessageBox(StrRes);
AfxFreeLibrary(dll);
}
}
else
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: GetModuleHandle failed\n"));
nRetCode = 1;
}
return nRetCode;
}