.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

C++ at Work: Layered Windows, Blending Images

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

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

Windows with C++: Layered Windows with Direct2D


Layered windows provide the unique ability to compose a window on the desktop using per-pixel alpha blending. We take a look at how you can implement this drawing technique in Direct2D.

Kenny Kerr

MSDN Magazine December 2009

Layered Windows in WPF and .NET 4

I've been spending some time reading up on layered windows in previous versions of the .NET framework (<= 3.5) and how performance has been improved. Dwayne Need has a good reply here (although from 2007): http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/e6c0a499-9104-4971-ad5f-949dbe4de910 First of all, I'm a little puzzled as to why layered windows are rendered in hardware using DirectX and then copied to GDI for the bitmap effects. Is that a video-mem to sys-mem copy or does GDI use a hardware buffer, too? For Vista and Windows 7, I thought the whole point of the DWM was to perform window compositing such that Direct3D-enabled windows would render in hardware and the DWM would simply use those buffers and make sure they were blended correctly together and so on. Now it sounds like GDI is a part of the path, and I thought it was almost considered an obsolete technology on Vista and Windows 7. Is this still true in .NET 4? The default window menus in a WPF application contain a drop shadow. As far as I've been able to tell, the menus are layered windows which means the menus themselves are rendered by WPF in hardware and then GDI and UpdateLayeredWindow are used render (and blend) the menus on top of the WPF window. Does that mean the bitmap effects of the shadow are drawn using GDI rather than Direct3D? If the DWM need to take the final window and composite it

Getting AppDomain.UnhandledException event to work in a Windows Service

Nearly every forum thread I have found on "catching unhandled exceptions in a service" seems to end up where I am.  The supposed solution is the use of the AppDomain.CurrentDomain.UnhandledException event.  But it doesn't work for someone, who then asks why and gets no answer.  Same for me; I can't get the event to happen.  It's as if I need the ServiceProcess version of Application.SetUnhandledExceptionMode(), which doesn't exist. For diagnosing this, I start a timer in a child object of the service and then throw an exception in the timer event handler.  Simple enough to simulate the real situation.  I have tried subscribing to the UnhandledException event in at least a half dozen locations throughout the service, from the Program that runs ServiceBase.Run() to the constructor of the object that owns the Timer, but it never catches this exception. The VS debugger recognizes that the forced exception is unhandled and takes me to the place where is thrown, letting me know it is an unhandled exception. Why doesn't my handler catch it?  Running without the debugger, the exception throws, the timer thread crashes, the service continues merrily along, and nothing gets logged anywhere.  That is NOT the result I need.  What are the people for whom this works doing that I am not doing? How can I at least get the offe

Getting my sql database app to work on any windows pc

Hello I have just made a vb.net database application using visual studio 2008 with the service based database component. The application works fine on my pc but when i copy my application and the .mdf file and test it on another windows pc that does not have visual studio 2008 installed it  says that sql server is not propery configured and or is missing. I am just wondering how I can configure the sql server so that my application can read,save,add, delete my stored data on any pc. I tried to install the sqlsetup files but I still get the same error message. Would appreciate if someone could give some hints or help with this issue. Thanks!    

logoff doesn't work through windows service

Dear Friends, I am facing this problem on Windows 2003 and 2008 Server. On XP it works fine. I have written and Windows Service that takes receives the command and executes tasks such as Logoff, Shutdown, etc. All the commands except Logoff works fine. I tried following ways to perform the Logoff. However it didnt work. Try 1:                 Process.Start("shutdown", "-l"); Try 2:     [DllImport("user32.dll")]     public static extern int ExitWindowsEx(int uFlags, int dwReason);     ExitWindowsEx(0, 0); Try 3:     Process _currentProcess = new Process();                _currentProcess.StartInfo = new ProcessStartInfo("shutdown", "-l -f");                _currentProcess.StartInfo.UseShellExecute = false;                 _currentProcess.Start(); Try 4:     Process.Start("logoff.exe", null); If I write a simple C# based applicatin (not Service) it works fine for all the tries that I have made. I am facing this problem only when I put this code

Windows explorer view doesn't work on Windows 7

We are running Office SharePoint 2007 with SP2 on windows 2003 server. All windows 7 with IE 8 gets this message: " Please wait while Explorer View is loaded. If Explorer View does not appear, your browser may not support it". when click Windows Explorer in View. All Vista and XP work fine. I have tried these: 1. Added the SharePoint site on a Trusted Site. 2. Web Client is set to Automatically start, and that it is started. 3. We have Office 2003 installed on all computers. 4. We also tried to enable Comtability View. Is there a fix?Bob Lin, MS-MVP Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Setup Windows, Network, VPN & Remote Access on http://www.howtonetworking.com

What is the best way to develop a multi-page Windows Application (i.e. work like a web app - no pop-

Hi, I have implemented a toolstrip and want to use this as my menu to change current page (just like a web application). I DON'T want extra forms popping up.    I ask this question as in the past I have always used TAB Control, but now that I'm using the toolstrip I don't require the Tab Buttons themselves. Can I hide these buttons, during runtime. Obviously I only need one tab displayed at a time. I have looked at using a panel, but that means I can't flick between panels during design stage. Any suggestions would be really appreciated. Thanks. John.      

What is the best way to develop a multi-page Windows Application (i.e. work like a web app - no pop-



I have implemented a toolstrip and want to use this as my menu to change current page (just like a web application). I DON'T want extra forms popping up.   

I ask this question as in the past I have always used TAB Control, but now that I'm using the toolstrip I don't require the Tab Buttons themselves. Can I hide these buttons, during runtime. Obviously I only need one tab displayed at a time.

I have looked at using a panel, but that means I can't flick between panels during design stage.

Any suggestions would be really appreciated.






Downloading images from one windows service to another



We have a client application in which one windows service in one datacenter is calling windows service in another datacenter(both datacenters are on LAN over WAN) to fetch images.

The problem we are facing is that during the bandwidth crunch, sometimes timeout occurs while downloading the images.

Are there some techniques in remoting like chunking, buffer size, image slicing in remoting by which i can reduce/streamline the data over wire.Please suggest best practices.FYI, images size is of around 100kb-2 MB and users generally request for 2-3 images in one request.



Windows Authentication doesn't work after change of admin pass



J have read many answers about

Login failed for user ''. The user is not associated with a trusted SQL server connection

error, but I don't want to mess up in my sql server so I want to be sure that what I do is OK.

Environment description:

In my company, we have our own application wchich we use to connect to database. All users use SQL Server Auth except me. I can log using Windows Auth from server and from my second computer.

Now everything works fine.

- My comp is in our domain 'OurDomian'.

- On server in AD is admin account 'SqlAdmin'.

- In MSSMS in Security->Logins there is account: OurDomian\SqlAdmin

- on my comp account OurDomian\SqlAdmin is added

I can log to sql server from  my comp using 'Integrated Security' in application with no problem.

Problem description:

Problem starts when I change SqlAdmin password on server.

When I connect from my comp I get the above error. But when I connect from server there is no problem.

I searcher application code and I don't think that I have to change somthing in it. Probably I have to change something with account and permissions.

1. Will it bee enough to delete and add again 'OurDomian\SqlAdmi

How to Set System.Windows.Controls.WebBrowser.Document Property , navigatetostring,stream DONT WORK


Hi , i search in google , bing , cuil and all of searchs provider for the solution of this problem :


I get HTML content from HTTPWebRequest(because is much requests and if i use WebBrowser control directly i get a lag and video processing unnecessary)


And i need  set System.Windows.Controls.WebBrowser.Document with this text.


"Solution" , use new methods call NavigateToString() or NavigateToStream()

BUT THIS PROBLEM , both DON'T work with <javascript src="something.js"> or <style src="something.css">

Navigates ONLY read and process content INSIDE this tags , no external files (like 'something.js')

Solution i encountred after two weeks of search

Process the text and replace the files by the content of that.

But this i think that is no real solution. (i tested , work , but not perfectly) * I write my own code because that post dont have source code.

for why you need to do that?

because i need interact with users after search , and use html's input to re-search again and process this file with all extern files is too slow

Any solutions?

C# Lenguage

Sorry for bad english, i'am brazilian.


SqlClient Connection Works Fine with XP, will not work on Windows 7


Hello, I am programming in VS2010 wirting a simple windows forms program. I am using the System.data.SqlClient for a connection. My data Connection code:

'Used for reading data only



Public Function O

FtpWebRequest GetResponse Error on Linux Server but work on Windows Server



I have a big problem when I tried to list directory from FTP Server on linux but using the FtpWebRequest.

An error occurs at the GetResponse() method but the same code work fine on Windows Server (IIS).

The error is :

The remote server returned an error: (550) File unavailable (e.g., file not found, no access).
   at System.Net.FtpWebRequest.SyncRequestCallback(Object obj)
   at System.Net.FtpWebRequest.RequestCallback(Object obj)
   at System.Net.CommandStream.InvokeRequestCallback(Object obj)
   at System.Net.CommandStream.Abort(Exception e)
   at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage)
   at System.Net.FtpWebRequest.GetResponse()
   at FilePostman.Program.GetListFtp(NodeItem item)
   at FilePostman.Program.ReceiveFtp(NodeItem item)
   at FilePostman.Program.Main(String[] args)

The information that I use when run time like this:

Windows 2003

  Host :

  path : fmd/inbox

  uri :

  User : administrator

  Password : *******


TCP .NET Remoting never seems to work with Windows 7



I have never been able to get our .NET remoting (3.5) application to work on Windows 7.  Windows Server 2003 R2 is running a Windows .NET service running .NET 3.5.  The client is a .NET 3.5 Winforms application trying to connect to the server.

The client always times out connecting to the server.  The firewall is off (stopped the service in Windows 7)

There are no issues when using Windows XP to connect to the server.

We've tried everything - stopping firewall, adding exceptions in Win7, etc. 

Does anyone know what could possibly be going on?  Again, we've tried everything obvious.


Thanks for the help.

Windows Authentication Doesn't work properly



I've implemented Windows Authentication with kerberos protocol.

Each time user visit site they have to hit Sign in button and then they get logged in. IE doesn't recognized automatically user and signed in.

Thanks, Sam

.NET Assembly with COM interface doesn't work in 64-bit windows



I've created a simple test DLL, written in C#, with a COM interface.

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace ComInterfaceTester
  public interface IMyClass1
    string GetAString(int aiNumber);

  public class MyClass1 : IMyClass1
    public MyClass1()


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