Jump to content

I have a few questions involving C++ and Visual studio.

mattonfire

Anyone know why forms is doing this as soon as I started up, before I even started editing?

https://linustechtips.com/main/uploads/monthly_2016_06/Untitled.png.df8fe73070d9ce8711aeefc1af8167a0.png

 

 

Annddddd...

Anyone know a way of disabling the console in the exe file, I went to properties and went to Subsytem and changed it to windows but that still doesn't do it. I was told to do WinMain() instead of main() but then I got 2 errors.


Here is my code and errors.

 

code.png

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

To get rid of the console:

1) open project properties

2) make sure the configuration box in the top left is set to the correct thing for whatever you're trying to change

3) go to Linker -> system

4) set SubSystem to Windows (/SUBSYSTEM:WINDOWS)

5) go to Linker -> advanced

6) set Entry Point to mainCRTStartup

7) rename your main function back to main

 

or do only step 7 then add the line

#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")

at the top of your main file.

 

Also, the link for your first question isn't working for me.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

I didnt know that forms was still a thing with vc++.

 

@fizzlesticks suggestion is probably easiest. But if for whatever reason you need to stick with WinMain the look at this link as it gives you the correct syntax for it. 

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, trag1c said:

I didnt know that forms was still a thing with vc++.

 

@fizzlesticks suggestion is probably easiest. But if for whatever reason you need to stick with WinMain the look at this link as it gives you the correct syntax for it. 

I think that they were doing something a little different, I switched back to just main() and it seems to work perfectly fine.

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, mattonfire said:

Here is a alternate link - http://prntscr.com/bdyzev

For the designer to work the .cpp file it represents can't have any errors and the functions of any links you set up between the designer and code must exist. From the error it's giving you I'm guessing you're missing a '}' or semicolon or something. Once you fix the errors the designer should work again.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, fizzlesticks said:

For the designer to work the .cpp file it represents can't have any errors and the functions of any links you set up between the designer and code must exist. From the error it's giving you I'm guessing you're missing a '}' or semicolon or something. Once you fix the errors the designer should work again.

That's the issue, it starts like that. It makes the form itself and starts up like that before I had even modified it.

http://prntscr.com/bdz4l2
That is the code it starts with.

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, mattonfire said:

That's the issue, it starts like that. It makes the form itself and starts up like that before I had even modified it.

http://prntscr.com/bdz4l2
That is the code it starts with.

It seems to be a know issue by Microsoft. 

Quote

Hi there!

Thanks for taking the time to submit your feedback. This is a known issue with the designer, and essentially, you just have to wait a few moments for it to load and then reopen it and the error message should go away. We included a dialog that was supposed to pop up and inform you of this info, but I think that adjustment didn't make it into VS2015 RTM - it should be there in Update 1.

Don't hesitate to let me know if you have any other issues around this! If so, please contact me at gaha at Microsoft dot com, as I will be closing this bug in the meantime.

Thanks for helping to make Visual Studio a better product!

Best regards,
Gabriel Ha
Visual C++ Team

So basically just close the design file, wait a few seconds then reopen it.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, fizzlesticks said:

It seems to be a know issue by Microsoft. 

So basically just close the design file, wait a few seconds then reopen it.

...Wow, just wow. That simple...

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×