.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

DocumentViewer crashes in Windows XP SP3

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :WPF
Hi! I am developing a small program like point-of-sale based on WPF. In the program, I used UserControl to make shape of an Invoice. The FlowDocument would be converted into XPS document, and displayed into DocumentViewer. In Windows Vista, this works perfectly. I tried to run the program on Windows XP SP3, but the application crashed, it seems that XP SP3 can not handle DocumentViewer. So I installed XPS Essentials Pack 1.1 to check if it solve the problem, but it isn't. I have tried searching on Google, but found no solution. Is it the code that caused the problem? Or just missing components of target platform (WinXP SP3)? The code used to print the UserControl: public static FixedDocument GetFixedDocument(FrameworkElement toPrint, PrintDialog printDialog) { PrintCapabilities capabilities = printDialog.PrintQueue.GetPrintCapabilities(printDialog.PrintTicket); Size pageSize = new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight); Size visibleSize = new Size(capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight); FixedDocument fixedDoc = new FixedDocument(); toPrint.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); toPrint.Arrange(new Rect(new Point(0, 0), toPrint.DesiredSize)); Size size = toPrint.DesiredSize; double yOffset = 0

View Complete Post

More Related Resource Links

Designer crashes sometimes because application path becomes C:\Windows\system32

Sometimes VS crashes as it seems to execute the WPF designer in its directories or C:\Windows\system32. Sometimes it works fine as we can preview saved settings in the Designer. I have set application path as follows : ConfigFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mixer.ser");<br/> When VS crashes I accept to debug it, the exception is : {"Access to the path 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\mixer.ser' is denied."}    System.Exception {System.UnauthorizedAccessException} ... or c:\windows\system32 Any ideas on how to fix this ?   Thank you !

SQL-Server 2005 x64 / windows server 2003 x64 crashes during file copy

Hi We are running: Microsoft SQL Server 2005 Standard - 9.00.4294.00 (X64) Microsoft Windows Server 2003 R2 Enterprise x64 We have gigabit interface. Today we copied a file (using robocopy) from our databaseserver to another server (backup-server). The copy was started from the backup-server and source were specified using UNC. The copy were using about 20% of the bandwith (about 200Mbit). During the copy, sql-server reported several errors, for example: AppDomain 15 (mp.dbo[runtime].14) is marked for unload due to memory pressure. The client was unable to reuse a session with SPID 75, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message. ***Stack Dump being sent to [PATH\SQLDump0005.txt Resource Monitor (0x1384) Worker 0x000000008000C1C0 appears to be non-yielding on Node 0. Memory freed: 0 KB. Approx CPU Used: kernel 15 ms, user 218 ms, Interval: 428541. So to me it appears that sql-server crashed during a file copy. We have 27 GB ram. With 24.5 GB dedicated to SQL-Server. The files we copied were quite large, some over 50GB. I found a similar issue about this: http://support.microsoft.com/kb/920739/ Do you think the issue above could be the cause of the sql-server crash? ///Patrik

Query crashes in MSAccess 2007 and 2010 on Windows 7 64bit, but works on 32 bit

Hello. I have a prepared a Database that contains 2 tables, and a Query. If you execte the query (Just a very simple join with a few where statments) Windows 7 crashes in 64 bit, but not on a 32 bit platform. Unfortunatly the Database has 300MB and is to big to be uploaded here. So if there is anyone interested at MS to get my Database, please feel free to contact me serge.dornseiffer@sdna.lu

Large string (.4gb) crashes simple C# vista/windows 7 when complied for any CPU



I have a program that converts csv files into XML files, this process runs on its own machine which has plenty (6gb) of ram. Part of the process is to read the entire contents of the CSV file into RAM. Typically the CSV files are no more then 20-40kb in size.

A new file type has been added to the system and it is about half a gig in size. Now I know there are better ways to handle this file, and I've already addressed that. I just wanted to give some background on HOW I found the problem.

If you create a new c# console app (vs2008 or vs2010) and paste in the code below on a 64bit Vista or Windows 7 pc, You may crash (total lock up) your PC. If you specify the processor to be x86 it runs fine...

Can someone explain this behaviour? I've tried three separate dev machines with the same results, but have no more to try.

Please take care, as the only way I have found to recover from this is to power off....

 static void Main(string[] args)

Unmanaged C++ calls managed c++ : it crashes on windows xp



if I call a c++ function in a managed DLL from an unmanaged dll or exe, it crashes on Windows xp, but it runs fine on Windows 7.

On Windows XP I get an error message:

Die Anwendung konnte nicht richtig initialisiert werden (0xc0000135).

The Code is very simple. The Header file:

#pragma once

#ifdef _CLR_DLL_
#define _EXPORT_ __declspec( dllexport )
#define _EXPORT_ __declspec( dllimport )

extern "C"
int _EXPORT_ func(int i);

The c++ file:

#include "stdafx.h"

#include "ClrDll.h"

int func(int i)
	return i;

It is compiled with the /clr switch.

The caller is a simple C++ program, it calls this function.

I use Visual Studio 2010, and .NET framework 4.0

It works fine on windows 7.

It is very i

import/export wizard crashes on SQL Express 2008 R2 installed on Windows 7 (32-bit)


I have been getting "Unexpected Unrecoverable Error; Abort, Retry, Ignore" when using the SQL Import/Export Wizard in the following scenarios (these are the only two ways I have tried using the Wizard):

1) Source Advantage OLE DB Provider, destination SQL Server, copy tables

2) Source Microsoft Excel, destination SQL Server, copy tables, show report if there were any failures

I have run the SQL Setup Repair and still get the same behavior.  Are there known issues with SQL Express 2008 R2 on Windows 7 for Import/Export?

Thanks, David

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Serving Silverlight Apps from Windows Mobile

Even if mobile dev is not my every day work, thanks to the .Net Compact Framework, it's still .Net programming.

Here is the scenario:

You come back home, you have a windows mobile phone wifi capable and you want to quickly get access to your phone pictures from your home network.
You just activate the Wifi, run my app and then browse to the provided link from any computer on the network.

Getting Started with Windows SharePoint Services

Of all of the capabilities of SharePoint, I thought I would start with the most basic installation - as a corporate intranet. It is likely that we will need to discuss some of the elements of SharePoint as we go along, so this also gives us the opportunity to review these elements for future reference.

Before going into too much detail, I would like to point out that you can try the core SharePoint framework (known as Windows SharePoint Services or WSS) for free. On Microsoft's Web site you can download a trial version of Virtual PC 2004 (VPC). Using VPC, you can install the Windows 2003 Evaluation Kit and the WSS add-on. This combination will give you 45 days to evaluate the setup.

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Getting Started with Windows Communication Foundation

Windows Communication Foundation (WCF) provides a unified framework for rapidly building service-oriented applications that makes it easy to build and consume secure, reliable, and transacted Web services. It unifies the capabilities in ASMX, WSE, Remoting, COM+, and MSMQ; therefore developers need to learn only one programming model.

Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

Windows Presentation Foundation and your architecture

Windows Presentation Foundation (WPF) is a new client user interface technology that ships as part of the .NET 3.0 Framework. Architects have long faced the challenge of selecting an appropriate presentation tier technology for their applications. In recent times, if you are developing for the Windows platform, it was at least a fairly short list. You either built a web application, a smart client, a mobile device, or some combination of those depending on your target audience. Which one you picked gave you a fairly short list of practical options in the .NET space - ASP.NET, Windows Forms, and Compact Framework respectively.

New Features in Windows SharePoint Services 3.0

Windows SharePoint Services 3.0 (WSS 3.0) is the next version of WSS 2.0, released on 2007, and Microsoft Office SharePoint Server 2007 (MOSS 2007) is built on top of this. Windows SharePoint Services 3.0 takes full advantage of Microsoft ASP.NET 2.0 and the core Microsoft .NET 2.0 runtime. WSS 3.0 offers a lot of new features and programmability support. I have consolidated a list of new features and enhancements in the below section:

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend