Help with my code (s)

1 #using <System.dll>
2 #using <System.Windows.Forms.dll>
3
4 using namespace System;
5 using namespace System::Windows::Forms;
6
7 #include "promptbox.h"
8
String^ addMessage(String^ fullName) {
9 return "Welcome, " + fullName + "!";
10 }
11
12 int main() {
13 //local variable to main() only
14 String^ fullName;
15
16 PromptBox promptBox1;
17 promptBox1.Input("Enter your full name: ");
18 fullName = promptBox1.msg;
19
20 //calling addMessage()
21 MessageBox::Show::(addMessage(fullName));
22 return 0;
23 }

Here is the error I get:

promptbox.h(19) : error c3867: 'PromptBox::Input' : function call missing argument list; use '&PromptBox::Input' to create a pointer to member


promptbox.h(19) : error c2664: 'void System::Windows::Forms::Control::Text::set(System::String ^)' : canot convert parameter 1 from 'void (_clrclal PromptBOx::* )(System::String ^)' to 'System::String ^'
No user-defined-conversion operator available, or There is no context in which this conversion is possible


error C3089: 'Show": the symbol to the left of a '::' must be a type
error C2589: '(' : illegal token on right side of '::'
error C2149: syntax error : missing ';' before '::'


I can't seem to make this code compile and run. Any help would be great!!


closed account (zb0S216C)
I don't know the solution to your problem, but I came here to say this: Very few C++/CLI questions are given a respectable solution because knowledge on C++/CLI is limited to us. So expect to wait a while for a solution.

Just thought you'd like to know :)

Wazzak
Topic archived. No new replies allowed.