Advertisement

Messagebox gives errors after compiler installation

Started by May 05, 2018 11:59 AM
10 comments, last by the incredible smoker 6 years, 6 months ago

Hi, i installed my compiler ( visual studio 2005 ), now i get errors in the messagebox :

somthing like : : cannot convert parameter 2 from 'char [100]' to 'LPCWSTR'

 

When installing it gave me a question about string format,

there was 5 options, the first one was Windows, so i just clicked that.

After uninstalling, and re-installing it dont gives me that question again..

 

Where can i change this setting in the options ?, or do i have to format my PC ?

thanks in advance

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor


Sounds like a genuine compiler error. If your code is reading something like
LPCWSTR myString= “some text”;
Just add a L before the string
LPCWSTR myString = L“some text”;
A LPCWSTR points to 16 bit wide Unicode characters whilst char[] (I.e. char*) points to 8 bit ANSI characters.
 
I’m not totally sure of the setting you are referring to, but you can set the character set for your project to ANSI (Multi byte) or Unicode. This setting can be found in the project properties, general character set in visual studio.
Also why are you not using a newer version of Visual Studio like 2017 community?
 
Advertisement

Thanks for the reply,

I dont wanto put a L before every text.

When installing i got the question where i chosen windows, i like to have that question/option again so my engine will work without adding L.

Not only the messagebox gives error, also the createwindow, and more maybe..

Everywhere i use normal 8 bit characters.

I used visual 2003 before, only after a bad install of blender i was not allowed in the compiler anymore, it says it is not installed for your profile.

So i have the 2005 installed.

 

Why i use it ?, because i have the professional or enterprise edition, and i still program with DX9,

why would i need the 2017 free edition ?, you are not allowed to sell anything with that, only for students.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

The easy way to deal with this problem is just to use the function MessageBoxA instead. See, MessageBox isn't a function - it's a macro. It becomes either MessageBoxA or MessageBoxW, depending on whether the compiler defines UNICODE at the time of compilation. While you can remove UNICODE from the project properties, I find it much cleaner to simply skip the macro and call the function you actually want.

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

Ah thanks, is there a A and W version for everything ?

Will try, installations are not my strongest point.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Also, Community Edition is not only for students, and you may sell your developed games/apps. Unless you are a bigger company which you from the sounds of it aren't.

It's pretty clear actually: https://www.visualstudio.com/license-terms/mlt553321/

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Advertisement

Ok, If you have a lot of other compile errors, then just set the project properties character set to multi-byte (ANSI) rather than Unicode and hopefully it will fix most of your compile errors.  This was probably the setting you had it in VS 2003?

BTW I legally sell a commercial app done in VS 2017 AND with Directx9 

Ok, that is nice.

So i have this expensive software packet, maybe i should try to sell it to a company then ?, what is it worth ?, thanks.

I also dont sell anything, it just feels good to have original software because normally i have everything hacked,

i also use old software to make music, and installing blender for 3D, version 2.76 because i work on XP.

 

I will try some options tonight and install the blender to get started and make a simple game.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Not sure vs2017 will work on xp though.

Yeah i should be happy with any software still working on XP.

The string was solved very simple by setting char option to not set.

The popup after install does not exists, it was when opening a file it asks to convert.

Everything working now, only the blender wont run on my XP, while i downloaded the 2.76 version.

 

I had more problems before the exe would work, i forgot how i solved it, its all working now.

Now i have to find out what all these settings are more to make my super simple engine go faster.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

This topic is closed to new replies.

Advertisement