<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META name=GENERATOR content="MSHTML 8.00.7600.16821"></HEAD>
<BODY style="FONT: 10pt Arial; COLOR: #000000" leftMargin=5 topMargin=5
bgColor=#ffffff>
<DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3><FONT
face=Calibri>Hi all,<BR style="mso-special-character: line-break"><BR
style="mso-special-character: line-break"><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN style="mso-ansi-language: EN-US" lang=EN-US><FONT
size=3><FONT face=Calibri>I want to display all PropertyNames of one layer on a
new website without displaying the Map. The problem is to read the
classDefinition of one <SPAN style="mso-spacerun: yes"> </SPAN>layer. The
SiteConnection works fine and I can read all the LayerNames of the Map. But when
I try to get the ClassDefinition of the layers (<FONT size=2><FONT
face="Courier New"><SPAN style="COLOR: blue">Dim</SPAN> MyMGClassDef =
MyMGLayerCollection.Item(iL).GetClassDefinition())</FONT></FONT> it always
get an error in Source “OSGeo.MapGuide.MapGuideCommon”<SPAN
style="mso-spacerun: yes"> </SPAN>-><SPAN
style="mso-spacerun: yes">
</SPAN>MgNullReferenceException”<o:p></o:p></FONT></FONT></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN style="mso-ansi-language: EN-US" lang=EN-US><o:p><FONT
size=3 face=Calibri> </FONT></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN style="mso-ansi-language: EN-US" lang=EN-US><FONT size=3
face=Calibri>How can I solve this problem?<BR><BR>Here is my
code:<BR><BR></FONT></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US>MapGuideApi.MgInitializeWebTier(Server.MapPath(<SPAN
style="COLOR: #a31515">"~/config/webconfig.ini"</SPAN>))<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><o:p> </o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> MyMGUserInfo <SPAN
style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">New</SPAN>
MgUserInformation()<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US>MyMGUserInfo.SetMgUsernamePassword("Anonymous","")<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><o:p> </o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> MyMGSiteConnection <SPAN
style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">New</SPAN>
MgSiteConnection()<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US>MyMGSiteConnection.Open(MyMGUserInfo)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><o:p> </o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> RS <SPAN
style="COLOR: blue">As</SPAN> MgResourceService =
MyMGSiteConnection.CreateService(MgServiceType.ResourceService)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> RI <SPAN
style="COLOR: blue">As</SPAN> MgResourceIdentifier = <SPAN
style="COLOR: blue">New</SPAN>
MgResourceIdentifier("StringWeblayout...")<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> MyMGWebLayout <SPAN
style="COLOR: blue">As</SPAN> MgWebLayout = <SPAN style="COLOR: blue">New</SPAN>
MgWebLayout(RS, RI)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> MyMapNameStr <SPAN
style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">String</SPAN> =
"MapName..." <o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> RSm <SPAN
style="COLOR: blue">As</SPAN> MgResourceService =
MyMGSiteConnection.CreateService(MgServiceType.ResourceService)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> RIm <SPAN
style="COLOR: blue">As</SPAN> MgResourceIdentifier = <SPAN
style="COLOR: blue">New</SPAN>
MgResourceIdentifier(MyMGWebLayout.GetMapDefinition)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> MyMGMap <SPAN
style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">New</SPAN>
MgMap()<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US>MyMGMap.Create(RSm, RIm, MyMapNameStr)<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><o:p> </o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue">Dim</SPAN> MyMGLayerCollection =
MyMGMap.GetLayers<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="COLOR: blue"><FONT color=#000000>
</FONT>For</SPAN> iL <SPAN style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">Integer</SPAN> = 0 <SPAN style="COLOR: blue">To</SPAN>
MyMGLayerCollection.Count - 1<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Dim</SPAN> LName <SPAN
style="COLOR: blue">As</SPAN> <SPAN style="COLOR: blue">String</SPAN> =
MyMGLayerCollection.Item(iL).GetLayerDefinition.GetName<o:p></o:p></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="COLOR: blue">If</SPAN> LName = "LayerName..." <SPAN
style="COLOR: blue">Then<o:p></o:p></SPAN></SPAN></P>
<P style="LINE-HEIGHT: normal; MARGIN: 0cm 0cm 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN
style="mso-spacerun: yes">
</SPAN><SPAN style="COLOR: blue">Dim</SPAN> MyMGClassDef =
MyMGLayerCollection.Item(iL).GetClassDefinition()<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN
style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
style="COLOR: blue">For</SPAN> i <SPAN style="COLOR: blue">As</SPAN> <SPAN
style="COLOR: blue">Integer</SPAN> = 0 <SPAN style="COLOR: blue">To</SPAN>
MyMGClassDef.GetProperties.Count – 1</SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN
style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US> ....</SPAN></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><SPAN
style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US></SPAN><SPAN
style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes"
lang=EN-US><BR><BR>Markus</SPAN><SPAN style="mso-ansi-language: EN-US"
lang=EN-US><o:p></o:p></SPAN></P></DIV><BR>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>Schauen Sie auf unseren Luftbildshop von sb)Partner Geo&IT <FONT
color=#000000><A
href="http://www.geo-data.eu">www.geo-data.eu</A></FONT></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></BODY></HTML>