????? ????? ?????? ??????? 32-?? ???? .OBJs ?? ????

?????? ????????? ?????? ?????????
???? ???????: 131313 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ?????? ????? ????? ???? ???????? ??????? ????? .DLL ???? ??????? ?? ???? ???? ????????? ???????? ?? ????. ?? ???? ?? ???? ?????? 32-?? ???? ????? ???? ???????? ??????? ?? .DLL ? ??? ??? ???? ?? ??????? Visual C++ 16-??.

??????: ?? ?? ???? ??? ??????? ?? DLLs ???? ?? ??????? ?????? ????? ??????? ??? ??????? ?? Microsoft.

??????? ????

?????? ??? ????? .DLL ?? ????? ???? ???? ??????? ?? ????? ???????? ???? ???????? ??????? (? ????? ?????) ??? ????? ???? ?? ????? ????????. ???? ?? ???? ???? .DLL ???? ?????? ?? ??? ?????? ??????? ? ?? ????? ??? ????? ???? ???????? ??????? ???????? .DLL ????? ???????? ???????? ?????? ??? ???????. ?? ???? ???? ???????? ??????? ???? ??????? ??? ???????.

???? ??????? ?????? ???? ???????? ??????? ??? .DLL:
  • ????? ??? .DEF ????????? ?? /DEF LIB: ?????.
  • stub ?????? ????? ??????? .OBJ ??????? ???? ?? ??????? ??????? ?????? ?????????/???????. ?? ?????? /DEF LIB: ????? ??? ????? ????? ?????????.

????? ??? .DEF

????? ??????? ???? ???? ???? ????? ??????? ??? .DEF ?????? ???? ???????? ??????? ?? .DLL ???? ?? ??? ???? ????????? ???????? ?????? ?? ??????? ??????? ?????? ??? .DLL ????? ????? ??? ????? C. ????? ???? ????? ??????? ???? ?? ?? ????? ??????? ?????? ??????? C. ??? ????? ??? ????? _cdecl ????? ????????? ?? ??????? ?????? ??????. ???? ??? ??? ?? ????? ?? ??? ????? ????? _cdecl ????????? ??? /Gz (_stdcall ?? ??????? ?????????) ?? /Gr (????????? ?? _fastcall) ?? ??? ????? ?? ??? ??????? CL. ????? ??? ??? ????? ?????? ???? ?? ??????? ?????? ?????? ???????? LIB ???????? ??? ????? ???? ????? ???? ????? ???? ????? ?????. ???? ??? ????? ??? ?? ????? ??????? _cdecl.

????? .DLL ?? ??????? ???? ?? ??????? ??? ????? C, ????? ????? ???? ???????? ??????? ?????? ??????? ???????:
  1. ?????? /EXPORTS DUMPBIN < ??? ??? .DLL > ?????? ??? ????? ???? ??????? .DLL ?? ??????. ???? ?????? ?? ?????? "???" ?? ?????? ???? ?? ?????? "??? ????? ??????."
  2. ????? ??? .DEF ????? ??? ????? ?? ??????? ??????? ???????? ?? ?????? "???" ??????? DUMPBIN.
  3. ???? ????? ?????? _cdecl ??? ??? ??? ????????? ?? ?????? ?????????. ??? ?? ??? ????? ?? ??? ????? ????? .DEF.
  4. ??????? /DEF LIB: < ??? ????? .DEF > ?????? ??? ????? ? ????? ?????????. ????? ????? ??????? ????? ????????? ????? ??????? ???? .DEF. ???????/OUT: ?????? ??? ????? ???????.

stubbing ???? ?????

??????? ??????? ??????? ???? ?????? ???????? ????????? ??? C ?????? ?????? ???? ???????. ???? ??? ????? ????? ??? ?? ???????? ????? C++ ?????? ????? ??? ???? ??????? ????????. ???????? ??? ???????? ??? ?? ???? ??? ????? ??? ????? .DLL ?????.

?????? ??????? stubbed ?? ??????? ??????? ?? ??? ???:
  1. ??? ??????? "__declspec(dllimport)" ?? ????? ???? ?? ????? ?????? ??? "__declspec(dllexport)."
  2. ?????? ??? ??????? ???? ?? ???? ???? ?????? C ?? ???? C ?????????? C ??????? ?? ????????? ???????? ?????? C++ (???????? ?? ???? extern "C") ??????? ???????? ????? ????? ?????? ?? ??? ?????? ?? ??????? ???????? ("{}").
  3. ?????? ??? ????? C++ (???????? ?? ???) ???? ???? ???? ? ??? ????? ?? ????? ?????? ? ?????? ???? ????? ?? ????? ??????. (?? ????? ????? ????? ?? ?????? ??? ??????.) ????? ??? ??? ??? ???????? ?????. ?? ?? ???????? ?? ????? ?? ??? ??????? ????? ?????? ???????? LIB ??? ????? ????? ????????? ?????? ???? ???? ???? ??????? ??? ?? ?????.
  4. ???? ???? stub ????? C++ ?????? ????? ??? ???????? ??????? ??????? ?? ????? ??? ????? ?? ??? ????? ????? inlining ????? ???? ?????.
  5. ??? ????? ????? ????? ?????? ??? ??? ?? ??? ???. ??? ???? ??????? Geta(int). ??? ????? ???? ????? ????? ??? ????? ?? ???? ????? Geta(int x). ???? ??? C2055 ???? ?? ???????.

??????

??? ??? ????? ??? ??? MYDLL.DLL ???:
// mydll.H

extern "C" __declspec(dllimport) void _stdcall Function(void);

class __declspec(dllimport) CMyClass {
     int a;
     long b;
public:
     int Geta(int);
     long Getb();
     CMyClass();
};
				
??? ?? ???? ????? ?????? ????? ??????? ?????? ????? ?????????:
 // mydll.CPP

 extern "C" __declspec(dllexport) void _stdcall Function(void) {}

 class __declspec(dllexport) CMyClass {
      int a;
      long b;
 public:
      int Geta(int x) {return 111;}
      long Getb() {return 111;}
      CMyClass() {}
 };
				
????? ??? stubbed ??????? ? ?? ?? ?? ????? ??? ?????? ????? ????? ?????? ??? ??? .OBJ:
mydll.CPP /Ob0 /c CL
??????: ????? ?????? inlining ????? ??? ????? ???? ??????? ??????? ?? CMyClass. ??? ?? ????? ?????? inlining ?????? ??????? ???? ?? ???? ??? ????? ??? ????? ??? ?? ???? ??????? ??? ??? ????? ???? ??????. ???? ??? ????? ???? ????? ??? ??????? ?? ???? ??? ??????? CL Visual C++.

????? ?? ???? ???? ??????? .OBJ ????? ??????? /DEF LIB: ?????? ????? ????????? (.LIB) ???? ????? (.EXP):
/DEF LIB: mydll.OBJ
?????? ??? ???? ?? ????????? ??? ????? LIB ???? "LIB ??????" ?? Visual C++ ????????.

?????? ???? ??????? ??????? ?? "????? ??????? ?? Microsoft:
140485????? ???? Like PASCAL ?? DLLs 32-??

???????

???? ???????: 131313 - ????? ??? ??????: 11/????? ??????/1425 - ??????: 2.1
????? ???
  • The Microsoft Library Manager (LIB.EXE), ????? ?????? ??:
    • Microsoft Visual C++ 2.0 Professional Edition
    • Microsoft Visual C++ 2.1
    • Microsoft Visual C++ 4.0 Standard Edition
    • Microsoft Visual C++ 5.0 Standard Edition
????? ??????: 
kbmt kb3rdparty kbcode kbhowto KB131313 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????131313
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com