aviabunin

axSymbologyControl - can't load ESRI.ServerStyle

Discussion created by aviabunin on May 17, 2011
Latest reply on May 18, 2011 by rlwatson
In exampe of how to use LayerRendering code
            string sInstall = ReadRegistry("SOFTWARE\\ESRI\\CoreRuntime");
            axSymbologyControl1.LoadStyleFile(sInstall + "\\Styles\\ESRI.ServerStyle");

worked. But in my program the same code does not work, when loadStyleFile I  get error message
"(Exception -  HRESULT: 0x80004005 (E_FAIL))". Error code - -2147467259.
stack trace -
"   ? System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)\r\n   ? ESRI.ArcGIS.Controls.ISymbologyControlDefault.LoadStyleFile(String fileName)\r\n   ? ESRI.ArcGIS.Controls.AxSymbologyControl.LoadStyleFile(String fileName)\r\n   ? monitor.KartaForm.KartaForm_Load(Object sender, EventArgs e) ? D:\\VS2005\\Projects\\monitor\\monitor\\KareliaForm.cs:???????? 398\r\n   ? System.Windows.Forms.Form.OnLoad(EventArgs e)\r\n   ? System.Windows.Forms.Form.SetVisibleCore(Boolean value)\r\n   ? System.Windows.Forms.Control.Show()\r\n   ? monitor.Form1.ShowKarta() ? D:\\VS2005\\Projects\\monitor\\monitor\\Form1.cs:???????? 199\r\n   ? monitor.Form1.Form1_Load(Object sender, EventArgs e) ? D:\\VS2005\\Projects\\monitor\\monitor\\Form1.cs:???????? 151\r\n   ? System.Windows.Forms.Form.OnLoad(EventArgs e)\r\n   ? System.Windows.Forms.Form.OnCreateControl()\r\n   ? System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r\n   ? System.Windows.Forms.Control.CreateControl()\r\n   ? System.Windows.Forms.Control.WmShowWindow(Message& m)\r\n   ? System.Windows.Forms.Control.WndProc(Message& m)\r\n   ? System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   ? System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n   ? System.Windows.Forms.Form.WmShowWindow(Message& m)\r\n   ? System.Windows.Forms.Form.WndProc(Message& m)\r\n   ? System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   ? System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   ? System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   ? System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)\r\n   ? System.Windows.Forms.Form.SetVisibleCore(Boolean value)\r\n   ? System.Windows.Forms.Control.set_Visible(Boolean value)\r\n   ? System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   ? System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   ? System.Windows.Forms.Application.Run(Form mainForm)\r\n   ? monitor.Program.Main() ? D:\\VS2005\\Projects\\monitor\\monitor\\Program.cs:???????? 17\r\n   ? System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n   ? System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n   ? Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n   ? System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   ? System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   ? System.Threading.ThreadHelper.ThreadStart()"

Can anybody say - how to improve situation?
Thanks!

Outcomes