怎樣才能使exe project和dll project共同在一個workspace運行,即可同時跟蹤exe和dll。

mate 2001-06-21 08:12:00
...全文
133 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kevin_qing 2001-06-22
  • 打赏
  • 举报
回复
两个project都在一个workspace里面
1.需要连接lib的
project->dependencis

在上面的下拉框里面选择你的.exe,在下面的列表里面把你的dll打勾。

现在VC会自动将dll 的*.lib连到你的.exe工程里面,并且可以一起调试(用.exe的工程调试)。

2。对不需要连接lib的(LoadLibrary方式),
modify dll's output path,使他输出到.exe的输出目录。

调试。exe的时候,必须运行到loadlibrary后面才可以在.dll的代码里面设置断点。
xxxbird 2001-06-22
  • 打赏
  • 举报
回复
(1) 检查一下你的DLL是否用DEBUG方式编译的。
(2) 在Additional Dlls中必须指明DLL的全路径。
(3) 如果是用LoadLibrary方式调用DLL, 也必须在调试时指明DLL的全路径(DEBUG编译后的路径)。如hDllModule = LoadLibrary ("c:\\testdll\\debug\\testdll.dll").
(4) 两个Project可以共处一个Workspace.
xxxbird 2001-06-22
  • 打赏
  • 举报
回复
我再试试看,两年前我在调试ISAPI程序时就这样用过,应该没有问题。
mate 2001-06-22
  • 打赏
  • 举报
回复
to xxxbird:
你說的方法可以使兩個project共處一個workspace中嗎?
我試了一下,好象還是不行。
首先,我在一個workspace中分別加入一個exe和一個dll project,然后按照你說的方法設置了 Additional Dlls,但在編譯時還是會出現找不到 dll 中符號的錯誤,無奈我只得在exe中加入dll的.lib,可以正常編譯,但出現無法加載dll的信息,就是說,exe還是感覺不到同一個workspace中dll project的存在,還是達不到我想要的效果。
xxxbird 2001-06-22
  • 打赏
  • 举报
回复
If you have more questions, do not hesitate to contact with me.
xxxbird 2001-06-22
  • 打赏
  • 举报
回复
<B>To debug a DLL using the project for the executable file </B>

From the Project menu, click Settings.
The Project Settings dialog box appears.

Choose the Debug tab.


In the Category drop-down list box, select General.


In the Program Arguments text box, type any command-line arguments required by the executable file.


In the Category drop-down list box, select Additional DLLs.


In the Local Name column, type the names of DLLs to debug.
If you are debugging remotely, the Remote Name column appears. In this column, type the complete path for the remote module to map to the local module name.

In the Preload column, select the check box if you want to load the module before debugging begins.


Click OK to store the information in your project.


From the Build menu, click Start Debug and Go to start the debugger.
You can set breakpoints in the DLL or the calling program. You can open a source file for the DLL and set breakpoints in that file, even though it is not a part of the executable file’s project.

taosi 2001-06-21
  • 打赏
  • 举报
回复
有点棘手! 应该有高人!

帮你推一下!
mate 2001-06-21
  • 打赏
  • 举报
回复
謝謝xxxbird,但是問題暫時還是沒有解決
xxxbird 2001-06-21
  • 打赏
  • 举报
回复
(1) 作为一种替代方法,可以在调试的时候使用Lib.
(2) If you want to trace Dll and EXE at the same time, you can search MSDN with keyword "dll debug"
ForApply 2001-06-21
  • 打赏
  • 举报
回复
欢迎到http://www.csdn.net/expert/topic/167/167173.shtm
mate 2001-06-21
  • 打赏
  • 举报
回复
to xxxbird:
可以讓exe直接調用dll,而無需使用.lib嗎? 我想這樣是不行的
to taosi:
如果我的dll和exe都要不斷的修改那怎麼辦呢?
xxxbird 2001-06-21
  • 打赏
  • 举报
回复
将两个Project放在同一个WorkSpace中就可以了呀。
(1) Create a new workspace. File->New->Workspaces
(2) Insert EXE Project to the workspace. Project -> Insert projects to workspace
(3) Insert DLL Project to the workspace. Project -> Insert Projects to workspace.
taosi 2001-06-21
  • 打赏
  • 举报
回复
一般是先确保DLL可以正确运行了,才调试EXE的……(我这样)

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧