-1

I have placed a CMFCLinkCtrl - (control to show the links in the dialog frame) in my modal dialog box application which works perfectly. upon setting the SetURL("www.google.com") it could able to invoke it.

When i do the same in a dll (dialog box is part of dll) and when the user clicks the control, it is throwing an runtime exception and i could not able to debug it.

I have two questions, can we use the CMFCLinkCtrl controls inside a dll based out of dialog box? if so, how to debug and find the issue?

error Image: Exception window

Call stack

thanks, Saravana

Saravana
  • 595
  • 1
  • 6
  • 15
  • 1
    *"i could not able to debug it"* - Why? Someone threatening you to **not** click the *Break* button? You dereference a null pointer. There's nothing more we can do to help. – IInspectable May 04 '17 at 07:52
  • I can do that, it is taking me to the place where I have called the DoModal() and not the exact place where the exception is. Like when i click the Lunk url button it has to call shellexecute command and open a window with the link i have set in SetURL()... – Saravana May 04 '17 at 07:59
  • 1
    The exception is raised in *mfc140u.dll*. You have full source code for that module. Ask a developer to set up your development machine. – IInspectable May 04 '17 at 08:32
  • I'm using VS2015 update1 - and the redist is 14.0.23506, where can i download redist for 14.0.24720.00 – Saravana May 04 '17 at 08:51
  • i have used PDBDownloader and got the pdb file for mfc140u.dll and able to load the entire call stack... It is failing in hWnd is seams to be unused=??? is it that? – Saravana May 04 '17 at 12:47
  • it is failed at void CCmdTarget::BeginWaitCursor() { AfxGetApp()->DoWaitCursor(1); } // this line – Saravana May 04 '17 at 12:52

1 Answers1

0

At some time I have removed the code

CWinApp theApp

from the dll implementation, since I'm not using it. That's the reason behind this error. When I added it back it is able to invoke the URL.

As I have mentioned it is get struck in the below line, just explored more on why the failure of AfxGetApp() and found this reason.

void CCmdTarget::BeginWaitCursor() AfxGetApp()->DoWaitCursor(1)

Saravana
  • 595
  • 1
  • 6
  • 15
  • used this post to download the PDB downloader - thanks for the support http://stackoverflow.com/questions/37391637/are-the-vs2015-64-bit-mfc-symbols-on-the-microsoft-symbol-server – Saravana May 04 '17 at 14:06