Click here to Skip to main content
15,888,102 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Calculating decimal places - Pin
CPallini16-Oct-18 2:48
mveCPallini16-Oct-18 2:48 
AnswerRe: Calculating decimal places - Pin
ptr_Electron16-Oct-18 2:55
ptr_Electron16-Oct-18 2:55 
GeneralRe: Calculating decimal places - Pin
CPallini16-Oct-18 3:11
mveCPallini16-Oct-18 3:11 
QuestionUsing assignment operator = for a class with const memeber variables? Pin
Member 140109547-Oct-18 12:52
Member 140109547-Oct-18 12:52 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
CPallini7-Oct-18 20:36
mveCPallini7-Oct-18 20:36 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
Richard MacCutchan7-Oct-18 21:47
mveRichard MacCutchan7-Oct-18 21:47 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
«_Superman_»9-Oct-18 1:51
professional«_Superman_»9-Oct-18 1:51 
QuestionAccess a pointer value changed in another class Pin
meerokh5-Oct-18 6:30
meerokh5-Oct-18 6:30 
For synchronization purpose, I am implementing a wait function that is gonna wait until a package is executed.

I have following code in user application
C++
bool finished;
function(){
int id = createpackage(&finished);// user creates a package(basically another function) for the execution
wait(&finished)//if i need to wait for the result of above created package
// do remaining stuff
}

Inside the library(i am developing), i am trying to do this
package.cpp
C++
createpackage(bool* finished){
*finished = false;
package pack(function, arguments, finished);// this calls the constructor of package

//package contructor
package::package(){
//other memeber variables inside ctor
m_packagefinished = *finished; // As package is being created so finished = false

void package::setHandle(){
lock
//i am not sure how to set the value of finished to true so that it reflect the change when i access it in wait(). Any ideas??
unlock
}

}


In another class i am executing the package and want to set the m_finished to true after packge is being executed.
C++
packageinstance.execute();
packageinstance.setHandle();//

Wait function(implemented in a different class) is as follows:
C++
wait(bool * finished){
while(*finished == false)
yeild(); //If the package is not being executed yet, yeild to another package and execute it
}

The problem is that how can i get the correct value of finished inside the wait function.
AnswerRe: Access a pointer value changed in another class Pin
Victor Nijegorodov5-Oct-18 7:51
Victor Nijegorodov5-Oct-18 7:51 
GeneralRe: Access a pointer value changed in another class Pin
meerokh5-Oct-18 8:10
meerokh5-Oct-18 8:10 
GeneralRe: Access a pointer value changed in another class Pin
Victor Nijegorodov5-Oct-18 8:37
Victor Nijegorodov5-Oct-18 8:37 
AnswerRe: Access a pointer value changed in another class Pin
CPallini5-Oct-18 11:28
mveCPallini5-Oct-18 11:28 
GeneralMessage Closed Pin
9-Oct-18 23:31
Henry John9-Oct-18 23:31 
QuestionRe: Access a pointer value changed in another class Pin
CPallini9-Oct-18 23:58
mveCPallini9-Oct-18 23:58 
QuestionConversion from C to C#, Need C# Method Signature Pin
akvbsoft4-Oct-18 8:50
akvbsoft4-Oct-18 8:50 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
vcbeaut4-Oct-18 16:48
vcbeaut4-Oct-18 16:48 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
Victor Nijegorodov4-Oct-18 21:43
Victor Nijegorodov4-Oct-18 21:43 
QuestionMake screen bigger Pin
Member 139824711-Oct-18 8:37
Member 139824711-Oct-18 8:37 
AnswerRe: Make screen bigger Pin
Member 139824711-Oct-18 8:55
Member 139824711-Oct-18 8:55 
GeneralRe: Make screen bigger Pin
Maximilien3-Oct-18 4:28
Maximilien3-Oct-18 4:28 
GeneralRe: Make screen bigger Pin
enhzflep3-Oct-18 7:38
enhzflep3-Oct-18 7:38 
JokeRe: Make screen bigger Pin
Richard Deeming3-Oct-18 10:10
mveRichard Deeming3-Oct-18 10:10 
GeneralRe: Make screen bigger Pin
David Crow1-Oct-18 9:12
David Crow1-Oct-18 9:12 
AnswerRe: Make screen bigger Pin
Victor Nijegorodov1-Oct-18 9:20
Victor Nijegorodov1-Oct-18 9:20 
GeneralRe: Make screen bigger Pin
Member 139824711-Oct-18 9:28
Member 139824711-Oct-18 9:28 

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.