PDA

View Full Version : class functions are not listing [ in VC++ editor]



joseph
4th April 2007, 07:42
i am working in Qt 4.2.2, using the VC++ .net versiong( 2007 ).
Here i am testing some classes using test cases .Instead of write the junk of code [testing code] in main.cpp
i created a testMacro.h, here i will write the test code as MACRO [ eg: TEST_CASE_1 ].

Then i am including this "testMacro.h" in the main.cpp.
In main.cpp i can DISABLE or ENABLE individual test or the whole test cases which is written in testMacro.h
It's working properly.

My problem is , in testMacro.h file while creating a object "myObject" of class "MyClass" [just for testing] ,
then if am puting dot [.] or arrow[->] to list the member functions.It is not listing any of the class member's



NOTE:
I have included "MyClass.h,"
The MyClass contains public members.
If am creating any "myObject" in main.cpp , it will list the member functions of "MyClass",while putting arrow or dot operator.
Why it's not working in "testMacro.h" file.


See my main.cpp


#include "MyClass.h"

int main( )
{

MyClass myObj;

myObj.foo(); // here the dot operator [.] will list the foo() automatically in VC++ editor


}


see testMacro.h


#include "MyClass.h"

MyClass myObj;
myObj.foo(); //here the editor will not show the foo()
//even after putting the dot operator [.]


#define TEST_CASE_1
/* i will attach the code " myObj.foo(); " here in the macro later */




#define TEST_CASE_2

#define TEST_CASE_3






please direct me ...if am doing anything wrong.

rajesh
4th April 2007, 08:11
have you installed qt-vsaddin-collection-2.1.3 ?

joseph
4th April 2007, 08:25
Rajesh thanks for replay.
But as u asked , in my mcahince Qt plugins are installed in VC++ properly.

But here i think , VC++ will not support code completion in .h files.
Bcause if am tring the below code in "testMacro.h"



void foo()
{
MyClass myObj;
myObj.foo(); // here the foo() is automatically listing.

}

rajesh
4th April 2007, 08:50
Joseph,
you mean foo() is automatically listing in .cpp file but not listing in .h file, right?
but for me its working similer in both file. I am using VC.Net, Visual Asist, Qt4.2.0

joseph
4th April 2007, 09:31
Exactly that's the problem.

In .cpp i can use the code completion But in .h file am not abel to do .

Could you please explain how can i enable the "code completion" in .h file with out doing like this

In testMacro.h


#include "MyClass.h"

void foo()
{
MyClaass myObj;

myObj.foo() // this will work any way

}



I am asking will this[ below code] work on ur machine
In testMacro.h


#include "MyClass.h"

myObj.foo(); // Will the foo() will automatically comes in ur machine
// If this is working properly ..plz give me the solution for this
// Any plugin support need..? plzzz let me know

rajesh
4th April 2007, 09:47
Yes it is working in my computer in both .h & .cpp

gri
4th April 2007, 10:08
Visual Assist also might help (but costs something ...) - I can't live without it ;)

joseph
4th April 2007, 11:19
Rajesh,

could you plzz tell me how i can enable that in .h file.
Any other plugin or any configration...??

If i can enabled this in .h files .it will help a lot

plzzz give me a reply

rajesh
4th April 2007, 12:43
Joseph,
I am not sure how to enable this. but can you try the following steps:
close VC++ editor
delete .opt & .ncb file
open again..