Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / January 2008

Tip: Looking for answers? Try searching our database.

Macro to compile a file set (cpp/h)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Torben Laursen - 07 Jan 2008 10:02 GMT
Hi

Is it possible to write a macro that compiles a file set (cpp/h).
I can find it on the menu if I right click on a cpp file but it would be
nice to just have a
macro that I could call using a shortcut.

Can anyone show me what that macro should look like?

Thanks Torben
David Lowndes - 07 Jan 2008 11:29 GMT
>Is it possible to write a macro that compiles a file set (cpp/h).
>I can find it on the menu if I right click on a cpp file but it would be
>nice to just have a
>macro that I could call using a shortcut.

In VS the normal mapped keystroke for the compile menu option (for
C/C++) is Ctrl+F7.

Dave
Torben Laursen - 07 Jan 2008 12:35 GMT
Thanks Dave, I did not see that one.

But it only works if I select the file in the solution explorer and only if
I select the .cpp file.

Isn't there a way to compile if I am in the editor for eigther the .h or
.cpp file?

Torben

> >Is it possible to write a macro that compiles a file set (cpp/h).
>>I can find it on the menu if I right click on a cpp file but it would be
[quoted text clipped - 5 lines]
>
> Dave
David Lowndes - 07 Jan 2008 13:47 GMT
>Isn't there a way to compile if I am in the editor for eigther the .h or
>.cpp file?

It should work if you're currently editing the cpp file - it always
has for me.

Dave
David Wilkinson - 07 Jan 2008 14:03 GMT
> Thanks Dave, I did not see that one.
>
[quoted text clipped - 3 lines]
> Isn't there a way to compile if I am in the editor for eigther the .h or
> .cpp file?

Torben:

I'm not sure that this is a realistic goal. Not all code is organized
into .h/.cpp pairs.

There is an old add-in that switches between the .h and .cpp files (if
any), or it can be done with Visual Assist. That is what I do.

I also add the Compile command to my build toolbar (next to the build
project button). The button is dimmed if the current file is not an
implementation file.

Signature

David Wilkinson
Visual C++ MVP

Torben Laursen - 07 Jan 2008 14:32 GMT
Ctrl+F7 works fine in a .cpp file, sorry my mistake.

I have a macro to switch between .cpp and .h.
What I was looking for was a general method to compile a file or file set
just like in C++ builder 6.0
When I worked in that compiler I jused it a lot to check my code for syntax
errors.

Torben

>> Thanks Dave, I did not see that one.
>>
[quoted text clipped - 15 lines]
> project button). The button is dimmed if the current file is not an
> implementation file.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.