0

At first, I made a Corba C++ Server in Win32 Console Application following this guide, and its working. From that code, I made a Corba Server in MFC.

From the C++ Win32 Server I have this code:

cout << argv[0] << ": server 'TestServer' bound" << endl;

And here the output:

C:\Users\innistrad\documents\visual studio 2010\Projects\TestServer\
Debug\TestServer.exe: server 'TestServer' bound

The content of the argv[0] is this:

C:\Users\innistrad\documents\visual studio 2010\Projects\TestServer\
Debug\TestServer.exe

So, in MFC, I made it like this:

msg = ": server 'TestServer' bound";
mDisp.SetWindowText(__argv[0] + msg);

Problem is, it's not displaying the values in the parenthesis.

But, when I do this

AfxMessageBox(__argv[0] + msg);

I am getting the output same as aforementioned.

I have tried to change the edit control to a new edit control and to a list box but to no avail. What seems to be the problem? Can anybody help?

Thanks.

Innistrad
  • 63
  • 1
  • 1
  • 7
  • We can only guess. What's `argv` and `__argv` and how do they relate? What's the type of `msg` and `mDisp`. And why the parentheses around the string literal when assigning it to `msg`? You really need to provide a [SSCCE](http://sscce.org/). When you say the you are getting the values, how did you verify this? – IInspectable Oct 24 '13 at 09:46
  • sorry, ill be editing the question and post the output also.. Thanks @IInspectable – Innistrad Oct 25 '13 at 00:41

1 Answers1

0

What is the type of variable msg Try the following

CString msgStr = ": server 'TestServer' bound";
mDisp.SetWindowText(CString(__argv[0]) + msgStr);
N3Xg3N
  • 97
  • 1
  • 12
  • Thank you @N3Xg3N for the help. The msg is CString, I declared it at the .h file and I also tried doing what you have shown but I still don't get the desired output. Again, Thank you. – Innistrad Oct 25 '13 at 00:59
  • Try this `CString msgStr(_T(": server 'TestServer' bound"));` – N3Xg3N Oct 25 '13 at 05:36
  • 1
    @ N3Xg3N, thank you. I had it fixed already. UpdateWindow() did the trick. – Innistrad Oct 25 '13 at 06:32