!ENDIF
# Begin Target
# Name "Dll - Win32 Release"
# Name "Dll - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\Dll.cpp
# End Source File
# Begin Source File
SOURCE=.\Dll.def
# End Source File
# Begin Source File
SOURCE=.\Dll.rc
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\Dll.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\Dll.rc2
# End Source File
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project
好了,两个文件的不同点,我已经给大家标出来了,当然这里标出来的就只是我们需要修改的,所以真正的不同点不止这此。为了实现今天我们的功能这们只要修改上面我标出来的就可以了。
这就是我修改之后的DemoDll.dsp
(1) # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
(2) !MESSAGE "DemoDll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
(3) !MESSAGE "DemoDll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
(4) # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
(5) # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /c
(6) # ADD BASE LINK32 /nologo /subsystem:windows /dll /machine:I386
(7) # ADD LINK32 /nologo /subsystem:windows /dll /machine:I386
(8) # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
(9) # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c
(10) # ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
(11) # ADD LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
好的,就这些了,上面就是我修改之后的DemoDll.dsp文件的内容,总共需要修改的是13处,其实没也没有什么,只要大家好好的看清楚也就OK了。
好了,文件我们也就转换好了,就让我们来调用一下试试吧:
CallDll.exe:
void CCallDllDlg::OnOK()
{
// TODO: Add extra validation here
HINSTANCE hInstance;
hInstance=::L