• Advertisement

Archived

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

VC++ Prob

This topic is 6548 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

Those of you with VC++ as their compiler will know that whenever you create a successful pointer to an object of a structure/class with -> or use the period and directly access it, a little popup window comes up with all of the members of the class/struct. Well I am having a problem, after I type in the "->", nothing pops up. I''m assuming that this means that the pointer to the structure was not successful. Here''s the code: (I boldfaced the part where it doesn''t work)

int GameInit
{
	if(FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
	{
		//error
		return(0)
	}

	if(FAILED(lpdd->SetCooperativeLevel(//not important
Games are the path to another dimension.

Share this post


Link to post
Share on other sites
Advertisement
Only if you have v6. v5 and under doesn''t have the code complete feature. Unless I''m missing something.

Share this post


Link to post
Share on other sites
if you have v6.0..
i know there are more reasons prolly but if the file that contains the prototype or actual function body or the datatype (like ddraw.h) is in the "External Dependencies" folder the popup containing it''s members/arguments won''t popup.

Share this post


Link to post
Share on other sites
Well... this feature is great when it works, but sometimes it simply doesn''t... occasionally it will start working again after closing visual c++ and then loading it back up again. And sometimes, some things it refuses to do this feature no matter what you do.

Torval

Share this post


Link to post
Share on other sites
really? when it doesn''t work for me it''s usually my previous post or i forgot to include it.

Share this post


Link to post
Share on other sites
The autocomplete will fail to autocomplete if you forget important things like semicolons above where you are trying to get it to autocomplete...

if(FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
{
//error
return(0)
}
if(FAILED(lpdd->SetCooperativeLevel(//not important

Notice your missing semicolon after return(0)

It will also fail if you don't get the capitalization or other things right.

I also find that I have to include the ddraw header in my project (ie. add it to the project) to get the ddraw functions to autocomplete.



Mark Fassett
Laughing Dragon Entertainment
http:\\www.laughing-dragon.com

Edited by - LaughingD on 2/15/00 7:09:32 PM

Share this post


Link to post
Share on other sites
Thanks a lot. If syntax errors will cause autocomplete to fail, then you have solved my problem. Thanks for your help, everyone. Should you come across another reason autocomplete is failing, please post it up.;-)

Share this post


Link to post
Share on other sites
Sometimes the autocomplete doesn''t work even though the code is compilable. In such cases I usually need to rebuild the whole project so that the precompiled headers are renewed.

Other times it doesn''t work simply because VC++ cannot find the declarations, usually when working with libraries and such.

Share this post


Link to post
Share on other sites
I found out the problem. I get this error which means that the struct LPDIRECTDRAW4 is not recognized although I did include ddraw.lib in my project as well as ddraw.h. Here is the error, the code is in the post "COMPILER ERROR". here is the error:

error C2501: ''LPDIRECTDRAW4'' : missing storage-class or type specifiers


Share this post


Link to post
Share on other sites

  • Advertisement