Jerry
Fri Mar 14 15:19:57 CDT 2008
{
int x;
InitializeComponent();
TestDLL.Class1 testObject = new TestDLL.Class1
x = testObject.ADD(1,2);
}
The IDE warns me --by placing a line underneath the "x" var where I am
making the assignment-- it states:
"A new expression requires (), [], or {} after type".
Of course, I cannot setup thru the code due to this error. I'm sure its
something simple but being new to C# and finding examples on the Net showing
what I already am doing I just don't see the problem.
JW
"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.2244e203c1d2250ab26@msnews.microsoft.com...
> Jerry West <jw@comcast.net> wrote:
>> Thanks for that --and the proper syntax. Just what I was needing given my
>> lack of C# knowledge.
>>
>> Just one final item. I wanted to actually test the call. However, I need
>> to
>> declare i as shown in the example:
>>
>> i = TestDLL.TestClass.ADD(1,2);
>>
>> I did so like:
>>
>> int i;
>>
>> But I'm still, apparently, missing something. VS flags i in this
>> statement:
>>
>> i = TestDLL.TestClass.ADD(1,2);
>>
>> It indicates "A new expression requires (), [], or {} after type". I
>> tried
>> all three but each time resulted in more errors, i.e.:
>>
>> i() = TestDLL.TestClass.ADD(1,2);
>> i[] = TestDLL.TestClass.ADD(1,2);
>> i{} = TestDLL.TestClass.ADD(1,2);
>>
>> I tried it with my declaration as well. What am I missing?
>
> Well, we've got no idea what the context of your statement is.
>
> Could you post a short but complete program which demonstrates the
> problem?
>
> See
http://www.pobox.com/~skeet/csharp/complete.html for details of
> what I mean by that.
>
> --
> Jon Skeet - <skeet@pobox.com>
>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:
http://iterativetraining.co.uk