Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

Problem with using _beginthread in VC++ 6

Status
Not open for further replies.

alzomor

Advanced Member level 2
Advanced Member level 2
Joined
Jun 9, 2005
Messages
674
Helped
39
Reputation
78
Reaction score
8
Trophy points
1,298
Location
Germany
Activity points
6,406
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
 

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
_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
 

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top