windows

What's the best way of doing dos2unix on a 500k line file, in Windows?

Question says it all, I've got a 500,000 line file that gets generated as part of an automated build process on a Windows box and it's riddled with ^M's. When it goes out the door it needs to *nix friendly, what's the best approach here, is there a handy snippet of code that could do this for me? Or do I need to write a little C# or Java...

Powershell script to change service account

Does anyone have a Powershell script to change the credentials used by a Windows service? ...

Reading the local password policy programmatically.

Are there Windows API functions that allows reading what the current password policy is? For instance, minimum length, complexity etc. If not reading, is there a way to verify a password against the policy programmatically? ...

Windows Programming: How to put a file that is frequently accessed in the OS cache?

Windows Programming: How to put a file that is frequently accessed in the OS cache? ...

What Is The Best C++ Sound API For Windows?

I am programming in C++ (Visual Studio 2008) and wish to do the following in both Windows XP and Windows Vista. Play audio files (wav, mp3, others if they come along for free...) and be able to control the left/right sound levels independently. Play tracks from audio CDs and be able to control the left/right sound levels independently....

Windows GDI: horizontal/vertical DPI

When obtaining the DPI for the screen under Windows (by using ::GetDeviceCaps) will the horizontal value always be the same as the vertical? For example: HDC dc = ::GetDC(NULL); const int xDPI = ::GetDeviceCaps(dc, LOGPIXELSX); const int yDPI - ::GetDeviceCaps(dc, LOGPIXELSY); assert(xDPI == yDPI); ::ReleaseDC(NULL, dc); Are these va...

Windows domain changed cause sql2005 login fail

My company change the domain from abc to xyz and now i can't log into my local sql2005 via Windows login nor sql login. both login gave me this error: An error has occured while establishing a connection to the server. blah blah blah...Sql server does not allow remote connection. Error:26 - Error locating Server/Instance specified. i ...

Behavior of SIO_FLUSH

When SIO_FLUSH socket ioctl is used in a Windows environment (in user space), I am confused as to what happens. Does this: (1) completely discard the data from the TCP/IP send queue into a black hole, or (2) push the queued send data across the connection until the buffer is empty, or (3) something else? Thanks! ...

Windows 2000 and Windows 2003 RC2 encryption/decryption using windows Crypto API?

Our app encrypts a value using RC2 in C++ code and I wrote a decryption routine in .NET The problem is that it works fine on our dev server, which is Windows 2003 but fails on the Windows 2000 one. It's running the same code and I checked everything else and it seems there are differences in the way the 2 encrypt. Has anyone had any ...

Can I use two incompatible versions of the same DLL in the same process?

I'm using two commercial libraries that are produced by the same vendor, called VendorLibA and VendorLibB. The libraries are distributed as many DLLs that depend on the compiler version (e.g. VC7, VC8). Both libraries depend on a another library, produced by this vendor, called VendorLibUtils and contained in one DLL. The problem: Vendo...

Open Dialog preserving settings

How does one preserve the settings in the Open Dialog box? For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified. ...

Is Azure an Operating System or a Framework?

MS is calling Azure an Operating System. To me, it feels much more like a framework. I am having a bit of trouble defining the two separately. I have a general intuition, but I am not articulate enough to really say if Azure is really an OS or just a framework sitting on top of Operating Systems. ...

How to set an application as the default program of opening a certain type of file programmatically?

There's an executable file generated from my program in MFC and I want to use it as the default program to open the .jpg files. That is to say, each time I double click a .jpg file, my program will run. I tried to add some registry entries linking .jpg files with my program, such as HKEY_CLASSES_ROOT.jpg\shell\open\command (set its val...

"import wx" fails after installation of wxPython on Windows XP

I downloaded and installed this version of wxPython for use with my Python 2.6 installation: http://downloads.sourceforge.net/wxpython/wxPython2.8-win32-unicode-2.8.9.1-py26.exe When I run Python and try to import wx, I get the following error: C:\Program Files\Console2>python Python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 ...

What tools do you use to profile (native)C++ on Windows?

How do Window's programmers profile their native C++ code? On Unix/Linux you have gprof [thanks Evan] & valgrind (I personally used this one, although it's not a real profiler), and recently I'm on Mac and Solaris, which means I moved to dTrace. Now when I've had the need to profile on Windows in the past, like at my previous job, I used...

Batch File

Hi All I have a batch file that does this. ECHO A41,35,0,a,1,1,N,"Mr ZACHARY KAPLAN">> test.txt There are about 30k similar lines. It takes the batch file about 5 hours to run. Is there a way to speed this up? /Jeanre ...

What Are The Implications of Dropping Windows 98 Support?

Up to now in my application, I've been supporting all flavors of Windows from Windows 98 to Windows NT/2000 to XP to Vista. But because of adding Unicode in my next version, support of Windows 98 would still be possible, but very difficult. I know there are still some of my users running Windows 98. What are the pros and cons of me n...

What is the best way to track and lower GD handles?

what is the best way to track and lower GDI windows handles . . ...

Minimal runtime for Mono for a Vb.net VS2005 app on Windows?

Does anyone know, or have a link to an article or a step by step tutorial, that would tell me how to distribute a .net MONO application with a minimum install? The full package of Mono is like 75 MB but I know al lot of that is the compiler and libraries that I don't need. I just want the minimum runtime files. What files would I need ...

How can I programmatically create a Windows VPN connection?

I have a support environment where we connect to many of our customers' systems using VPN and Remote Desktop. Right now, support personnel have to manually set up the VPN connection on their workstation. Is there a way to programmatically create the VPN connection? ...