when type createfile...., auto-complete just give 'CreateFileMoniker'
but CreateFile can compile and run in the .cpp
How can I set proper for auto-complete to show 'CreateFile'?
Can't find CreateFile/CloseHandle, but auto-complete can find ReadFile/WriteFile, s.b. know why?
Quote from: jsandraw on January 15, 2010, 01:53:58 PM
when type createfile...., auto-complete just give 'CreateFileMoniker'
but CreateFile can compile and run in the .cpp
How can I set proper for auto-complete to show 'CreateFile'?
I can confirm it. SVN6086
[attachment deleted by admin]
OK, I can confirm this.
This code does not work.
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
CreateFil
return 0;
}
If you open the CC Debug dialog
see http://wiki.codeblocks.org/index.php?title=Code_Completion_Design#Code-Completion_debug_tool_dialog
, you will notice that "winbase.h" is not in the CC's file list, so this is the reason.
But this code works
#include <iostream>
#include <windows.h>
#include <winbase.h>
using namespace std;
int main()
{
CreateFi
return 0;
}
windows.h should usually be enough. However, you find this section in windows.h:
#ifdef RC_INVOKED
/* winresrc.h includes the necessary headers */
#include <winresrc.h>
#else
#include <stdarg.h>
#include <windef.h>
#include <wincon.h>
#include <winbase.h>
(...)
As CC does not fully support macro handling the first case (as if RC_INVOKED would be defined) is used. Thus the references are incomplete. However, I don't know "who" usually defines this macro. It looks like the resource compiler does so at runtime (compile time).
BTW:
Concerning macro handling: One thing that could "easily" be done is the following:
Similar like we cache the internal GCC dirs we could also cache the internal macros like this:
gcc -E -dM a_dummy.c
...and similar for g++.
This could be tried to resolve when we come across a macro. We are able to identify the name of the macro already.
...just my 2 cent...
Edit: Hey, this is my 4000th posting!!! :lol: :lol: :lol:
Quote from: MortenMacFly on January 15, 2010, 03:41:03 PM
BTW:
Concerning macro handling: One thing that could "easily" be done is the following:
Similar like we cache the internal GCC dirs we could also cache the internal macros like this:
gcc -E -dM a_dummy.c
...and similar for g++.
This could be tried to resolve when we come across a macro. We are able to identify the name of the macro already.
...just my 2 cent...
Great Idea.
I have a discussion with NullWu( who supplied a script engine to handle macros, see Partial C/C++ preprocessor function for codecompletion (http://forums.next.codeblocks.org/index.php/topic,11377.msg77570.html#msg77570)), I think we can also consider it.
By the way, what does this sentence means "...just my 2 cent.."???
Also, I saw some blog about Visual C++ 10's intelligent sense. They can both handle the #if and # else statement.
Quote from: MortenMacFly on January 15, 2010, 03:41:03 PM
Hey, this is my 4000th posting!!! :lol: :lol: :lol:
Congratulation, U're the Lucky-MAN. :-)