
Signature
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
Excellent! Worked perfectly, and I'm understanding how the new syntax works
(I think). One more question (I was experimenting while I waited for your
answer).
In this case, dept is an ArrayList:
formatter->Serialize(stream, dept);
but how do I cast dept to an Object^ (which is what the method is
expecting)? This is valid in C#, but having a problem in C++/CLI.
Thanks again.
> Karch,
>
[quoted text clipped - 20 lines]
> formatter->Serialize(stream, o);
> }
Tomas Restrepo (MVP) - 25 Oct 2005 03:38 GMT
Karch,
> Excellent! Worked perfectly, and I'm understanding how the new syntax
> works (I think). One more question (I was experimenting while I waited for
[quoted text clipped - 6 lines]
> but how do I cast dept to an Object^ (which is what the method is
> expecting)? This is valid in C#, but having a problem in C++/CLI.
You shouldn't need to cast, since all objects have an implicit cast to
Object^.
What specific error are you getting?

Signature
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
karch - 25 Oct 2005 03:51 GMT
"Cannot convert parameter 2 from 'System::Collections::ArrayList' to
'System::Object^'"
> Karch,
>
[quoted text clipped - 12 lines]
> Object^.
> What specific error are you getting?
Marcus Heege - 25 Oct 2005 06:55 GMT
I assume you have done something like this:
ArrayList al;
al.Add(1);
...
gcnew SoapFormatter()->Serialize(al);
This needs some explanation, since you have used a special C++/CLI feature
here: implicitly dereferenced variables. Read my post on the thread "using
C# when adding new feature" from yesterday for more details.
Marcus Heege
www.heege.net
> "Cannot convert parameter 2 from 'System::Collections::ArrayList' to
> 'System::Object^'"
[quoted text clipped - 15 lines]
>> Object^.
>> What specific error are you getting?