Hi,
there is an example by Jeffrey Richter where he has replaced _beginthreadex by his own macro.
I tried that, but it is giving error.
Here is the code- -
typedef unsigned (__stdcall *PTHREAD_FUNC) (void*);
-
#define chBeginThreadEx (psa, cbStack, pfnStartAddr,\ pvParam, fdwCreate, pdwThreadId)\
-
((HANDLE) _beginthreadex\
-
((void*) (psa),\
-
(unsigned) (cbStack),\
-
(PTHREAD_FUNC) (pfnStartAddr),\
-
(void*) (pvParam),\
-
(unsigned) (fdwCreate),\
-
(unsigned*) (pdwThreadId)\
-
)\
-
)
-
These are the errors-
line 5 - error C2062: type 'unsigned int' unexpected
line 10 - error C2059: syntax error : ')'
line 11 - error C2059: syntax error : ')'
Thanks for your time.
Cheers.
1 2137
What is the function prototype for _beginthreadex?
I don't know that it will cause any problems, but you don't want that backslash between pfnStartAddr and pvParam. Backslash should only be used to escape newlines.
line 5,8,9: replace (unsigned) with (unsigned int).
I don't know if this is really a problem, but you want to make sure that those backslashes immediately precede newline. Right now it looks like they precede a space.
Does your compiler support inline functions? I might well be better to implement this as an inline function than as a macro.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Xah Lee |
last post by:
suppose you want to do find & replace of string of all files in a
directory.
here's the code:
©# -*- coding: utf-8 -*-
©# Python
©
©import os,sys
©
©mydir= '/Users/t/web'
|
by: Roland Hall |
last post by:
I have a little test that replaces the same character with two different
values. Currently I have to process it twice. Is it possible to do it all
at once?
dim a, z
a = "a,b,c"
z =...
|
by: Edgar |
last post by:
I want to go from viewing a form (record number "x") to the same record
("x") in a report.
Of course, when I open the report, it opens to the first record, not record
"x".
I don't know VBA,...
|
by: Vittal |
last post by:
Hello All,
Here is a small C program,
main()
{
int a= 100;
float b =99.99;
TEST(a,%d);
TEST(b,%f);
|
by: Greg -- |
last post by:
Is it possible to replace html codes, such as $#63;, to the ASCII
equivalent with RegEx?
Using RegEx, I'm able to obtain the 63, but I'm unable to convert it:
Regex.Replace("?", "&#(.+?);",...
|
by: Casey |
last post by:
Hello,
Can someone give me specific code to replace text on a page using
server side javascript? I need to use server-side because I need the
output to be recognized in the final HTML so that...
|
by: DataSmash |
last post by:
Hello,
I need to search and replace 4 words in a text file.
Below is my attempt at it, but this code appends
a copy of the text file within itself 4 times.
Can someone help me out.
Thanks!
#...
|
by: TOXiC |
last post by:
Hi everyone,
First I say that I serched and tryed everything but I cannot figure
out how I can do it.
I want to open a a file (not necessary a txt) and find and replace a
string.
I can do it...
|
by: deve8ore |
last post by:
Hello,
I have built a macro to automatically go to a specific directory and a specific folder, however the names of the files I need to automatically locate change names every month.
I.e. - I...
|
by: deve8ore |
last post by:
Hello,
I receive a workbook via 3rd party containing graphs within each sheet. The workbook may contain a different number of sheets per file.
I would like to write a macro to go through each...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |