|
I have an MFC DLL project written in VS2003. I upgraded it to VS2005 SP2 and successfully build the DLL, despite setting the project options to use the projects .PDB I am unable to debug the DLL.
I was able to debug happily with VS2003 but CANNOT debug with VS2005! I have rolled back to VS2003 as until I can debug I will not be using VS2005.
Has anyone else had this problem with VS2005, and did you manage to debug a DLL?
|
|
|
|
|
Check that your VS finds a dll with all the debug informations.
I debug VS2003 dlls with a VS2005 exe sometimes.
Greetings from Germany
|
|
|
|
|
Yes, the projects .PDB file is output to the same folder in which my debug DLL is located as well as the EXE being run from which the DLL is called.
I can debug the VS2003 version of the DLL fine, just when I convert the DLL project to VS2005 and build in debug mode I cannot debug. I have even set the Debuggong | Symbols | location to the path to the <projectname>.pdb, but alas not able to hit my breakpoints!
I am sure there is a bug in VS2005 being unable to debug MFC DLL's!!! But would welcome anyone who has managed to debug an MFC DLL in VS2005.
|
|
|
|
|
Andy H wrote: I am sure there is a bug in VS2005 being unable to debug MFC DLL's!!!
Visual Studio will always have its problems, but that isn't one of them.
I would clean the solution and shut down VS. Then delete ALL intermediate files
including pdb, ilk - everything. Get rid of the Intellisense database as well.
Fire up VS and do a full rebuild. If it still won't work, you've got a project settings
issue somewhere.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks, I'll give it a go.
|
|
|
|
|
I have two click events in my application. One is for open and read a file.
<br />
void CSRFDBDlg::OnBnClickedRead()<br />
{<br />
char * FilePath = "ReadFile.txt";<br />
CFile FileRead;<br />
<br />
if(FileRead.Open(FilePath, CFile::modeRead))<br />
{<br />
}<br />
}<br />
On next click event browse the file,
<br />
void CSRFDBDlg::OnBnClickedCtrl()<br />
{<br />
CFileDialog dlg( true, NULL, _T("*.*"), OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR, "textfiles(*.*)|*.*|*.*" );<br />
if(dlg.DoModal() != IDCANCEL)<br />
{<br />
<br />
CString filename = dlg.GetPathName();<br />
CBrowsePath.SetWindowText(filename);<br />
}<br />
}<br />
Now what I want to do is connect the "filename" with "FilePath" and connect them together. How should I do that. I worried because FilePath is used as char pointer.
I appreciate your help all the time...
Eranga
|
|
|
|
|
You can use a member variable to hold the data, and cast to the type of variable you need in every step.
I have used CString in both ways, with CFile and with CFileDialog and had no problems with it.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
You mean that file path should set using a CString?
I appreciate your help all the time...
Eranga
|
|
|
|
|
you can define your variable as
CString FilePath in your class CSRFDBDlg and can use them in both the click events.
any more clarifications required?
good luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Can you explain how can I do it with my code.
Can I do it by replacing char * FilePath from CString filename . Have to declared it as a global variable? right...
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: Can I do it by replacing char * FilePath from CString filename
yes you can.
global variable will also do. but defining it in the class will be better.
good luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
I don't say, "should" or "must". I say "can"
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I got it, use a globally defined CString to hold the path and use. But now I have another question. On my browse path class it gives the path like in following format.
G:\Work On\CPP\SRFDB\ReadFile.txt
It gives a runtime error. Immediately after \ sign, it check it as a Escape Sequence. But it not found. That mean I want change the path as follows,
G:\\Work On\\CPP\\SRFDB\\ReadFile.txt
How can I go it.
I appreciate your help all the time...
Eranga
|
|
|
|
|
CString::Find (..);
CString::InsertAt (...);
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi,
I have this VC++ application through which i invoke help files by pressing F1 key. But when i modified the help files(both .cnt and .hlp through ROBOHELP)and included these new help files, F1 is no longer working though i can see Table of Contents. Am i missing any mapping somewhere?? Please suggest.
Thanks,
Aparna
|
|
|
|
|
Had those changes something to do with the structure of the help? Maybe you made a change that allows you to see the table of contents, but made a problem with the indexation of the direct access to a part of the help.
I hope you understand what I try to mean
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi,
Thanks for the reply!!
The application is actually an installable.Its installed in the machine...Now I just added a bit of text to some part of the Contents and recompiled the help files and then copied the new files in program files->application folder.Should i be compiling the program too??
Thanks,
Aparna
|
|
|
|
|
I am not sure, but a try will not damage you, won't it? I was just suggesting something that I thought about. I have not much knowledge about the help files. I will start coding them soon, but I have never used it yet.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi,
First of all, sorry if it is longer than needed. I want to explain me well.
After reading NSIS docu. I have made 3 different installators to test.
One is following this schema[^] I just changed/edited what the autor of that script tells.
Another one with the NSIS-Wizzard.
And another one trying my own script.
All worked installing/uninstalling files, but all of them give me an error with the association of the extension/documents with my application. (After every installation I run 2 different registry cleaners and search through registry to try to have it clean from my application/extensions/documents).
I some time ago asked[^] about associating application with extension and David Crow gave me following answer:
<br />
HKCR\.fs = Nelek.Document<br />
HKCR\Nelek.Document\shell\open\command = NELEK.EXE %1<br />
HKCR\Nelek.Document\shell\open\ddeexec = [open("%1")]<br />
HKCR\Nelek.Document\shell\open\ddeexec\application = NELEK<br />
HKCR\Nelek.Document = Nelek Document <br />
After executing my installator. I have checked the registry and I had following. NOTE: Nelek = FPS (the name of my app)
<code>HKCR\.fs = FPS.Document</code>
HKCR\.fs\ShellNew -> (Standard) REG_SZ (Value not given)
HKCR\.fs\ShellNew -> NullFile REG_SZ
;
HKCR\Applications\FPS.exe\shell\...
HKCR\FPS.Document-> (Standard) REG_SZ FuzzyProjektierungsSystem
HKCR\FPS.Document\DefaultIcon-> (Standard) REG_SZ C:\PROGRA~1\FPS\FPSII.exe,1
HKCR\FPS.Document\shell\open\command -> (Standard) REG_SZ C:\PROGRA~1\FPS\FPSII.exe /dde
<code>HKCR\FPS.Document\shell\open\ddeexec-> [open("%1")]</code>
HKCR\FPS.Document\shell\...
;
;
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.fs -> Empty
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.fs\OpenWithList->a REG_SZ FPSII.exe
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.fs\OpenWithList->b REG_SZ FPS.exe (An old version, it wont be used at all)
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.fs\OpenWithList->MRU REG_SZ ab
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.fs\OpenWithProgids->FPS.Document REG_NONE (Binary value of the length NULL)
;
;
HKLM\SOFTWARE\Classes\.fs->(Standard) REG_SZ FPS.Document
HKLM\SOFTWARE\Classes\Applications\FPSII.exe\shell\... "open, print, printto" with same values as above
HKLM\SOFTWARE\Classes\FPS.Document\... The same as above in HKCR\FPS.Document
And the problem I have is: After a installation, I look for a file made with my program (extension *.fs) I double click on it and all is ok JUST ONCE (the first time I do it). When I close the programm and try double click on a *.fs file, It comes a ErrorDialog with the following text (translating from german, sorry if the message sounds different):
<br />
"PATH_AND_FILENAME.fs" could not be found. Ensure that the name was correctly given and repeat the operation. Click on "Start" and on "Search" option to look for files<br />
After closing this dialog, my programm opens itself but without document, and when I close the programm I get the Windows Dialog that the programm has found an error and must be closed with "Send Report to windows", "not send" and "Debug" buttons.
Clicking in Debug, the VStudio opens, gives me "Not contempled Assertion in FPSII.exe (MFC42.DLL):0xC00000005: Access violation" and jumps to the following line of code:
73DC8F5A cmp dword ptr [eax+10h],5
I think this is due to the Release version.
The main question is: Why the hell is working the first time after an installation and pissing me off up to the second time?
and, about the registry entries...
Question 1: FuzzyProjektierungsSystem is what I gave into wizard long time ago, when I created the project. I guess it was not a good idea, should I change it? if yes... how? Or just, create a new project, create the classes and copy paste all code into them?
Question 2:
David told me "NELEK.EXE" so in relative path, and what I have (with the 3 installs from NSIS) in the registry is in absolute path. Is it an important difference? Should I try to change it in the NSIS script? (a bit info about if change is needed would be nice, 3 different versions do it in that way)
Question 3:
Which is the function of David's answer missing line? Must I include it?
OFFTOPIC: Damned installations, and this is with a tool that most people recommends. I don't want to think about if I should make my own installator :S
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I'm using VS6.0.
I was going through the code which was written nearly 3 years before. I have seen one statement like said in the subject
DWORD dw='pp';
I was not aware that is a valid statement.
And still I'm not clear what will be the value of dw. I calculated if it is equivalent to ('p'<<8 + 'p') but no success.
Can some kindly clarify me on whether two characters in single cotes is valid in C/C++ or it is valid only in VC++. If valid in VC++, how would the value is calculated for the literal in two cotes.
regards,
Pratap
|
|
|
|
|
'pp' is not a valid character, but AFAIK, it is understood as if it were the first character written solely : 'p'
so, you DWORD contains the ascii code of 'p', chis is 112 (0x00000070)
|
|
|
|
|
No!
The DWORD value is coming as 28784 in my machine
|
|
|
|
|
so, that is 0x7070... strange, but quite logical if we know that 'p' is 0x70
|
|
|
|
|
I'm sorry There was a mistake in calculating the value of 0x7070 in decimal format.
The value is 0x7070 only!!
Thanks a lot for your support!!
could you kindly specify that the statement DWORD dw='pp'; is valid in all platforms!!
I'm googling for it, but no success!!
|
|
|
|
|
toxcct wrote: 'pp' is not a valid character,
it is a valid (though discouraged) multicharacter constant , see [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|