Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Little tool to disable IntelliSense
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

spacecadet
Starting Member

1 Posts

Posted - Aug 04 2011 :  04:38:40 AM  Show Profile  Reply with Quote
Hello there,

I have experimented with disabling IntelliSense.

Here is a little tool I came up with that I use to lock the NCB file before starting Visual Studio. VS then tells me it has to disable IntelliSense because it cannot write the file. The tool also truncates the NCB file to zero length to clean away earlier rubbish.

The advantages I see with it is:

a) no need to hunt for .ncb files in %TEMP% directories to lock them
b) no need to muck about in your Visual Studio Installation
c) if you find out the disabled IntelliSense actually causes some problem, you can re-enable it with no effort


// Use this tool at your own risk.
//
// The program is provided as is without any guarantees
// or warranty. Although I have attempted to find
// and correct any bugs in it, I am not responsible for
// any damage or losses of any kind caused by the use
// or misuse of the program.

#include "stdafx.h"
#include <windows.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>

int hitMe(int retval);
int hitMe(int retval)
{
    printf(retval == 0 ? "Press any key to release the file.\\n" : "Press any key to continue.\\n");
    _getch();
    return retval;
}

//int _tmain(int argc, _TCHAR* argv[])
int main(int argc, char * argv[])
{
    if(argc < 2)
    {
        printf("No file given.\\n");
        return hitMe(1);
    }

    FILE *f;
    char *fileName = argv[1];

    int fileNameLen = strlen(fileName);

    if(fileNameLen < 4)
    {
        printf("Given file '%s' is too short.\\n", fileName);
        return hitMe(1);
    }

    if(strcmp(fileName + fileNameLen - 4, ".sln") == 0)
    {
        // We leak this in the end, but do not care about it just now.
        fileName = new char[fileNameLen + 1];
        strncpy_s(fileName, fileNameLen + 1, argv[1], fileNameLen - 3);
        strcpy_s(fileName + fileNameLen - 3, 4, "ncb");
    }

    if(strcmp(fileName + fileNameLen - 4, ".ncb") != 0)
    {
        printf("Given file '%s' is neither an SLN nor an NCB.\\n", fileName);
        return hitMe(1);
    }

    errno_t e = fopen_s(&f, fileName, "w+"); // watch out, this will remove the file's content!

    printf("Locking file '%s' (open + delete content).\\n", fileName);

    if(e != 0)
    {
        printf("Watch out; fopen returned error %d.\\n", e);
        return hitMe(1);
    }

    hitMe(0);

    printf("Releasing file '%s' (close).\\n", fileName);

    if(f)
        fclose(f);

    return 0;
}


One way to use the tool is to simply open the .ncb file with it. I have actually registered it for .ncb files, so double clicking them works a charm. Alternatively you open the .sln file which will then create and lock a matching .ncb file for it (useful if there is no .ncb file around just yet).

Please let me know, if you think I am approaching all this in a bit too gung-ho a fashion.

Cheers,
Joerg

feline
Whole Tomato Software

United Kingdom
18940 Posts

Posted - Aug 04 2011 :  10:06:54 AM  Show Profile  Reply with Quote
This is an interesting idea, thank you for the post. An alternative is to simply rename the "feacp.dll"

http://docs.wholetomato.com?W133

if you wanted to automate this you could do so with a simple script or batch file, and another one to return the dll to its correct name.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000