Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Problem with using _beginthread in VC++ 6

Status
Not open for further replies.

alzomor

Advanced Member level 2
Joined
Jun 9, 2005
Messages
678
Helped
39
Reputation
78
Reaction score
8
Trophy points
1,298
Location
Cairo
Activity points
6,417
Hi

I am trying to use _beginthread within VC++6 .

I included process.h but I get
"error C2065: '_beginthread' : undeclared identifier"

Do you have any suggestions?

Salam
Hossam Alzomor
 

sinu_gowde

Full Member level 2
Joined
Nov 10, 2005
Messages
137
Helped
32
Reputation
64
Reaction score
12
Trophy points
1,298
Activity points
3,490
c2664 beginthread

Hi alzomor,
please checkout for these:

Code:
1) Routine Required Header Compatibility
_beginthread <process.h> Win 95, Win NT
_beginthreadex <process.h> Win 95, Win NT

Libraries:
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version
Code:
2) under project tab click settings and select c/c++, and select code
generation. and under "Use run-time library:" select "Multithreaded dll/
debug multithreaded Dll"
cheers....
 

    alzomor

    points: 2
    Helpful Answer Positive Rating

alzomor

Advanced Member level 2
Joined
Jun 9, 2005
Messages
678
Helped
39
Reputation
78
Reaction score
8
Trophy points
1,298
Location
Cairo
Activity points
6,417
_beginthread undeclared identifier

Thanks sinu_gowde

but now I get another error

error C2664: '_beginthread' : cannot convert parameter 1 from 'int (void)' to 'void (__cdecl *)(void *)'

Salam
Hossam Alzomor
 

sinu_gowde

Full Member level 2
Joined
Nov 10, 2005
Messages
137
Helped
32
Reputation
64
Reaction score
12
Trophy points
1,298
Activity points
3,490
import _beginthreadex vc++ 6.0

Hi alzomor,

Code:
You are attempting to pass a pointer to member function to
beginthread.  This doesn't work because pointers to member functions
are not the same thing as pointers to functions.
Code:
the error tells you:
you gave me a 'void (int*)' parameter but I want a 'void (__cdecl*)(void*)'
parameter.

It means that you declared your function as you stated:
void Function(int *var);

but it has to be:
void __cdecl Function(void* var);    // __cdecl added and int* became void*
Try this out...
cheers...
 

    alzomor

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top