Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / April 2006

Tip: Looking for answers? Try searching our database.

why i can't put struct to Generic::List

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shengmin.ruan@gmail.com - 03 Apr 2006 16:27 GMT
the wrong code is:

[StructLayout(LayoutKind::Sequential)]
public ref struct OutPacket{
    int index;
    List<MainInfo^>^ mainInfos;
};

[StructLayout(LayoutKind::Sequential)]
public ref struct MainInfo{
    String^ value1;
    String^ value2;
};

----------
the error message is:
Error    1    error C2065: 'MainInfo' : undeclared identifier

please help me ,thank u
Bruno van Dooren - 03 Apr 2006 18:45 GMT
> [StructLayout(LayoutKind::Sequential)]
> public ref struct OutPacket{
[quoted text clipped - 11 lines]
> the error message is:
> Error 1 error C2065: 'MainInfo' : undeclared identifier

Try swapping the declarations. When you declare OutPacket, MainInfo is still
unknown because its declaration is placed after the declaration to
OutPacket.
Declaring MainInfo first takes care of that problem.

Signature

Kind regards,
   Bruno van Dooren
   bruno_nos_pam_van_dooren@hotmail.com
   Remove only "_nos_pam"


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.