Hello,
I'm not too experienced with C++ (I know C# pretty well), and I can't figure this out.
I've got two files, Form1.h and Utility.h.
Form1.h is initialized when the program starts, and when the user clicks a button, it should call some functions in Utility.h.
Now the problem I have is, I need the functions in Utility.h to send messages back to the instance of Form1 that has already been initialized, to display to the user.
Here's what I have... Form1.h:
#pragma once
#include <Utility.h>
#include "stdafx.h"
namespace PublishWizard {
...
public ref class Form1 : public System::Windows::Forms::Form
{
Utility.h:
#include "stdafx.h"
#include "Form1.h"
using namespace std;
bool ValidPath( string &filePath, Form1 &console )
{
and, my error:
...\Utility.h(6) : error C2061: syntax error : identifier 'Form1'
I have a public function in Form1, Write(string message)
, that will show the user whatever message is sent.
So I was planning on passing the instance of Form1 to every function that I use in Utility.h and calling the Write function that way.
Does anyone know any way to fix this error, or any better suggestions?
Thanks