Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QAxBase Error calling IDispatch member occures only when Debugging without Breakpoints



  • Hello Everyone,

    I'm having a weird situation when I run the following Code

    if (ZFsolutionFile.exists())
    {
        {
    	printf("The Solution exists! Opening...\n");
    	pSln->Open(ZFsolutionFile.fileName());
     	printf("Solution is Open\n");
        }
    		
    
    EnvDTE::Projects *projects = pSln->Projects(); //Get Array of all Projects in Solution
    if (projects == NULL)
    {
           printf("ERROR: No project objects could be found.\n");
           return -1;
    }
    		
    pPrj = projects->Item(QVariant(1)); // Choose first Project of Solution
    if (pPrj == NULL)
    {
            printf("ERROR: Project object could not be created.\n");
    	return -1;
    }
    

    When I debug this Code with Breakpoints it works fine! When I run it without Breakpoints i get the following Error

    QAxBase: Error calling IDispatch member Projects: Unknown error

    Why does this occur when not using breakpoints and how to fix it ?

    Thanks in advance


Log in to reply