I've read more than a dozen pages explaining how to convert a Win32 console application into a Windows application that will run without briefly opening and closing a console window, but I'm too much of a beginner to get it to work.
For example, in VC2010 I made the two changes in the project properties described here:
convert a console app to a windows app
and changed Main to WinMain but of course got error messages from the compiler.
Following other pages, I also tried creating a console application, then, in the Win32 Application Wizard, and changing the Application Type to a Windows application, but I can't figure out what to do next. I've tried changing int Main to int CALLBACK WinMain, but of course that doesn't work either.
Is there anyone who can help a beginner with this? Here is what I think is the relevant part of my code EDIT: the complete code, for anyone who wonders what this is for, is here:
https://www.dropbox.com/s/1h8x1k2zv0lc5d1/vPasteCPlus.txt?dl=0
#include <stdafx.h>
#include <windows.h>
#include <iostream>
#include <fstream>
#include <codecvt> // for wstring_convert
#include <locale> // for codecvt_byname
using namespace std;
// helper to get path to this application
string ExePath() {
char buffer[MAX_PATH];
GetModuleFileNameA( NULL, buffer, MAX_PATH );
string::size_type pos = string( buffer ).find_last_of( "\\/" );
return string( buffer ).substr( 0, pos);
}
int main(int argc, char* argv[])
{
// get the command-line argument if any, and do various things
}
Again, apologies for this beginner question. The only experience I have with C++ is writing console applications, and any advice will be gratefully received.