Streamin proc for Rich edit
-
Hi I have a derived Dialog. There is a member a rich edit object. I populate the rich edit from a file. In the INITDIALOG I open the file, to do the I/O I use CStdioFile. The call back procedure is not part of an Object So for both callback proc (Reading the file) and the CDoalog Opening it. To both have access to the CStdioFile object, I declare the pointer to it not any Class, but Global The code works but maybe I shouldn't be doing it this way
-
Hi I have a derived Dialog. There is a member a rich edit object. I populate the rich edit from a file. In the INITDIALOG I open the file, to do the I/O I use CStdioFile. The call back procedure is not part of an Object So for both callback proc (Reading the file) and the CDoalog Opening it. To both have access to the CStdioFile object, I declare the pointer to it not any Class, but Global The code works but maybe I shouldn't be doing it this way
Is there a question in here? Are you wanting to know if you should use a member variable vs. a global variable?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Is there a question in here? Are you wanting to know if you should use a member variable vs. a global variable?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
Let me ask it a different way does or rather should the stream in proc be a member of a class ? Thanks
ForNow wrote:
should the stream in proc be a member of a class ?
It's not required. As long as it has this signature, it won't matter. Now depending on what you want to do with the data sent to the callback function would better determine if you needed to make it a stand-alone function, or a
static
member of a class."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
ForNow wrote:
should the stream in proc be a member of a class ?
It's not required. As long as it has this signature, it won't matter. Now depending on what you want to do with the data sent to the callback function would better determine if you needed to make it a stand-alone function, or a
static
member of a class."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles