Click here to Skip to main content
14,388,814 members

C / C++ / MFC

 
QuestionRe: Calculating decimal places - Pin
CPallini16-Oct-18 3:48
mveCPallini16-Oct-18 3:48 
AnswerRe: Calculating decimal places - Pin
ptr_Electron16-Oct-18 3:55
Memberptr_Electron16-Oct-18 3:55 
GeneralRe: Calculating decimal places - Pin
CPallini16-Oct-18 4:11
mveCPallini16-Oct-18 4:11 
QuestionUsing assignment operator = for a class with const memeber variables? Pin
Member 140109547-Oct-18 13:52
MemberMember 140109547-Oct-18 13:52 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
CPallini7-Oct-18 21:36
mveCPallini7-Oct-18 21:36 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
Richard MacCutchan7-Oct-18 22:47
mveRichard MacCutchan7-Oct-18 22:47 
AnswerRe: Using assignment operator = for a class with const memeber variables? Pin
«_Superman_»9-Oct-18 2:51
professional«_Superman_»9-Oct-18 2:51 
QuestionAccess a pointer value changed in another class Pin
meerokh5-Oct-18 7:30
Membermeerokh5-Oct-18 7: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
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
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.
packageinstance.execute();
packageinstance.setHandle();//

Wait function(implemented in a different class) is as follows:
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 8:51
MemberVictor Nijegorodov5-Oct-18 8:51 
GeneralRe: Access a pointer value changed in another class Pin
meerokh5-Oct-18 9:10
Membermeerokh5-Oct-18 9:10 
GeneralRe: Access a pointer value changed in another class Pin
Victor Nijegorodov5-Oct-18 9:37
MemberVictor Nijegorodov5-Oct-18 9:37 
AnswerRe: Access a pointer value changed in another class Pin
CPallini5-Oct-18 12:28
mveCPallini5-Oct-18 12:28 
QuestionRe: Access a pointer value changed in another class Pin
CPallini10-Oct-18 0:58
mveCPallini10-Oct-18 0:58 
QuestionConversion from C to C#, Need C# Method Signature Pin
akvbsoft4-Oct-18 9:50
Memberakvbsoft4-Oct-18 9:50 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
vcbeaut4-Oct-18 17:48
Membervcbeaut4-Oct-18 17:48 
AnswerRe: Conversion from C to C#, Need C# Method Signature Pin
Victor Nijegorodov4-Oct-18 22:43
MemberVictor Nijegorodov4-Oct-18 22:43 
QuestionMake screen bigger Pin
Member 139824711-Oct-18 9:37
MemberMember 139824711-Oct-18 9:37 
AnswerRe: Make screen bigger Pin
Member 139824711-Oct-18 9:55
MemberMember 139824711-Oct-18 9:55 
GeneralRe: Make screen bigger Pin
Maximilien3-Oct-18 5:28
MemberMaximilien3-Oct-18 5:28 
GeneralRe: Make screen bigger Pin
enhzflep3-Oct-18 8:38
Memberenhzflep3-Oct-18 8:38 
JokeRe: Make screen bigger Pin
Richard Deeming3-Oct-18 11:10
mveRichard Deeming3-Oct-18 11:10 
GeneralRe: Make screen bigger Pin
David Crow1-Oct-18 10:12
MemberDavid Crow1-Oct-18 10:12 
AnswerRe: Make screen bigger Pin
Victor Nijegorodov1-Oct-18 10:20
MemberVictor Nijegorodov1-Oct-18 10:20 
GeneralRe: Make screen bigger Pin
Member 139824711-Oct-18 10:28
MemberMember 139824711-Oct-18 10:28 
GeneralRe: Make screen bigger Pin
Victor Nijegorodov1-Oct-18 10:47
MemberVictor Nijegorodov1-Oct-18 10:47 

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.