MSVC++ 6 scripts?

Started by
15 comments, last by Useful 21 years, 10 months ago
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]
Advertisement
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.
No.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Ya some more intrusive MS Office type auto complete style stuff would be a very nice option.
Being a bit curt, siaspete
quote:Original post by razmataz
Being a bit curt, siaspete


Hey Klaas :-)

You gotta admit, that anonymous post really clears up why these guys stay anonymous.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
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.
who is it that keeps on nicking WizHarD name !! :P
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]
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
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.
---visit #directxdev on afternet <- not just for directx, despite the name

This topic is closed to new replies.

Advertisement