|
I have code that writes to a console but I can't see the console because it is a windows forms application i'm writing
|
|
|
|
|
I'm confused. If you are already writing to the console window, can't you just write the same text to some other location (e.g., a form)?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The code that writes to the console is to connect to a server and I don't want that to be shown on the form for the user to see but in the background in a console. It connects to the server fine but just doesn't display in a console window.
|
|
|
|
|
gman2008 wrote: The code that writes to the console...
How are you doing this?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I've wrote an interface using windows forms and when the user clicks a button on the menu then this executes code from another class that connects to a server. The code that connects to the server was originally a console application and I have incorporated that code into the interface.
I appreciate your help but I don't want to waste your time as I think this is not that important.
|
|
|
|
|
So what is it that you are expecting to be written to the console window?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This is what I expect to see in the console window:
PANGU Protocol Library Tester by Martin N Dunstan
Getting image 'zoom_000.ppm'
Getting image 'zoom_001.ppm'
Getting image 'zoom_002.ppm'
Getting image 'zoom_003.ppm'
Getting image 'zoom_004.ppm'
Getting image 'pitch_000.ppm'
Getting image 'pitch_001.ppm'
Getting image 'pitch_002.ppm'
Getting image 'pitch_003.ppm'
Getting image 'pitch_004.ppm'
Getting image 'roll_000.ppm'
Getting image 'roll_001.ppm'
Getting image 'roll_002.ppm'
Getting image 'roll_003.ppm'
Getting image 'roll_004.ppm'
Getting image 'yaw_000.ppm'
Getting image 'yaw_001.ppm'
Getting image 'yaw_002.ppm'
Getting image 'yaw_003.ppm'
Getting image 'yaw_004.ppm'
Getting image 'fov_005.ppm'
Getting image 'fov_010.ppm'
Getting image 'fov_020.ppm'
Getting image 'fov_040.ppm'
Getting image 'fov_080.ppm'
Getting image 'sky_0.ppm'
Getting image 'sky_1.ppm'
Getting image 'sky_2.ppm'
Getting image 'sky_3.ppm'
Getting image 'sky_4.ppm'
Getting image 'sky_5.ppm'
Getting image 'orange_sun.ppm'
Getting image 'green_planet.ppm'
Camera position = (192.257004, 192.257004, 126.785004)
Camera attitude = (yaw 135.000000, pitch -10.000000, roll 0.000000
Elevation above the surface = 113.580620m
Position on surface below camera = (192.257004, 192.257004, 13.204384
Elevation above the surface = 113.580620m
Pixel (0.500000, 0.100000) has position (-5.694656, -5.694656, 13.117
Elevation at <192.3, 192.3, 126.8> = 113.580620
Elevation at < 10.0, 10.0, 300.0> = 287.761566
Elevation at < 10.0, -10.0, 300.0> = 286.706177
Elevation at <-10.0, -10.0, 300.0> = 286.901917
Elevation at <-10.0, 10.0, 300.0> = 288.203522
Elevation at < 0.0, 0.0, 300.0> = 287.099243
Getting image 'trash.ppm'
Performing multiple LookupPoint() requests:
Model under pixel <0.500000, 0.100000> = < 84.9, 84.9, 12.0>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <1.000000, 1.000000> = <-417.3, -163.6, 6.4>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Model under pixel <0.500000, 0.900000> = <-144.4, -144.4, 17.7>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Performing one LookupPoints() request:
Model under pixel <0.500000, 0.100000> = < 84.9, 84.9, 12.0>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <1.000000, 1.000000> = <-417.3, -163.6, 6.4>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Model under pixel <0.500000, 0.900000> = <-144.4, -144.4, 17.7>
Model under pixel <0.000000, 0.000000> = <128.7, 63.9, 12.9>
Model under pixel <0.500000, 0.500000> = < 17.9, 17.9, 11.8>
Model at < 0.0, 0.0, 12.9> along <0.000000, 0.000000, -1.000000>
Model at <-59.3, 118.5, 7.3> along <-0.100000, 0.200000, -1.000000>
Model at <293.1, 117.2, 13.8> along <0.500000, 0.200000, -1.000000>
No model along <0.500000, 0.200000, 1.000000>
|
|
|
|
|
I don't want this information to be displayed to the user on the form but as a background job in a windows console.
I'm just not sure why the console is not showing up.
Even if I just write a simply command in the form as:
<br />
Console::WriteLine(L"Hello");<br />
A console is not shown with the word Hello.
Sorry I’m going to be offline now and won’t be on until tomorrow. I would to thank you for looking into helping me with this problem.
|
|
|
|
|
gman2008 wrote: Console::WriteLine(L"Hello");
Is this VC++? Managed?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have a Visual C++ book that has windows forms in it but I think it goes under managed
|
|
|
|
|
So you might want to re-ask your question here. There are several ways to spawn a console window and write to it, so I can only surmise that managed vs. unmanaged code handles it differently under the covers.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Visual Studio VC++ 6 development system worked fine so far on Windows XP computer, but now on my Windows Vista class wizzard looses classes and on laucnh and each compilation session there a message appears of incompatibility with Windows Vista. How can I solve this problem ?
|
|
|
|
|
André Dewispelaere wrote: ...each compilation session there a message appears of incompatibility with Windows Vista.
Have you searched for the exact error message?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
André Dewispelaere wrote: How can I solve this problem ?
turning off UAC solves the compilation warnings.
class wizard has always been a little forgetful, regardless of OS, so i didn't notice any change in Vista.
|
|
|
|
|
Dear all:
I am trying to use the hash_map in C++ in VS2005.NET.
The code is like:
<br />
#include <hash_map><br />
...<br />
...<br />
hash<const char*=""> H;<br />
size_t h = H("ca");<br />
</const></hash_map>
I want to generate the hash value for the string. This code works perfectly in Linux but in VS2005 it complains that:
1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(54) : error C2065: 'hash' : undeclared identifier
1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(55) : error C3861: 'H': identifier not found
It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please?
Thanks
Asura
|
|
|
|
|
Ming Luo wrote: It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please?
Does the hash_map file exist? Can the compiler find it? If you right-click the #include statement, can you opt to open the file?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Does the hash_map file exist?
Indeed it exists (at least on my system, VS2005). On the other there's no hope to find the hash class itself (again, on my system).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hello everyone,
I listed for scenarios. I think case 1, 2 and 4 are object's destructor is called during stack unwinding caused by exception. Scenario 3 is not stack unwinding and it is normal function return (not exception) triggers the destructor of the object.
Scenario 1:
try{
local object defined;
exception throws;
} catch ()
{
catched;
}
Scenario 2:
try{
local object defined;
exception throws;
} catch ()
{
not catched;
}
Scenario 3:
local object defined;
try{
exception throws;
} catch ()
{
catched;
}
Scenario 4:
local object defined;
try{
exception throws;
} catch ()
{
not catched;
}
thanks in advance,
George
|
|
|
|
|
Hello!
Following problem:
GetComputerNameEx called with parameter ComputerNamePhysicalDnsHostname didn't return the DNS name - it returns the NETBIOS name.
Do you have an idea whats wrong with the code??
Thanks in advance.
Greetings
Amd Opteron
Here is the code:
#define _WIN32_WINNT 0x0501
#include <cstdio>
#include <cstdlib>
#include <windows.h>
#include <tchar.h>
int _tmain(int argc, TCHAR *argv[]) {
TCHAR szHostname[MAX_COMPUTERNAME_LENGTH + 1];
TCHAR szHostname2[MAX_COMPUTERNAME_LENGTH + 1];
TCHAR *szDnsName;
DWORD dwSize;
GetComputerName(szHostname, &dwSize);
GetComputerNameEx((COMPUTER_NAME_FORMAT)ComputerNamePhysicalDnsHostname, NULL, &dwSize);
szDnsName = new TCHAR[++dwSize];
GetComputerNameEx((COMPUTER_NAME_FORMAT)ComputerNamePhysicalDnsHostname, szDnsName, &dwSize);
dwSize = sizeof(szHostname2) / sizeof(TCHAR);
DnsHostnameToComputerName(szDnsName, szHostname2, &dwSize);
_tprintf(_T("'%s'\n'%s'\n'%s'\n"), szHostname, szDnsName, szHostname2);
delete[] szDnsName;
return EXIT_SUCCESS;
}
|
|
|
|
|
The code works with me, and it returns the name of my computer.
Whether the Netbios-name is any different from the DNS-Hostname is determined by your administrator.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
amdopteron wrote: GetComputerNameEx called with parameter ComputerNamePhysicalDnsHostname didn't return the DNS name - it returns the NETBIOS name.
It simply returns the name that was established at system startup, when the system read it from the registry. That must be the NetBIOS name in your case.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This should be the corresponding registry key:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"Hostname"="your-hostname"
On my machine stands there the NetBIOS name and NOT the DNS name.
Do you know a way how to tell Windows to set this key to the proper value?
|
|
|
|
|
amdopteron wrote: Do you know a way how to tell Windows to set this key to the proper value?
Unfortunately no, as I'm not familiar enough with NetBIOS and DNS. What does gethostname() do for you?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
gethostname() from the WinSock library also returns the NetBIOS name...
Any idea?
|
|
|
|
|
class CCombObj : public CObject <br />
{<br />
public:<br />
DECLARE_SERIAL( CCombObj )<br />
<br />
class CProCombObj : public CCombObj
modified 13-Mar-13 6:01am.
|
|
|
|
|