|
Karl Shifflett wrote: Any way to break the dataset into smaller pieces and merge the parts on the XBAP side?
This would be possible but not ideal
Karl Shifflett wrote: Can you compress it and ship the compressed bytes across the wire?
Could you point me to an example on how I can do this for an object array please?
Karl Shifflett wrote: Are you using efficient binary serialization for the dataset?
I'm not quite sure what you are referring to when you say efficient binary serialization. Could you please elaborate a bit for me.
Karl Shifflett wrote: What setting?
Any setting in web.config, can be set in machine.config.
I'm reffering to the maxReceivedMessageSize and maxBufferSize setting for the basicHttpBinding that I'm using. My thinking was that if I could increase these settings globally and permanently on the machine then the application would take the increased values as default and there would be no need for the application to request for web permission to increase these values.
Thanks for all your help so far
|
|
|
|
|
|
Yes this is possible.
I finally found the answer to this here...
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2196129&SiteID=1
Quote:
"The problem is not with MaxReceivedMessageSize but with MaxBufferSize. MaxBufferSize seems to have a limit of 65536 in partial trust mode. To get around this you can leave MaxBufferSize at 65536 and change the transferMode to Streamed or StreamedResponse."
After doing this you can set the MaxReceivedMessageSize to as big as you need.
|
|
|
|
|
I could have asked this in a number of sections, I know, but the following is using WPF..
I'm working on an application that graphs data for given time intervals. For example, I could be collecting data in real time, and i'm graphing the last 5 minutes of the data up to the current point. When I have multiple axes, the number of points for each axis can become large fast. I have to go though and process all of these points every time I update the graph. When I have points that are in a pattern, or straight line, it doesn't make since to keep all of the ones in the middle. Does anyone know of any algorithms/data structures to efficiently process a large number of coordinates?
Thanks!
|
|
|
|
|
Hi,
somehow, I don't see why you posted this to the WPF Forum: You are asking for a data structure or an algorithm. This is independent from the way you display it.
Next, why do you have to process all points every time you update? Do you need real-time averages or something? Just moving the graph can certainly be accomplished in a smarter way.
Concerning patterns/straight lines: Are you sure that your data will ever show up something like that? Measurement data is almost never precise enough.
There are, however, interpolation and approximation algorithms using polynomials, splines, etc. But this is not exact anymore, and if the algorithm screws up, you might not notice that (e.g. you data jiggles wildly but the interpolation comes up with an almost straight line). In general, if this is measurement data, you should keep the original input somewhere or have your algorithm determine the interpolation/approximation error. It really depends on what you're up to. Note that these algorithms are usually computationally expensive, so it is probably not a good idea to apply them in real time. Are you sure you will have so many points that memory will be the bottleneck?
Cheers,
Chris
"Obstacles are those frightening things you see when you take your Eyes off your aim"
- Henry Ford
Articles
Blog
|
|
|
|
|
Thanks Chris,
I understand that the there are other places i could have posted it, but since i'm utilizing WPF, i thought there might be some features or anything else i didn't know about. Oh well.
I agree, measurement data would be too difficult to find patterns. I'm displaying the data in real-time (say 10 points/sec), and could have up to 6 axes. I'm using the Polyline in WPF, and it's just something that could potentially be a processing/memory bottleneck.
Thanks for the help though
|
|
|
|
|
There is no anchor property in WPF, yet there are VerticalAlignment and HorizontalAlignment which do simply the same. But there is one problem:
Suppose that I have an Image control with some png image loaded. When I put this control in the center region of my form and set both Vertical and Horizontal Alignments to STRECH, everything works fine. But when I move this Image towards form`s edges - for example towards top, the VerticalAlignment changes from STRECH to TOP. When I try to change VerticalAlignment back to STRECH, the Image control automatically moves to center region of the form.
How to enable streching in both directions while an element is near the edges of the form?
Thank you for any help in advance
|
|
|
|
|
Moving an image in the designer can sometimes change its anchoring automatically, which can be really annoying. However, you can, after moving the image in the designer, directly change its anchoring in the designer, too.
If you select the image, then each of the 4 sides of the image will have either an empty circle or an anchor bar, depending on whether or not the image is anchored on that side or not. Clicking the empty circle will change it to an anchor bar, and clicking the anchor bar will turn it to an empty circle.
|
|
|
|
|
|
Hi,
I have a WPF form for the user to edit some details of an object. Most of the fields are fairly simple text/numeric style fields. I've bound the controls to the properties on the object being edited, and everything works great.
Except, how do I cancel the changes when the user hits the cancel button?
Simon
|
|
|
|
|
Simon,
You have some options.
1. You can keep a copy of the object and replace the original values from the copy if the user cancels.
2. If this is a database application, just reread the record from the database. (or reread from the original source)
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Thanks Karl,
I was hoping there was something simpler than that. To be honest, it's easier to just go back to the old style and copy the object to the controls when the form is opened, then from the controls to the object when the user hits OK. I don't get the advantage of data binding. Am I missing something?
Simon
|
|
|
|
|
Yes I think you may be missing a number of built in features.
WPF 3.5 now supports the IDataErrorInfo interface.
There is plenty of info out there on WPF object data binding.
I'm working on an article today that includes a notification control that is wired up to the business object.
I about 2 weeks I'll also have a the 4th in my WPF Business Application series that covers "how to" do a great number of things with the data binding and business objects.
Trust me, you want to try and use the WPF Data Binding. Very powerful.
Bea Costa is the First Lady of WPF Data Binding. Here blog is here: http://www.beacosta.com/blog/[^]
modified 27-Feb-21 21:01pm.
|
|
|
|
|
I'll stick with it. I'm still new to WPF, we're only using it in small internal apps at the moment. Nothing serious.
I actually found something on her blog that helps with my original question http://www.beacosta.com/blog/?p=15[^]. If I set the update source trigger to explicit, and call UpdateSource() when the user hits OK, that looks like it will do what I want. I'll try it out.
I'll keep a watch out for those articles, they sound useful.
Thanks for the help,
Simon
|
|
|
|
|
Simon,
Glad to hear it.
WPF has a learning curve, but it is worth it!
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi guys.
We have a WPF app, it's only use of COM is that we have a control which wraps the native windows media player control, because the WPF one is too slow. It's worked fine for ages, but suddenly, there is an intermittent crash. It never crashes the first time it's run. When it does crash, it's in this method:
try
{
Application.Current.MainWindow.MinHeight = ActualHeight + 100;
}
catch
{
// Empty - will crash if we are not registered
}
which is in the load event for our tab control. At this stage, the app has done all it's heavy lifting and is in fact visible. An error message comes up, and the app closes. If I get it to crash in the debugger, I get this message three times:
DisconnectedContext was detected
Message: Context 0x21a250' is disconnected. Releasing the interfaces from the current context (context 0x21a0e0).This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the applicationis completely done with the RuntimeCallableWrappers that represent COM components that liveinside them.
and this is the exception itself:
Sunday, 17 February 2008
Not enough quota is available to process this command
at MS.Win32.UnsafeNativeMethods.PostMessage(HandleRef hwnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, List`1 channelList)
at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
All the googling I've done on this message indicates it means the system doesn't have enough resources, but all I'm trying to do in the line that crashes it, is set the minimum height of a control !!! In the debugger, all the properties I am trying to read or set are able to be viewed, Application.Current.MainWindow.MinHeight is 0.0, reading it does not create an exception, as I would have expected.
Any help or guidance greatly appreciated.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It does looks like some windowing mess related to STAs hence the gut feeling like some re-entrancy problem to me.. But very difficult to say for sure or figure out without having a mini project to repro it.
I would suggest a hack just to see if it gets around it, you know, finding the window and just posting the message to achieve the same effect. Or move the whole thing around with a timer (yet another ugly hack), it is ugly the mess with RCW/CCW/COM objects being or not being disposed of (the error looks like a stub missing, carpet pulled underneath; I believe CoDisconnectObject was the way around those but might be going way off tangent here).
IIRC, it was possible to get apartments (and most likely contexts) IDs too straight from the marshal interface packet stream. Then you'd have to chase all the OXIDs and find the culprit etc etc. Pretty heavy stuff but it is possible to debug the entire show even if it means loading the debug symbols for OS and whatever else..
Just ideas..
|
|
|
|
|
Christian,
Seems like you have two independent issues here. For the purpose of troubleshooting, can you separate the two, to allow us to work the WPF height issue. By that I mean, can you place a button in the tab control, set its size in code and then allow the resize code to run. This is one simple way of separating the two.
Christian Graus wrote: which is in the load event for our tab control.
Is this a custom tab control, or the standard tab control?
Christian Graus wrote: Application.Current.MainWindow.MinHeight = ActualHeight + 100;
What UIElement does ActualHeight point to?
Is the tab control is on the MainWindow or another window?
Christian Graus wrote: It's worked fine for ages, but suddenly, there is an intermittent crash.
Was this after a framework upgrade, Windows Update or media player update?
Do you have a machine that has your older configuration that you can run the code on? Say an older Windows XP box?
Have you thought about setting the Window property ResizeSizeToContent="WidthAndHeight" . With the use of Margins, this will give you the additional height you need automatically.
Failing the above, can you send me the project so I can see all the code, XAML and step through it?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Karl Shifflett wrote: Was this after a framework upgrade, Windows Update or media player update?
No, it was after a code change, and happens on all machines.
Karl Shifflett wrote: Do you have a machine that has your older configuration that you can run the code on? Say an older Windows XP box?
I have the old code base, I intend on doing a diff and working through the changes to see which caused it, although nothing major has changed.
Karl Shifflett wrote: Have you thought about setting the Window property ResizeSizeToContent="WidthAndHeight". With the use of Margins, this will give you the additional height you need automatically.
Thanks - I will look into this.
Karl Shifflett wrote: Failing the above, can you send me the project so I can see all the code, XAML and step through it?
It's a big project, thanks for the offer, I'll take you up on it if I need to.,
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sorry to come back to an ancient thread, but did you resolve/locate the cause of this issue?
I am currently experiencing the same MDA error problem and I beleive it is the result of COM interop issues.
Do you have any pointers for me?
Error:
DisconnectedContext was detected
Message: Context 0x2736e8' is disconnected. Releasing the interfaces from the current context (context 0x2737a0).This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the application is completely done with the RuntimeCallableWrappers that represent COM components that live inside them.
|
|
|
|
|
hi,
i am very new to silverlight, can you suggest me any site that will give basic information abt silverlight app, how to run them and usage
thaknx in advance
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
How about this...[^]
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
|
thankx many ...
as you say...
Michael Sync wrote: - Silverlight is web technology so you can run the application on browser.
it is different from asp.Net web aplication 2.0 ????
regards
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
koolprasad2003 wrote: it is different from asp.Net web aplication 2.0 ????
There are a lot of differences between ASP.NET and Silverlight.
- Silverlight is like Flash. You will see it as embedded object on the browser. For ASP.NET, it's just normal HTML page.
- ASP.NET is the server-side technology. Silverlight is client-side technology that works on browser.
- You don't need any extra plugin to view the ASP.NET website but you will need Silverlight plugin to view the Silverlight content.
- You will need Microsoft .NET and Windows server to host ASP.NET web site but you don't need anything for Silverlight. You can host the silverlight application on Linux server or any server that you like.
- ASP.NET uses HTML and Silverlight uses XAML.
- You won't get the same view for ASP.NET in different browsers. (If you have some experiences in Ajax-enabled website development, you will know how to fix something for IE6 and other thing for Firefox or other browsers). But with Silverlight, you will get the same view for all browsers.
- and there may be more...
There are only one same thing. Both website can be viewed with browsers.
Hope that you will get some ideas about that.
|
|
|
|
|