Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

MoreFast Add-In for faster Development

0.00/5 (No votes)
8 Aug 2002 1  
A VS addin that does a variety of different tasks to make programming easier.

Sample Image

Why I Developed This Addin

I searched CodeProject and CodeGuru for an Add-In which will do all the basic things. But I failed. Then I decided to make one appropriate Add-Ins which would cover all small basic functions and so the story begins...

I called this utility MoreFast Add-In. Why did I call it this? Use this add-ins and see how fast and easily you can develop code. I haven't developed a lot of functionality but I am sure that whatever I developed is very useful. Because it is available in one place, lots of macros and lots of add-ins are not needed after installing this.

Functions Developed in the Add-Ins

Add Line Comments: Add line comments to selected text. If text is not selected then comments is added to current line and caret goes to next line.

Remove Line Comments: Removes line comments from selected text. If text is not selected then comments is removed from current line (if it exists) and caret goes to next line.

Add Block Comments: Add Block comments to selected text. If text is not selected then command will not executed.

/*
.... Selected Lines Comes Between This
....
*/
Remove Block Comments: Remove Block comments from selected text. If text is not selected nothing will happen.

Open Project Folder: Open project folder under which you are working. It opens a folder in the explorer window with your project directory.

Count Lines Of Project: Counts total lines (Comments,Empty and Your Code) in your current project. I took this from "Counting Lines in a MS VC++ 6.0 project By _declspec and sfynx". I am supplying LineCounter.exe with my zip file. If _declspec and sfynx has any problem, mail me. I will remove and give path to your zip files, no problem. For proper execution of this commands exe should be in a predetermined path. Please read installation topic.

Switch From H->CPP and CPP->H: This command switches files from the header to cpp and vice versa. Suppose you are working in file MyFile.h. Then execution of this command opens MyFile.cpp. It can switch both ways, so you can also switch from MyFile.cpp to MyFile.h.

Switch Case: Switch Case of Current Text Selection. If You have selected 

cDIALOG *M_mYdIALOG;

This command converts all uppercase letter to lowercase and vice versa. so your selection, after execution of this command look like this

CDialog *m_MyDialog;
Add/Remove BookMark: This command adds or removes bookmarks. All Bookmarks are added in bookmarks.bm in your project directory. So every time you open project it reads from that file and provides your bookmarks every time. This menu contains Add, Remove and bookmarks. Place the cursor at your desired line and Press Add. It display dialog box. Enter a friendly name for remembering your bookmarks. And When you press remove, It display list box with all bookmarks present. Select and Remove desired bookmark.

Format Code: This command indents selected code. This function uses Microsoft format code function (SmartFormat).

Add Code Template: This feature is the best feature of all. This is very useful. Select your code which you use most of times. Then press this button. It will ask you about a friendly name to store your template in the database. For proper usage of this function ensure the database file is in the proper folder. See Installation for further details.

Paste Code Template: This command takes all templates from database and shows you a menu with the friendly names (which you have entered). Select a Friendly name and it will paste the code at the caret position from the database.

Service Pack Version: It will show you the installed service pack for visual C++.

Shows Option Dialog: It will show you the Configuration Dialog. You can set lot of configuration of morefast...

AutoSave: This Feature implement an autosave feature. It saves at a specified time interval. I haven't implemented a Configuration Dialog. So if you want to edit the values of the autosave feature you must set it from option dialog. 

Save/Add Files In/From project: This function is useful for user who want to save whole class for future use. You can easily save files by pressing save button. It will display file open dialog. Select files which you want. Click Open button to save that files. For add files in to your project from saved files, click on addFiles Button. It will display list box with saved files. Select files to add and press add to project button.

SomeUtilities: (Updated in Ver 2.50) This Function is very useful now. It contain useful macro to paste information. when you want some code to take in to loop or in define block. Just select block and select from menu. it will place selected loop and selected code under that loop. It contains

  • Logic Constructs
  • # directive
  • High Level Templates
  • Code Fragments.

This utilities has been updated by Ronald Sanderson. Thanks to him for contributing to MoreFast. Some of this utilities are still under development.

Code Related Information

CDSAddIn::OnConnection Method:

I Register the Database with this code in the OnConnection method. If the Database is already registered, SQLConfigDataSource returns FALSE. But if the Database is not registered then it registers a database named MoreFastCT.

CString dbpath = m_filepath;
dbpath = dbpath +"\\ct.mdb";
char* szDesc;
int mlen;
szDesc=new char[256];
sprintf(szDesc,"DSN=%s* DESCRIPTION=TOC support source* DBQ=%s* "
               "FIL=MicrosoftAccess* DEFAULTDIR=%s** ",
        "MoreFastCT",dbpath.GetBuffer(1),m_filepath.GetBuffer(1));
mlen = strlen(szDesc);
for (int i=0; i<mlen; i++)
{
	if (szDesc[i] == '*')
		szDesc[i] = '\0';
}
SQLConfigDataSource(NULL,ODBC_ADD_DSN,
                    "Microsoft Access Driver (*.mdb)\0",(LPCSTR)szDesc);
This code is for the AutoSave Feature. I have copied this code from the AutoSave Add-In from CodeProject.com. I have forgotten the authors name. Sorry...
gTimer = new TimerWindow;
gTimer->setApplication(pApplication);
// This will also start the timer save events based on the initial values

gTimer->Create(NULL, "Timer Window", WS_OVERLAPPEDWINDOW & ~WS_VISIBLE);

gTimer->setPeriod(5);
gTimer->setSaveFiles(TRUE);
gTimer->setSaveWorkspace(TRUE);
If more help is needed to understand code then mail me at my contact address.

Installation Steps

  1. Unzip MoreFast.dll to any folder. Suppose you unzipped it in C:\MoreFastAddIn.
  2. Now Open Visual C++. Go To Menu Tools->Customize. In the 'Customize' dialog box click on Add-Ins and Macro Files tab. Click on Browse button. Specify path of extracted MoreFast.dll and click OK. (In my case I will browse to the  folder C:\MoreFastAddIn and specify MoreFast.dll path in that directory.)
  3. Close the customize dialog. And you are done.
  4. Open the HTML File (which is in the extracted directory) which contains some help about this Add-Ins and read it before proceeding. Please read I have spent 2 hours for it...please read...
  5. This step is not useful but I should say it. Find more and more bugs and send me. I will be very happy if bugs will arrive. It will give me inspiration to develop such utilities.
  6. Now go to your work after reading known bugs/Issues.

Known Bugs/Issues

Issues
  • Only Tested With Visual C++ 6.0.
  • Only Tested With Windows 2000.
  • Only Tested With Access 2000.
  • Error/Information MessageBox Are Not Up To The Mark.
  • It Is Not Fully Tested And Debugged.
  • Toolbar Is Not Good As Our Eye Wants To See.
  • Option Dialog Is Not Implemented In This Version Due To Time Problem.
  • You Have To Load This Addin. In Future Version I Am Thinking About Setup.exe Which Will Do All The Things.
  • If the Database Connection Fails, it displays a MessageBox, Go to the Option Dialog And Set the Database Name. (Database is stored in the path where you copied addin)

Bugs

  • It Sometimes Leaves Msdev.exe In Memory. I Haven't Seen This Often. It Will Not Leave Any Memory Leaks. I Have Checked About Memory Leaks.
  • sometimes Bookmarks.bm Is Not Created Under Project Directory. And It Will Create Problem(i Haven't Faced Yet).
  • database Is In Access So You Should Load Access Driver. In Windows 2000 , It Will Work Without Installing MSAccess.

Finally

Dear Friends,
I think I have improved a lot of Morefast. And now I think I will freeze it here. Because it will take too much time to make changes on the web . mail me for issues on: manish_ld@rediffmail.com I will try to resolve and give you binary.
VISIT My WEB : http://www21.brinkster.com/CManish

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here