windows

Tomcat on Windows server woes

Hi, Synopsis: When calling an executable that links to shared libraries from Java code on Tomcat, I get errors on Windows 2003 whereas the executable works great on a command prompt. I wanted to do this in Linux, but, alas, got outvoted and have to implement it using Windows Server 2003. Here it goes, I have a simple Java code running...

Why do libraries implement their own basic locks on windows?

Windows provides a number of objects useful for synchronising threads, such as event (with SetEvent and WaitForSingleObject), mutexes and critical sections. Personally I have always used them, especially critical sections since I'm pretty certain they incur very little overhead unless already locked. However, looking at a number of libr...

Using "Git externals" with Subversion?

I recently had occasion to add a dependency on a Git-hosted project to a Subversion-hosted one. After adding support for an ad-hoc "git:externals" property to the parent project's packaging script to manage this dependency, it occurred to me that someone may have found such a property handy before and that it would be awfully nice if th...

Windows user credential validation on a different domain

Hi, I'm trying to validate a user's windows credentials on a computer that's not joined to the domain. It seems like this should be possible to do using the SSPI API, but I haven't been able to get it to work. I included the code that I've been trying (resource cleanup omitted for brevity). These are the important pieces of informatio...

What software switcher (KVM) do you use for multi platform development?

I am mostly interested in developing for windows (primary) and a mac. I have a normal PC and a mac mini, and I want to be able to use a single keyboard, mouse and a monitor with both. Which kvm software do you recommend? I was looking for hardware kvms but I am using a 30" lcd which is only supported by 1 belkin kvm and people report ...

Where to save ini file dependent to machine (not user) on windows

My application is currently storing settings in an INI file under the current user's profile (C:\Documents and Settings*\<CurrentUser>*\Application Data\MyApplication\MySettings.ini under WinXP). But I've realised some of these settings are unique to the machine not the user and thus want (actually need) to save them in a single locatio...

How to make psql completion with Windows?

There is a completion function by the psql command of Cygwin or UNIX There is not the function in psql for a Windows native. How to make psql completion with Windows? ...

Locking files in windows

I am working on some legacy code which opens a file and adds binary data to the file: std::ifstream mInFile; #ifdef WINDOWS miWindowsFileHandle = _sopen(filename.c_str(), O_RDONLY , SH_DENYWR, S_IREAD); #endif mInFile.open(filename.c_str(), std::ios_base::binary); For some reason the code opens the file twice...

What encoding/code page is cmd.exe using

When I open cmd.exe in Windows, what encoding is it using? How can I check which encoding it is currently using? Does it depend on my regional setting or are there any environment variables to check? What happens when you type a file with a certain encoding? Sometimes I get garbled characters (incorrect encoding used) and sometimes it k...

Get common desktop path in .NET

I need to store files into the common desktop on Windows. The application is a very special application for exactly one special PC (device preparation), so it had to be easy for non-techie users to find and modify the configuration file. Now we switched to a domain, and because different people (with different accounts) should use the so...

webcam access in c++

I want to access the webcam so I can do some precessing on the images, like tracking a light, but I can't find a way to access the webcam. I googled it but I got confused. Can you point me to a library that can do that (windows)? and maybe also provide an example? I would need to periodically get a pixel map of the image, about 20 time...

Where can I find friendly strings for SQL Server versions?

The friendly string for 9.00.4035.00 is SQL Server 2005 SP3 Express Edition. I would like to convert version numbers to string by accessing only registry or a dictionary. Can I find a list? ...

How to move multi files using SHFILEOPSTRUCT?

How to move multi files using SHFILEOPSTRUCT? vector<CString> srcPaths; vector<CString> dstPaths; SHFILEOPSTRUCT FileOp;//定义SHFILEOPSTRUCT结构对象; int fromBufLength = MAX_PATH * imageVec.size() + 10; TCHAR *FromBuf = new TCHAR[fromBufLength]; TCHAR *ToBuf = new TCHAR[fromBufLength]; shared_array<TCHAR> arrayP...

How to install RMagick gem in Ruby 1.8.6 MingW?

Do you have a detailed guide for this? Thanks a lot :) ...

Check for existance of all files before building a project

How would one go best about checking for existance of all files before building ? Let me explain; I mostly build stuff from the command prompt. No problems there, just put the build command and all in the one .bat /.cmd file, and run it. It works fine. But, for the normal running of my program, for example, I need several source files...

How to get real text dimensions when ClearType is on?

I have a Win32 GUI application that uses GDI havily. It needs to draw text over a bitmap at specified coordinates and later erase it and substitute with the original bitmap. I proceed as follows: select font (GetStockObject( DEFAULT_GUI_FONT)), brush, other stuff into the device context call GetTextExtentPoint32() to compute the size ...

Modal MessageBox on another Process' Handle may lock-up target Process

If I show a MessageBox as modal of a window on another process, it works just fine as long as my program remains responding. If it is closed or terminated while the MessageBox is showing the windows that received the MessageBox will be locked (but still responding) and it will have to be finalized via Task Manager. Here is a sample code...

Selenium run as a Windows service to take screenshots on errors

I would like an automated web tests suite based on Selenium RC to take screenshots of pages when some errors are encountered. The test suite is a part of the continuous integration process and technically is executed by CruiseControl running as a Windows service. The selenium.captureScreenshot() method is called to trigger the actual s...

How do I track the application z-order/focus?

I want to talk to the application that was used just before my application, how can I find out which application had focus last? ...

WM_ERASEBKGND not followed by WM_PAINT

My app is getting a WM_ERASEBKGND message which is not followed by a WM_PAINT message. Naturally enough my application erases the background, and then just sits there with a blank window. I am running under Vista, but it happens under XP as well. I am pretty sure it is my fault, but what could I be doing so that Windows does not behave?...