Click here to Skip to main content
16,006,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Prblm with SDI Pin
Vikram Kashyap19-Oct-04 19:38
Vikram Kashyap19-Oct-04 19:38 
GeneralRe: Prblm with SDI Pin
balajeedurai19-Oct-04 20:21
balajeedurai19-Oct-04 20:21 
GeneralRe: Prblm with SDI Pin
balajeedurai19-Oct-04 21:29
balajeedurai19-Oct-04 21:29 
GeneralHandles! Pin
hou_12619-Oct-04 16:37
hou_12619-Oct-04 16:37 
GeneralRe: Handles! Pin
22491719-Oct-04 21:17
22491719-Oct-04 21:17 
QuestionHow to convert between ANSI and UTF-8 strings? Pin
hou_12619-Oct-04 14:52
hou_12619-Oct-04 14:52 
AnswerRe: How to convert between ANSI and UTF-8 strings? Pin
Michael Dunn19-Oct-04 15:28
sitebuilderMichael Dunn19-Oct-04 15:28 
Questionkeep a thread alive in a dll? Pin
QQrutxu19-Oct-04 13:41
QQrutxu19-Oct-04 13:41 
Hi,

I am developing a dll in C and I have one problem that I don't know how to solve...

An external application invokes my dll by calling the function:

int calculateParameters(int, int)

I need to return to the application the value "OK" indicating that the passed parameters are correct as soon as possible, and then do the needed calculations and pass the result of the calculations to the external application using a callback function.

How can I do so that after the function returns "OK", the previously created thread could continue alive and do the appropiate calculations and invoke the callback funtion?

Here is the simplified code of this dll:

// Function invoked from the external application
int calculateParameters(int a, int b)
{
_beginthread(sumParameters, 0, valorTmp); //Create a thread to calculate
if (a > b) return OK; //As soon as this function returns, the thread previously created is stopped and no calculation is done
}

//Function needed to perform the internal calculations
void sumParameters(void *valorTmp)
{
z = a + b; //Example of calculations
Callback(y); //Pass the result of the calculations to the external application
}


Thank you very much for your help
GeneralTab controls in CDialog Pin
Geoff Hunter19-Oct-04 13:39
Geoff Hunter19-Oct-04 13:39 
GeneralRe: Tab controls in CDialog Pin
pubududilena19-Oct-04 23:53
pubududilena19-Oct-04 23:53 
GeneralFull Unicode support in MBCS compiled application Pin
McTrump19-Oct-04 13:05
McTrump19-Oct-04 13:05 
GeneralMRU Files on a Lower Level Dialog Pin
Grahamfff19-Oct-04 11:07
Grahamfff19-Oct-04 11:07 
GeneralCatching the ScrollBar on Clistcontrol Pin
purshi19-Oct-04 10:58
purshi19-Oct-04 10:58 
QuestionHow to change the screen layout after resolution change? Pin
tserg19-Oct-04 10:34
tserg19-Oct-04 10:34 
GeneralVisual Strdio.NET 2003 debugger Newbie Pin
...---...19-Oct-04 10:22
...---...19-Oct-04 10:22 
GeneralRe: Visual Strdio.NET 2003 debugger Newbie Pin
Wes Aday19-Oct-04 10:38
professionalWes Aday19-Oct-04 10:38 
GeneralWMI Tutorial ? (wifi signal strength & c++) Pin
zoid ! 19-Oct-04 10:01
zoid ! 19-Oct-04 10:01 
GeneralRe: WMI Tutorial ? (wifi signal strength & c++) Pin
User 21559719-Oct-04 20:05
User 21559719-Oct-04 20:05 
GeneralPicture Control Pin
Leyu19-Oct-04 9:49
Leyu19-Oct-04 9:49 
GeneralRe: Picture Control Pin
Vikram Kashyap19-Oct-04 19:14
Vikram Kashyap19-Oct-04 19:14 
GeneralProper function declaration to avoid a memory leak Pin
georgiek5019-Oct-04 8:47
georgiek5019-Oct-04 8:47 
GeneralRe: Proper function declaration to avoid a memory leak Pin
David Crow19-Oct-04 8:56
David Crow19-Oct-04 8:56 
GeneralRe: Proper function declaration to avoid a memory leak Pin
Joaquín M López Muñoz19-Oct-04 9:06
Joaquín M López Muñoz19-Oct-04 9:06 
GeneralRe: Proper function declaration to avoid a memory leak Pin
georgiek5019-Oct-04 9:12
georgiek5019-Oct-04 9:12 
GeneralRe: Proper function declaration to avoid a memory leak Pin
georgiek5019-Oct-04 9:16
georgiek5019-Oct-04 9:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.