0

I'm debugging a function and trying to set a breakpoint on an API call, but I'm getting a "Breakpoint will not currently be hit" message for that line. Here's the code:

bool __stdcall FileOperator::uploadDocument(char* filePath,long projectID)
    {
        char* filename="xyz.xlsx";
        char* docname="xyz.xlsx";
        long docID=0L;
        long lAttributeID=0;
        long lngAppID=aaApi_GetFExtensionApplication(L"xlsx");
        long lngWorkSpaceID=aaApi_GetWorkspaceProfileId(projectID,0);
        WCHAR strWorkingDir[_MAX_PATH];

        memset(strWorkingDir,'\0',_MAX_PATH);

        bool status=aaApi_CreateDocument(
            &docID,
            projectID,
            0,
            0,
            0,
            lngAppID,
            0,
            lngWorkSpaceID,
            convertCharArrayToLPCWSTR(filePath),
        convertCharArrayToLPCWSTR(filename),
        convertCharArrayToLPCWSTR(docname),
            NULL,
            NULL,
            FALSE,
            AADMSDOCCREF_DEFAULT,
            strWorkingDir,
            _MAX_PATH-1,
            &lAttributeID
            );
        return status;    
    }

If I try to set a breakpoint on the aaApi_CreateDocument call, I get this message:

The breakpoint will not currently be hit.  
No executable code of the debugger's target code type is associated 
with this line.
Possible causes include: conditional compilation, compiler optimizations,
or the target architecture of this line is not supported by the current 
debugger code type.

And then this line is skipped when the program runs. How can I a) set the breakpoint and b) get that line to execute?

sigil
  • 9,370
  • 40
  • 119
  • 199
  • 4
    Try setting it to the end of the call, on the line with `);`. – Daniel Frey Oct 30 '13 at 22:28
  • Ok, that did it. I thought the breakpoint was the same on any line, since it's all the same statement. – sigil Oct 30 '13 at 22:37
  • Debuggers can often only associate a single source line per statement, not a set of lines and so they usually pick the last line that the statement spans. – Daniel Frey Oct 30 '13 at 22:41

0 Answers0