3 Replies - 188 Views - Last Post: 25 May 2017 - 11:46 AM

#1 hexagod  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 240
  • Joined: 29-October 16

private: System::Void.ctor() Keeps Adding Itself (what does it do?)

Posted 24 May 2017 - 03:25 PM

Hey all!
I've run into a very very very annoying and strange problem here in Visual Studio 2015:

this bit of code keeps adding itself to my project, I have had it added into my printer.h file several times now and I can't figure out how to get rid of it without throwing more compiler errors. If I simply comment it out I get an error saying that something is missing (don't have the exact message but I can get it if this comes back again). I tried googling it, and couldn't find anyone who could give me a good answer about what to do to get rid of it.

private: System::Void.ctor() 
{
	this->InitializeComponent();
}



I keep having to delete my entire .h and .cpp files because of it and I'm starting to get flustered.

Everytime this gets added I'm being told that "." isn't the right syntax... but I don't understand how it can be the wrong syntax, since it's the compiler that keeps adding it in?!?! :wacko:

Is This A Good Question/Topic? 0
  • +

Replies To: private: System::Void.ctor() Keeps Adding Itself (what does it do?)

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13352
  • View blog
  • Posts: 53,216
  • Joined: 12-June 08

Re: private: System::Void.ctor() Keeps Adding Itself (what does it do?)

Posted 24 May 2017 - 05:42 PM

Looks like a default constructor. Hard to say why it's there without seeing the project.
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5786
  • View blog
  • Posts: 19,703
  • Joined: 05-May 12

Re: private: System::Void.ctor() Keeps Adding Itself (what does it do?)

Posted 24 May 2017 - 06:54 PM

This a triple self-inflicted problem. Problem 1: Using C++/CLI. Problem 2: Using WinForms with C++/CLI. Problem 3: Using the WinForm Designer which is known to be buggy, specially if you try to inherit from anything other than Form or UserControl.

I'm not sure, but it almost sounds like you are editing the compiler generated files. The same ones that has a comment at the top that says you should not edit them because they can be regenerated.

I suggest starting a brand new project.
Was This Post Helpful? 1
  • +
  • -

#4 hexagod  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 240
  • Joined: 29-October 16

Re: private: System::Void.ctor() Keeps Adding Itself (what does it do?)

Posted 25 May 2017 - 11:46 AM

Yeah I had to delete that header file and start over for this form. I still don't know what was causing it. Very strange..

This post has been edited by hexagod: 25 May 2017 - 11:46 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1