Visual C++ Projects in Visual Studio 2003 .NET

  • Thread starter Thread starter Willy Denoyette [MVP]
  • Start date Start date
W

Willy Denoyette [MVP]

Abra said:
The problem seems to be the order of including headers ...

If I have this :

#include <process.h>
#include "stdafx.h"

, the compiler generates the error message.


If I have this :

#include "stdafx.h"
#include <process.h>

, the compiler compiles without errors.

Does anyone have an explanation for this behaviour ?

There is a general rule that say's #include "stdafx.h" should precede all
other includes.
But please, you might get better answers when you post such questions to the
vc NG.

Willy.
 
I have a Visual C++ Project (a C++ dynamic DLL) in Visual Studio 2003
..NET. I want to use for example the _beginthreadex() function, but I
cannot compile my code. The compiler breaks up with the message :

'_beginthreadex': identifier not found, even with argument dependent
lookup

I added the include path to to the <process.h> file in SDK in the
project options, but it does not help.
I tried also to change the project options for the "Use of MFC"
parameter to "Use standard Windows libraries" or "Use MFC in a shared
DLL", but it did not help either.
Does anybody have any hint please ?
Thanks in advance.
 
Abra said:
I have a Visual C++ Project (a C++ dynamic DLL) in Visual Studio 2003
NET. I want to use for example the _beginthreadex() function, but I
cannot compile my code. The compiler breaks up with the message :

'_beginthreadex': identifier not found, even with argument dependent
lookup

I added the include path to to the <process.h> file in SDK in the
project options, but it does not help.
I tried also to change the project options for the "Use of MFC"
parameter to "Use standard Windows libraries" or "Use MFC in a shared
DLL", but it did not help either.
Does anybody have any hint please ?
Thanks in advance.

I don't have a specific answer to your issue, but I have a suggestion for an
additional posting location if you don't get answers here in the C# (C
Sharp) group. Try posting in:

microsoft.public.dotnet.languages.vc (the C++ group)

as your question appears to be about C++.
 
Abra said:
I have a Visual C++ Project (a C++ dynamic DLL) in Visual Studio 2003
.NET. I want to use for example the _beginthreadex() function, but I
cannot compile my code. The compiler breaks up with the message :

'_beginthreadex': identifier not found, even with argument dependent
lookup

I added the include path to to the <process.h> file in SDK in the
project options, but it does not help.
I tried also to change the project options for the "Use of MFC"
parameter to "Use standard Windows libraries" or "Use MFC in a shared
DLL", but it did not help either.
Does anybody have any hint please ?
Thanks in advance.

The most likely situation is that you aren't linking with the
multi-threaded
libraries. _beginthreadex is only defined with multi-threading.

Note: This is really a C# group.

Matt
 
Make sure you are using the multithreaded CRT/MFC runtimes.

In the Project menu, C/C++ tab, category "Code Generation", the value of
Use Run-Time Library is already set to "Multithreaded using DLL", but I
still get the same error message. Or is there something else to be done
?

P.S. Sorry for continuing to post here, but I got no answer to my
question in the VC newsgroup ...
 
The problem seems to be the order of including headers ...

If I have this :

#include <process.h>
#include "stdafx.h"

, the compiler generates the error message.


If I have this :

#include "stdafx.h"
#include <process.h>

, the compiler compiles without errors.

Does anyone have an explanation for this behaviour ?
 
Back
Top