.h and .cpp buttons

Hi,

I remember I saw an .h and a .cpp button on someone's Visual Studio 6.0. 
  They allow you to switch from the currently edited .cpp file to its 
corresponding .h file, and vise versa.   I looked for them from the 
"customize" dialog but didn't find any close.  Could you tell me where I 
find them?  Thanks for your help.

Tony
0
jdt_young (239)
1/3/2006 9:45:14 PM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
573 Views

Similar Articles

[PageSpeed] 21

Tony Young wrote:
> Hi,
> 
> I remember I saw an .h and a .cpp button on someone's Visual Studio 6.0. 
>  They allow you to switch from the currently edited .cpp file to its 
> corresponding .h file, and vise versa.   I looked for them from the 
> "customize" dialog but didn't find any close.  Could you tell me where I 
> find them?  Thanks for your help.
> 
> Tony

I love this feature.  You need an add-in macro to do it.  This version 
gives you one button that switches between the .h and .cpp and vice versa.

Put the text below into a .dsm file in C:\Program Files\Microsoft Visual 
Studio\Common\MSDev98\Macros.

Then select the file in Tools/Customize/Macro Files.

Then select the OpenH command in Tools/Customize/Command/All Commands. 
Drag the OpenH to your toolbar.

'------------------------------------------------------------------------------
'FILE DESCRIPTION: open h file
'------------------------------------------------------------------------------

Sub OpenH()
  'DESCRIPTION: Opens the .cpp or .h file for the current document.
  'Toggles between the .cpp & .h file
         ext = ActiveDocument.FullName
         If ext = "" Then
                 msgbox ("Error, not a .cpp or .h file")
                 exit sub
         End If
         DocName = UCase(ext)

         If Right(DocName,4) = ".CPP" Then
                 fn = left(DocName, Len(DocName)-3) & "h"

         ElseIf Right(DocName,2) = ".H" Then
                 fn = Left(DocName, Len(DocName)-1) & "cpp"
         Else
                 msgbox ("Error, not a .cpp or a .h file")
                 exit sub
         End If

         'msgbox (fn)
         on error resume next
         Documents.Open (fn)
End Sub


-- 
Scott McPhillips [VC++ MVP]

0
Scott
1/3/2006 11:10:07 PM
Also King's Tools is pretty cool and includes this kind of feature.

If you are still using VS 6.0 you might want to investigate WndTabs as well.

Tom

"Tony Young" <jdt_young@yahoo.com> wrote in message 
news:usbL87KEGHA.3064@TK2MSFTNGP14.phx.gbl...
> Hi,
>
> I remember I saw an .h and a .cpp button on someone's Visual Studio 6.0. 
> They allow you to switch from the currently edited .cpp file to its 
> corresponding .h file, and vise versa.   I looked for them from the 
> "customize" dialog but didn't find any close.  Could you tell me where I 
> find them?  Thanks for your help.
>
> Tony 


0
tserface (3860)
1/3/2006 11:16:34 PM
Hi Tom,

May I know where I can get King's tools and WndTabs?  Thanks.

Tony

Tom Serface wrote:

> Also King's Tools is pretty cool and includes this kind of feature.
> 
> If you are still using VS 6.0 you might want to investigate WndTabs as well.
> 
> Tom
> 
> "Tony Young" <jdt_young@yahoo.com> wrote in message 
> news:usbL87KEGHA.3064@TK2MSFTNGP14.phx.gbl...
> 
>>Hi,
>>
>>I remember I saw an .h and a .cpp button on someone's Visual Studio 6.0. 
>>They allow you to switch from the currently edited .cpp file to its 
>>corresponding .h file, and vise versa.   I looked for them from the 
>>"customize" dialog but didn't find any close.  Could you tell me where I 
>>find them?  Thanks for your help.
>>
>>Tony 
> 
> 
> 
0
jdt_young (239)
1/3/2006 11:32:46 PM
Scotte,

I appreciate the macro so much.  I'm going to try it now.  Thanks.

Tony


"For God so loved the world, that he gave his only begotten Son, that 
whosoever believeth in him should not perish, but have everlasting 
life."  John 3:16


Scott McPhillips [MVP] wrote:

> Tony Young wrote:
> 
>> Hi,
>>
>> I remember I saw an .h and a .cpp button on someone's Visual Studio 
>> 6.0.  They allow you to switch from the currently edited .cpp file to 
>> its corresponding .h file, and vise versa.   I looked for them from 
>> the "customize" dialog but didn't find any close.  Could you tell me 
>> where I find them?  Thanks for your help.
>>
>> Tony
> 
> 
> I love this feature.  You need an add-in macro to do it.  This version 
> gives you one button that switches between the .h and .cpp and vice versa.
> 
> Put the text below into a .dsm file in C:\Program Files\Microsoft Visual 
> Studio\Common\MSDev98\Macros.
> 
> Then select the file in Tools/Customize/Macro Files.
> 
> Then select the OpenH command in Tools/Customize/Command/All Commands. 
> Drag the OpenH to your toolbar.
> 
> '------------------------------------------------------------------------------ 
> 
> 'FILE DESCRIPTION: open h file
> '------------------------------------------------------------------------------ 
> 
> 
> Sub OpenH()
>  'DESCRIPTION: Opens the .cpp or .h file for the current document.
>  'Toggles between the .cpp & .h file
>         ext = ActiveDocument.FullName
>         If ext = "" Then
>                 msgbox ("Error, not a .cpp or .h file")
>                 exit sub
>         End If
>         DocName = UCase(ext)
> 
>         If Right(DocName,4) = ".CPP" Then
>                 fn = left(DocName, Len(DocName)-3) & "h"
> 
>         ElseIf Right(DocName,2) = ".H" Then
>                 fn = Left(DocName, Len(DocName)-1) & "cpp"
>         Else
>                 msgbox ("Error, not a .cpp or a .h file")
>                 exit sub
>         End If
> 
>         'msgbox (fn)
>         on error resume next
>         Documents.Open (fn)
> End Sub
> 
> 
0
jdt_young (239)
1/3/2006 11:37:14 PM
"Tony Young" <jdt_young@yahoo.com> wrote in message 
news:usbL87KEGHA.3064@TK2MSFTNGP14.phx.gbl...
> Hi,
>
> I remember I saw an .h and a .cpp button on someone's Visual Studio 6.0. 
> They allow you to switch from the currently edited .cpp file to its 
> corresponding .h file, and vise versa.   I looked for them from the 
> "customize" dialog but didn't find any close.  Could you tell me where I 
> find them?  Thanks for your help.
>

This is part of the excellent Visual Assist X plug-in, available from 
http://www.wholetomato.com.  It's not free but I've found it well worth the 
low price.  I'm not affiliated with them.

-- David
http://www.dcsoft.com


0
dc2983 (3206)
1/4/2006 1:26:30 AM
In article <egufh6LEGHA.516@TK2MSFTNGP15.phx.gbl>, jdt_young@yahoo.com 
says...
> Scotte,
> 
> I appreciate the macro so much.  I'm going to try it now.  Thanks.
> 
> Tony

Just tried it - very nice.  (I speak as one who generally avoids macros 
and add-ins of all kinds.)

- Gerry Quinn

0
gerryq (90)
1/4/2006 11:10:50 AM
Gerry Quinn wrote:
> In article <egufh6LEGHA.516@TK2MSFTNGP15.phx.gbl>, jdt_young@yahoo.com
> says...
> > Scotte,
> >
> > I appreciate the macro so much.  I'm going to try it now.  Thanks.
> >
> > Tony
>
> Just tried it - very nice.  (I speak as one who generally avoids macros
> and add-ins of all kinds.)
>
> - Gerry Quinn

Anyone know of a VS.NET equivalent?  I tried the script in a macro, but
it had a problem with the Documents.Open (fn) statement.

0
gunblade01 (15)
1/4/2006 1:27:28 PM
http://www.codeproject.com/macro/KingsTools.asp
http://www.wndtabs.com/

Tom

"Tony Young" <jdt_young@yahoo.com> wrote in message 
news:u8YlB4LEGHA.516@TK2MSFTNGP15.phx.gbl...
> Hi Tom,
>
> May I know where I can get King's tools and WndTabs?  Thanks.
>
> Tony
>


0
tserface (3860)
1/4/2006 5:42:12 PM
Reply:

Similar Artilces:

Voting Button Tracking Issue
A number of our users rely on voting buttons for responses to questions in outlook, what has started happening recently for a partcular user is that some votes only list in Tracking as "Replied," not how they voted. Everyone is using Outlook 2003 & Exchange 2003. E-mails remain in the correct folders, Sent & Inbox, and are not being moved. Has anybody experienced this issue before? Thanks. ...

Converting time h:m to amount of time h.h%
I need to convert time (3:15- 3 hours 15 min) to amount of time in hours (3.25 hours)- what should I do? Jenn Hi! Just multiply by 24. =A1*24 Format the cell as GENERAL Biff "Jenn" <Jenn@discussions.microsoft.com> wrote in message news:FDA503A6-B164-4AD1-AA6D-4CFE15F49DF0@microsoft.com... >I need to convert time (3:15- 3 hours 15 min) to amount of time in hours > (3.25 hours)- what should I do? > Jenn http://cpearson.com/excel/datetime.htm -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL ...

Send button in Outlook
For some reason I have lost the send/recieve button on the toolbar of outlook. Have tried to access this button using the toolbar options but cannot get it back. As a result I cannot send e-mail's. Can anyone help?? Do you have an account properly configured? If all settings look correct create a new (second) profile and see if the button shows now. If it shows now you can remove your previous profile. To create a new profile (do not copy it); Control Panel-> Mail-> button Show Profiles To access your current pst-file in the new profile; File-> Open-> Outlook Data File....

debug assertion occcont.cpp line 916
Not able to use ActiveX control in `MFC Smart Device Application` project: giving debug assertion occcont.cpp line 916 Steps to reporduce the problem 1. File->New->Project 2. Selcet Visual C++->Smart Device->MFC Smart Device Application 3. Enter the project Name as "abc" 4. It will open MFC Smart Device Application Wizard Pls mention the following Platform: select Windows Mobile 5.0 Pocket PC Appilcation Settings: Dialog based Then create necessary files 5. Open the IDD_ABC_DIALOG and place Windows Media Player as an active X control onto the dialog. 6. C...

Startup button and Desktop disappeared after installing MS update
Hi All, I have been googling and trying everything I can, but I cannot get them back. Today after installing update, that is it. Startup and desktop have gone. All I can do is that CTR+ALT+DEL to open Task manager. I cannot see either explorer.exe or iexplorer.exe. I have noticed that a lot of services that even are set to Automatic cannot start, I cannot restart manually either. I have tried safe mode with different user account, it does the same thing. Wins XP SP3. Any help would be much appreciated. Vdz "vdz" <vdz@discussions.microsoft.com> wrote i...

Switchboard Button Does Not Work
I've created many switchboards in previous versions of MS Access but this is the first one I've done in Access 2007 and I've come across a problem that has not occurred before. I currently have 2 swichboards (the main one, and a secondary one that is reached via a button on the main). When the database is first opened, all the buttons work fine. However, when I run a routine that imports data and then carries out a number of validity checks on that data (again, something that I have done numerous times in the past), the button on the main switchboard that links me to the se...

? button in dialog boxes
I am using Outlook 2007. For some reason every time I click the ? next to the X in a dialog box it brings up the Outlook Help window instead of letting me click on an item in the dialog box to get context sensitive help. Is this normal or can I fix this? It depends on the application. Different programs implement help in = different ways. You've now seen how Outlook 2007 does it.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=3D54=20 "BBran&quo...

Creating a ballot with option/radio buttons in Word 2002
I need a very simple ballot with yes/no radio buttons. I have tried a dozen times, but can't get it to work. I have tried protecting it, unprotecting it, saving it as a template- can some kind person tell me step by step how to do this? I need to email the ballot and then receive the results. Thank you! You should create a protected form containing check box form fields or a dropdown field with the choices yes and no from the forms toolbar. Protect the form save it as a Word document and mail it as an attachment. See also http://www.gmayor.com/ExtractDataFromForms.htm -- ...

Making a frame visible or not using a command button
[Excel 2003] I have a userform with a frame on it The form displays some text boxes. I would like the default setting of the frame to be not visible to the user, so I can set the property as such. What I would like is to have a command button on the form which makes the frame visible : frame.visible=True?? and a command button within the frame to hide the frame frame.visible=False?? Can anyone help? Thankyou, Roger Hi Roger Copy the below code behind the userform. CommandButton1 is within the Frame and CommandButton2 is outside the frame Private Sub Comm...

Hide/Show controls based on value of radio button
I need to hide/show some controls on a form based on the value of a radio button. This is what I have so far and it doesn't seem to be working correctly. My two buttons have a value of 1 and 2 respectively. Private Sub Frame4_Click() Select Case Frame4.Value Case 1 Me.Combo15.Visible = False Me.cmdUpdateRole.Enabled = False Me.cmdEditUser.Visible = False Call ShowEditControls 'we will need the same controls as our edit form Me.txtUsername.Visible = True Call clearForm 'just in case End Sele...

Run two Query at the same time when press single button
Hi, My project is in MS Access 2002. I want to know how can I Run Two Different Queries when I press submit button? On Wed, 30 Jan 2008 10:35:41 -0800 (PST), billy_pit wrote: > Hi, > My project is in MS Access 2002. > I want to know how can I Run Two Different Queries when I press submit > button? Code the button's click event: DoCmd.OpenQuery "Query1" DoCmd.OpenQuery "Query2" -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Thanks for ur help but I already got my solution. ...

Help with buttons
How do I disable buttons within the program. That is ghost the button and not allow it to be selected till a certain action has occured? Also how do I change the default button also within the program? Bob m_BUT.EnableWindow(FALSE); -- where m_BUT is control type var. for your button. -- playwin "Bob Parr" <rparr@parrstreet.com> wrote in message news:u66rRl8CFHA.3888@TK2MSFTNGP09.phx.gbl... > How do I disable buttons within the program. That is ghost the button and > not allow it to be selected till a certain action has occured? Also how do > I change the de...

Tooltip on disabled button
Hi, When my CButton is disabled I can not see its tooltip. Is it MFC limitation ? How can I see it anyway? Yoav. As far as I know, this is not true; in fact, I rely on this behavior in some situations; when the user moves over the disabled OK button, an explanation pops up that says why the button is disabled. joe On Tue, 15 Jul 2008 10:49:46 +0300, "Yoavo" <yoav@cimatron.co.il> wrote: >Hi, >When my CButton is disabled I can not see its tooltip. >Is it MFC limitation ? >How can I see it anyway? > >Yoav. > Joseph M. Newcomer [MVP] email: newcomer...

Assertion in atlbase.h
Hi, I am getting assertion in atlbase.h at line number 4834 :- (lRes != 0L) || (dwType == (4)). how to solve this error any idea. Thanks Dev On 3 Apr 2007 08:04:40 -0700, "dev" <dev.core.mfc@gmail.com> wrote: >Hi, > >I am getting assertion in atlbase.h at line number 4834 :- (lRes != >0L) || (dwType == (4)). >how to solve this error any idea. > >Thanks >Dev Look at the assertion in context (debugger and/or source code) and figure out why lRes and/or dwType have the wrong value(s). If you're hoping someone will look it up for you, you should giv...

Voting Buttons.
Alright here is the scenario. I have a fairly large customer ( 27 PC's) that is having issues with voting buttons. They are using Outlook 2003 and do not have an exchange server. They are sending out messages that contain voting buttons and everyone is receiving them except two people. Any ideas what could be wrong? ...

Date vs h:mm:ss confusion
I have a table of approx 120 cells which contain what is supposed to be a number of hours:mins:secs but in the formula bar a date and time is shown. Example - cell shows 15:31:49. Formula is shown as 06/01/1900 07:31:49 . Cells are formatted as custom (h):mm:ss and copy/paste-special - value throws up the result 6.31376157407407 The data forms part of an exercise to graphically illustrate the number of minutes different departments spent on the phone each month using the billing spreadsheets supplied by the telephone company and I need to convert what is in each cell to a meaningful...

h h h h h h h h h h h h h h h in Outlook signatures
I created an HTML Outlook signature for our users to copy and paste into their Outlook. In some cases, the characters "h h h h h h h h h h h h h h h" are appearing in the signature; sometimes in the HTML version, sometimes when it is viewed as a text e-mail: John Q. Public 6505 Wilshire Blvd. Los Angeles, CA 90048 (323) 761-0000 • Fax: (323) 761-0000 • jqpublic@JewishLA.org www.JewishLA.org • Follow us on Twitter • Fan us on Facebook h h h h h h h h h h h h h h h There is no "h h h h h h h h h h h h h h h" in the code that they pasted into their Outloo...

How to change CFileDialog Open button text
Using VC++ 6.0... I want to use the CFileDialog to allow the user to select a file to delete. I would like to change the text of the "Open" button to "Delete". Is there an easy way to do that, or do I need to go the route of creating a new dialog template based on the common dialog and add a button there? ....mcs Meade, You can derive from CFileDialog and do all kind of stuff in the class. Johan Rosengren Abstrakt Mekanik AB "Meade Swenson" <meade@ieee.org> a �crit dans le message de news:uxrqLzn8EHA.3820@TK2MSFTNGP11.phx.gbl... > Using VC++ ...

Ctrl-H crashing Excel 2002 fixed by Office XP SP3.
In thread "Ctrl-H crashes Excel 2002", a couple of dozen threads before this one, I reported that, in Excel 2002 without Service Packs applied: After you do a search by Values (as opposed to Formulas), henceforth Ctrl-H crashes Excel. (You could prevent that by reassigning Ctrl-H to a macro.) Thanks to Mike Mendelson & Dave Peterson, I found that Office XP SP3 fixes the problem. (I don't know which SP fixed the bug--1, 2, or 3.) Now, Ctrl-H brings up the Search dialog without crashing. *** ...

Command Button to popup Public Mailbox Inbox
I have a Form in Outlook with a command button called Move To. When you click the button, I want it to popup a tree view of my Public Mailbox Inbox, where you can select a folder and then. Then when you click Ok, the value gets stored in a field. How can I get this tree view of my Public Mailbox Inbox? Is it possible? Thanks, Jon The Outlook PickFolders control doesn't let you specify which store to show or open with, it shows all loaded stores, and returns the selected MAPIFolder object. To be able to show only one or more desired stores and to open at a specific point in a spec...

ntddk.h conflict with winnt.h
hi everyone, this is killing me. i'm trying to make a .dll using the Windows ddk but everytime i try to compile i keep getting redefinition errors. i've been going through the include files, commenting out lines but there's got to be a better way to do this? am i using the wrong version? i'm using VC .NET. Note: including file: C:\WinDDK\6000\inc\ddk\ntddk.h Note: including file: C:\WinDDK\6000\inc\ddk\wdm.h Note: including file: C:\WinDDK\6000\inc\api\ntdef.h C:\WinDDK\6000\inc\api\ntdef.h(80) : warning C4005: 'MAX_NATURAL_ALIGNMENT' : macro redefinition C...

Issue with format of command buttons
Hi all..i have this odd issue..Access 2007. The layout format of the command buttons differ..and “tile”..Becoming almost double size etc etc... This especially when my database is used on a different computer then the one created in... Any one experienced this issue before? Thanks! What about the rest of the controls? Are all the computer using the same resolution? -- Hope this helps, Daniel Pineault http://www.cardaconsultants.com/ For Access Tips and Examples: http://www.devhut.net Please rate this post using the vote buttons if it was helpful. "Peter" w...

Sending e-mail with Lotus Notes pressing an excel button
How can I send a pre-written e-mail with Lotus Notes by pressing command button in Excel -- AndyOn ----------------------------------------------------------------------- AndyOne's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2021 View this thread: http://www.excelforum.com/showthread.php?threadid=37579 ...

Using a button without pressing Enter after entering data
This may seem a very basic question but I am in search of an answer. I have a CommandButton which performs a number of tasks. Is it possible to enter data into a cell and then press the button without pressing Enter after entering the data? At this point to button does not function without first pressing Enter. Again sorry if this is really simple but I can't seem to find an answer. Thanks, Jayson ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Availabl...

Macro Button #3
I need to change the background color of a button created to execute a macro and change the word wrap property to true so all of the text can be viewed on the button. Any advise is much appreciated. Thanks Hi Maggie, Assuming that the button is from the Controls Toolbox, Right-click the button | Properties Double-click the 'BackColor' option | Palette and select a color Double-click the 'WordWrap' option (to select True) Close the Properties window --- Regards, Norman "Maggie" <Maggie@discussions.microsoft.com> wrote in message news:5AAF09DB-3BFB-400...