Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Useful

MSVC++ 6 scripts?

This topic is 5859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to configure Visual C++ to say: automaticly make the correct declarations needed for static variables? like:
  
class Foo
{
  static float bar = 5.0f;
};
   
Ive been using java for a bit and I wish the compiler would just assume that it should write this
  
class Foo
{
  static float bar;
};

float Foo::bar = 5.0f;
   
Is there any way to program stuff like this in? I'd love something to either write the structure i need for my .cpp file when i define things in the header. I'd also love if it would move code from my header into the source file. There are tons of small little automated tasks that really irk me after having to use java... cant it look through the headers in the include files and see that if im using std::string it automaticly add #include <string> ? [edited by - useful on June 7, 2002 9:32:17 PM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
yeah the whole header/source thing is really a bother to me. The IDE should handle it all for us. It isn''t as if we are programming directly in C++ anyway, the numerous #includes aren''t C++, they''re cpp. So why not just have directive to split it for us? As it is I write it all in the header, then I copy it to the cpp, then I delete the code from the header replacing with semicolons and then I go fix the cpp.

Share this post


Link to post
Share on other sites
Ya some more intrusive MS Office type auto complete style stuff would be a very nice option.

Share this post


Link to post
Share on other sites
C++ does loads of helpful stuff, about moving everything from class to sourcefile it does.

Goto class view, right click on it & choose create Generic Class & name it whatever u want.

It then creates header file + source file with class implmented in source file & protoyped in header file.

Share this post


Link to post
Share on other sites
Im aware that I can create a generic class and I use the function, but it doesnt help me at all past that. Once I'm done creating the interface for a class, I have to go into the source and rewrite(basiclly) all the same stuff into source.

    
// header.h

#ifndef __FOO_H__ // generated by msvc++

#define __FOO_H__ // generated by msvc++
class Foo {
public:
void bar();
};
#endif



// source.cpp

#include "header.h" // generated by msvc++

void Foo::bar() {} // why cant this also be generated



[edited by - useful on June 8, 2002 7:12:26 AM]

Share this post


Link to post
Share on other sites
Has anybody else noticed how stupid this thread is?
Stop being so lazy...there isn''t any way for this to work(ATM anyway) and you''re going to have to fill in the implementation of that method anyway so all its going to save you typing is about 30 characters(+ or - depending on the args, class name, etc.)

Just do it normally.

Henrym

Share this post


Link to post
Share on other sites
quote:
Original post by henrym
Has anybody else noticed how stupid this thread is?


Yeah.

This is not VB for you. Your programming style isn''t the only one in existence. In many cases, for instance, you want to keep function code in headers.

Read your post again. Think how you would implement any of the "features" you proposed. The answer is, you can''t. If you want to code with your mouse instead of the keyboard, go use VB.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!