Posted on July 31, 2009, 11:38 pm, by , under
Software.
Hi folks: I’m working on a service program in which I’m using named pipes to communicate with a control program. I found a really cool sample on MSDN to illustrate the concept: http://msdn.microsoft.com/en-us/libr…88(VS.85).aspx It works great, except that I can’t figure out how to stop the named pipe object right before the service is stopped. Can someone offer their ideas?
Tags:
event-dispatch,
figure-out-how,
ideas,
named-pipe,
object-right,
public-class,
really-cool,
sample-on-msdn,
someone-offer,
user,
visual c++ programming,
works-great No Comments |
Read the rest of this entry »
Posted on July 31, 2009, 11:33 pm, by , under
Software.
The following code: Code: #include <iostream> using namespace std; int main() { const int x = 11; int* xx = const_cast<int*>(&x); cout << "x = 11" << endl; cout << "x == " << x << endl << endl; *xx = 9; cout << "*xx = 9" << endl; cout << "x == " << x << endl; cout << "*xx == " << *xx << endl << endl; *(const_cast<int*>(&x)) = 6; cout << "*(const_cast<int*>(&ini)) = 6" << endl; cout << "x == " << x << endl; cout << "*xx == " << *xx << endl << endl; cout << "&x == " << &x << endl; cout << "xx == " << xx << endl; cout << "const_cast<int*>(&x) == " << const_cast<int*>(&x) << endl << endl; } Produces the following on my linux machine compiled with g++ Code: x = 11 x == 11 *xx = 9 x == 11 *xx == 9 *(const_cast<int*>(&ini)) = 6 x == 11 *xx == 6 &x == 0xbfa44e68 xx == 0xbfa44e68 const_cast<int*>(&x) == 0xbfa44e68 My question, why is what is seemingly the same address in memory reporting different values??
Tags:
const-int,
event-dispatch,
figure-out-how,
following-code,
linux,
memory-reporting,
named-pipe,
object-right,
public-class,
same-address,
seemingly-the-same,
someone-offer,
user,
using-namespace,
works-great No Comments |
Read the rest of this entry »