473,384 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,384 software developers and data experts.

Win32

Hello everyone!

When I start a "Win32 Project" with Microsoft's Visual C++ I can't
produce any output by using my "normal" C++ code that I would use in a
console application. First, I'm not sure if i place my code in the
right position, but I think I'm right as I don't get any error
messages and the comments by Visual C++ tell me the right place:

-----------------------------------------------------------------------------------

[...]

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

// TODO: Place code here.

cout << "This is a test!";

[...]

}

[...]

-----------------------------------------------------------------------------------

When I compile this I just get an empty win32 window, and there's
nowhere written "This is a test!". I also included all necessary
header files, and didn't change nothing from the "main code" already
written by Visual C++, I just added "cout << "This is a test!" ".

Flingor

Aug 6 '07 #1
4 1828
fl*****@gmail.com wrote:
Hello everyone!
You have come to the wrong place, try a windows programming group.

--
Ian Collins.
Aug 6 '07 #2
fl*****@gmail.com wrote:
When I start a "Win32 Project" [...]
It's a sad feature of MS Windows: when a program uses GUI, output to console
is hidden. The same happens with Java Swing programs.

Aug 6 '07 #3

Alf P. Steinbach <al***@start.nowrote in message...
* fl*****@gmail.com:
Hello everyone!
When I start a "Win32 Project" with Microsoft's Visual C++ I can't
produce any output by using my "normal" C++ code that I would use in a
console application. First, I'm not sure if i place my code in the
right position, but I think I'm right as I don't get any error
messages and the comments by Visual C++ tell me the right place:
--------------------------------------------------------------

[...]

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow){
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.

cout << "This is a test!";

[...]
}
[...]
-------------------------------------------------------------------
When I compile this I just get an empty win32 window, and there's
nowhere written "This is a test!". I also included all necessary
header files, and didn't change nothing from the "main code" already
written by Visual C++, I just added "cout << "This is a test!" ".

Answer's too long to include here (although it's likely that others will
provide technically inaccurate and misleading short answers);
You mean like:

// in main() or ?

MessageBox( 0, "This is a test!", "Hello World",
MB_OK | MB_ICONINFORMATION );

--
Bob <GR
POVrookie
Aug 6 '07 #4
On Aug 6, 1:41 pm, Manuel T <man...@t.govwrote:
flin...@gmail.com wrote:
When I start a "Win32 Project" [...]
It's a sad feature of MS Windows: when a program uses GUI, output to console
is hidden. The same happens with Java Swing programs.
Are you kidding? When I was developping a Java Swing
application under Windows, we regularly output debugging
messages to the standard out or standard error. No problem.

Alf's got an exceptionally good page on this; regretfully, I
don't have the URL on this machine, but maybe he'll cite it
again for us. I'd consider it required reading for anyone doing
Windows programming.

--
James Kanze (GABI Software) email:james.kanze:gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Aug 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RL | last post by:
Hi all, I am new and am lost with Win32::Process stuff. I want on perl script to start a process, then another perl script to terminate the same process. I can start a process using......
2
by: RL | last post by:
Hello Perl gurus, 1. I have a web page where I can push a button (dospawn.html). 2. This button calls a CGI script (spawnboss.cgi) 3. spawnboss.cgi calls a forking perl script (forkme.pl) 4....
5
by: Bryan Parkoff | last post by:
Please provide me the information when it is not in the correct newsgroups. I have been using C and C++ language for a long time when it is time for me to learn Win32 API functions that they can...
2
by: Tony Johansson | last post by:
Hello!! When you for example use C++.net environment for develop an GUI application does this mean that you doesn't use win32 API as much as when you had visual studio 6.0 because of the large...
8
by: Tony Johansson | last post by:
Hello! I just wonder what the difference is between a native win32-app and MFC. What I know is that you can use Win32 API in both cases. I think an MFC application is connected with a GUI...
3
by: Gil | last post by:
I need to create a web page in which its content should be controlled by some win32 application. this application may add or remove some gif images from the page and it should be smooth as possible...
0
by: =?Utf-8?B?Q29saXZpZXI=?= | last post by:
If anyone can help me with this I would really appreciate it: I have an assembly into which I have linked a manifest file as a Win32 resource. This is necessary since I want to use a class in this...
0
by: jbenezech | last post by:
Hi all , I have a perl/java app running under Win32. The application consists of a perl service (Win32::Daemon) and of java classes. The perl service calls every xx hours java classes to perform...
3
by: somuchh8 | last post by:
Hi, I'm having a lot of trouble with the Win32::Spawn module in perl. Here is my situation, I have a Win32::Spawn call which looks like this: my $success = undef; my $cmdline =...
6
by: Perl Beginner | last post by:
Good morning all, I had to reinstall Perl (ActivePerl 5.10.0 Build 1004) on my computer (Windows XP), the install went fine. however, I'm having issues loading Win32-GuiTest using the repository in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.