|
Hello there, some one help me ?
How can i configure my Visual Studio 8 to solve the problem indicated by the above message ?
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlbase.h(4575) : error C3861: '_beginthreadex': identifier not found
tanks for help ...
Ps: Sorry by my english, i´m Brasilian
|
|
|
|
|
You don't need to configure anything, just include the appropriate header file: procces.h (as described in the documentation[^] ).
|
|
|
|
|
See here. You are not including the process.h file.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
I am using a thread for which I am sending the below mentioned structure as parameter. pls advice
error C2440: '=' : cannot convert from 'const class abcDomain::Scope *const ' to 'class abcDomain::Scope *'
.h
declaration
virtual bool searchABCByAttributes()const;
typedef struct THREADSTRUCT_SCOPE
{
Scope *_this;
}THREADSTRUCT_SCOPE;
.CPP
bool Scope::searchABCByAttributes()
{
THREADSTRUCT_SCOPE *_param= new THREADSTRUCT_SCOPE;
_param->_this = this;
....
|
|
|
|
|
Your function is declared as constant, so it means that the this pointer is const too. And you are trying to assign it to a non-const variable, which is illegal. So, remove the constness of the function and it should be fine.
|
|
|
|
|
Missed a const in the definition of Scope::searchABCByAttributes() ?
.h
declaration
virtual bool searchABCByAttributes()const;
.CPP
bool Scope::searchABCByAttributes()
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Sorry it is my mistake, pls find below the correct one. I want keep the const, is there any work around...
.hdeclaration
virtual bool searchABCByAttributes()const;
.CPP
bool Scope::searchABCByAttributes()const
|
|
|
|
|
There's a solution but it is really ugly: you can remove the constness of the this pointer by using a const_cast. But it doesn't make any sense because you declared your function as const. Why would you do that if you remove the constness inside it ?
Another point: why are you putting the this pointer inside a structure if you only pass that pointer ? Why don't you pass it directly to your thread function ?
|
|
|
|
|
I am putting it inside sturct, Becase I want to pass it as parameter to Thread along with other attributes
|
|
|
|
|
The basic problem is you are assigning a const pointer to a non-const pointer . Well, if you want to keep the consts in the function signature, then possible get arounds are
1) Make the Scope *_this; as const. The only problem is since its a const member, you've to initialize it by constructor. So your code snippet will change like this -
typedef struct THREADSTRUCT_SCOPE
{
THREADSTRUCT_SCOPE( const Scope* ptr )
: _this( ptr )
{}
const Scope *_this;
}THREADSTRUCT_SCOPE;
And allocate it like this,
bool Scope::searchABCByAttributes()
{
THREADSTRUCT_SCOPE *_param= new THREADSTRUCT_SCOPE( this );
...
}
1) You can also use cstyle casting or const_cast to remove the constness. But its not recommended. It can be done as follows. Just FYI.
_param->_this = (Scope*)this;
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
but now I had #error WINDOWS.H already included. MFC apps must not #include <windows.h>
|
|
|
|
|
Well, thats your next compiler error to fix!
As the error says - check whether windows.h is included in your project and remove it.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
If I remove it these two error flashes
but really ";" was not missing
.h
THREADSTRUCT_SCOPE *_param;
static UINT WorkerThread(LPVOID param);
: error C2146: syntax error : missing ';' before identifier 'WorkerThread'
: error C2061: syntax error : identifier 'LPVOID'
|
|
|
|
|
Instead of windows.h , include StdAfx.h header. Add it to the beginning of file before all other #includes.
#include "StdAfx.h"
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
it gives new error, i belive some wrong ...........
ilapeeimpbatch.hh(665) : fatal error C1004: unexpected end of file found
|
|
|
|
|
1) Check the points described here - http://msdn.microsoft.com/en-us/library/4exw7xyc(VS.71).aspx[^]
2) Since the error is from header file, did you forget to put semi column after the class declaration?
If these points didn't resolve issue, please post your entire header file.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I am new to win 32 sdk programming. Please tell me how to load and display an existing bmp image file in my window which is also created dynamically.Please do help me out.
Thnx in advance.
|
|
|
|
|
|
Thnx for the help.I'll chk out the link.Thnx once again.
|
|
|
|
|
|
|
Write a C++ program that reads N numbers from the keyboard, calculates and displays the
following information.
1. sum of all positive numbers
2. average of first and last numbers
3. factorial of largest number
4. 70% of smallest positive number
5. first two numbers in ascending order
6. last two numbers in descending order
N should be declared as a constant in your program and it should be equal to the largest digit of your
student id number. eg take number as 8
The program should use the formats for inputs and outputs as given in the example below. In this
example, it is assumed that N is equal to 3 but in your program N should be equal to the largest digit of
your student id number.
Example:
Program Input
Enter 3 numbers:
Number 1: 3
Number 2: -5
Number 3: 4
Program Output:
Sum of all positive numbers: 7
Average of first and last numbers: 3.5
Factorial of largest number: 24
70% of smallest positive number: 2.1
First two numbers in ascending order: -5 3
9
Last two numbers in descending order: 4 -5
The program should contain only a main function. User defined functions and arrays should not be used
in this assignment. If you use arrays or functions, you will be penalised 25% of the total marks for the
assignment. You should also not use things which are not part of this course. You will be penalised 25%
of the total marks for the assignment, if you use things (eg. classes, linked list, etc.) which are not
covered in this course.
|
|
|
|
|
Send the rest of the homework please and do deposit something in my account. I have started working on both or ur problems
By the way do you have some SRS
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
you're an idiot.
you don't even take in account the good advices major members can have made to you earlier.
you know what ?
If you can't do your assignment yourself, Programming Computers is definitely the wrong way for you.
maybe you should consider changing of carreer now !!
|
|
|
|