.


:




:

































 

 

 

 


, DLL




1. ++, DLL, .

2. Visual C++ Win32.

3. Win32.

4. , MyExecRefsDll, . . , DLL. .

5. Win32 .

6. .

7. .

8. , .

1. . . MyExecRefsDll.cpp.

2. , DLL, . MyExecRefsDll, . , .NET Framework .

3. , . , . MathFuncsDll , .

4. DLL . C/C++, . MathFuncsDll.h. , ..\MathFuncsDll\. .

5. MyMathFuncs . MyExecRefsDll.cpp .

// MyExecRefsDll.cpp

// compile with: /EHsc /link MathFuncsDll.lib

#include <iostream>

#include "MathFuncsDll.h"

using namespace std;

int main()

{

double a = 7.4;

int b = 99;

cout << "a + b = " <<

MathFuncs::MyMathFuncs::Add(a, b) << endl;

cout << "a - b = " <<

MathFuncs::MyMathFuncs::Subtract(a, b) << endl;

cout << "a * b = " <<

MathFuncs::MyMathFuncs::Multiply(a, b) << endl;

cout << "a / b = " <<

MathFuncs::MyMathFuncs::Divide(a, b) << endl;

try

{

cout << "a / 0 = " <<

MathFuncs::MyMathFuncs::Divide(a, 0) << endl;

}

catch (const invalid_argument &e)

{

cout << "Caught exception: " << e.what() << endl;

}

return 0;

}

6. , .

1. , MyExecRefsDll . MyExecRefsDll .

2. , , . :

1. a + b = 106,4

2. a - b = -91,6

3. a * b = 732,6

4. a / b = 0,0747475

: b !

 

1. ?

2. .

3. , ?

4. , (LoadLibrary, FreeLibrary, GetProcAddress).

5. .DLL Asc2Un?

6. ?

7. ASCII Unicode.


 





:


: 2016-11-24; !; : 453 |


:

:

, .
==> ...

1511 - | 1278 -


© 2015-2024 lektsii.org - -

: 0.011 .