windows

Python, C: redirected stdout fires [Errno 9]

I try to log all the output of a program written in Python and C. However, printing from Python causes IOError: [Errno 9] Bad file descriptor Please, does anyone know what the problem is and how to fix it? PS: It's on Windows XP, Python 2.6 and MinGW GCC #include <windows.h> #include <fcntl.h> #include "Python.h" int main() { int...

Measure CPU / RAM usage of a program

Hi, could anyone suggest a way (other than using Task Manager) to track and log a program's usage of CPU and RAM in order to profile its performance? I'm working under Windows. Something generic would be useful. A more specific request solution would involve Visual Studio. I've tried Performance Wizard, but it doesn't seem to give me t...

How to have a DLL work on different Windows versions?

I'm compiling my own DLL comprised of several .o files. One of the .o files has a function that calls SHLoadLibraryFromItem that is supported on Windows 7 only. The function is never called unless the application that uses the DLL is running on Windows 7. (Yes, I'm sure.) However, when running the application on an older version of W...

Setting up an emacs environment in windows?

I am currently constrained to a windows dev box and I want to migrate my projects from eclipse to emacs. What are some good references on setting up an emacs dev environment for windows? Anything that could assist in migrating from eclipse as well would be appreciated. ...

Compiling Qt Creator with MinGW

How does one recompile Qt Creator using MinGW in Windows XP? ...

Developing ActiveX controls

I would like to develop an ActiveX control and as I don't own visual studio I'm wondering whether I can use VisualC++ express edition on it's own, or do I also need the Windows Platform SDK? ...

How to recursively delete an entire directory with PowerShell V2

What is the simplest way to forcefully delete a directory and all its subdirectories in PowerShell? I am using PowerShell V2 in Windows 7. I have learned from several sources that the most obvious command, Remove-Item $targetDir -Recurse -Force, does not work correctly. This includes a statement in the PowerShell V2 online help (found u...

IIS SMTP Server

I am trying to set up an SMTP server on a virtual private server. I have typically hosted applications with hosting companies in the past. I am using SMPT on a website to send mail but need to configure IIS's SMTP Server to allow me to send the mail. I have a couple of questions around this: 1.What settings do I need to set to enable m...

How to disable buffer overflow checking in the Visual C++ Runtime?

i, and a few thousand other people, are getting an error being thrown by the Microsoft Visual C++ Runtime: Which for the benefit of search engines, says: Microsoft Visual C++ Runtime Library Buffer overrun detected! Program: %s A buffer overrun has been detected which has corrupted the program's internal state. The program cannot ...

Checking all files are encoded as UTF-8

Does anyone know of a Windows app that can scan through a directory and check which scripts are/aren't encoded as a specified charset (UTF-8 in this case)? I could do it manually, but that could take a while and is quite error prone! ...

What happens if I violate the requirements imposed on ProgIDs?

This MSDN article states that any ProgID must meet several formal requirements, length restriction included. However nothing is said about what happens if those are violated. I found several places in our codebase where ProgIDs are longer than 39 characters, still everything seems to work allright for them, ProgIDFromCLSID() and CLSIDFr...

Receive WM_COPYDATA messages in a Qt app

I am working on a Windows-only Qt application, and I need to receive data from a Microsoft OneNote plugin. The plugin is written in C#, and can send WM_COPYDATA messages. How do I receive these messages in a C++ Qt app? I need to: Be able to specify the "class name" a window registers as when it calls RegisterClassEx, so that I can ma...

What event id to use for my custom event log entries?

Is there any ranges of valid event IDs which should be used by custom applications while logging to Windows EventLog? Or I can use any event ID of my choice (1,2,3,4....). P.S, I am developing in C#.NET. ...

Is there any documentation on IdentityUnmarshal interface?

Whenever I put my component into COM+ and call CoCreateInstance() on the client the following happens: the runtime instantiates the objecs (calls IClassFactory::CreateInstance()) the runtime calls QueryInterface() for the interface specified in teh CoCreateInstance() call the runtime calls QueryInterface() for IdentityUnmarshal interfa...

Batch Script issue

Hello, for deleting files, I will be using the code below to remove the oldest file in the directory and run it every day. It came from the question of mine. Applying to the original batch script: SET BACKUPDIR=C:\PATH\TO\BACKUPS FOR /F %%i IN ('DIR /B /O-D %BACKUPDIR%') DO SET OLDEST=%%i DEL %BACKUPDIR%\%OLDEST% Something such as th...

How can I detect all interfaces a COM object implements?

Is there any way for a consumer to enumerate all interfaces implemented by a given COM object? ...

ResourceManager's CreateFileBasedResourceManager method is not working

I am currently usign resourcemanager's constructor to read the entries from my resource files. When I try to use CreateFileBasedResourceManager method it is throwing the below error Could not find any resources appropriate for the specified culture (or the neutral culture) on disk. baseName: Resource1 locationInfo: fileName: Resource1...

CPU cache flush

I am interested in forcing a CPU cache flush in Windows (for benchmarking reasons, I want to emulate starting with no data in cpu cache), preferably a basic C implementation or win32 call. Is there a known way to do this with a system call or even something as sneaky as doing say a large memcopy? Intel i686 platform (P4 and up is okay as...

Threadpool is getting used by windows service problem

Hi Guys, I have created a windows service which is currently having three timers. First timer is waking up every 15 sec, second timer is waking every min. and the third timer is waking everyday. THe problem is these are spawning new threads every time and one time the threadpool gets used up completely.Is ther any to just spawn 3 thread...

Obtain the true name of the currently select file in the common file dialog?

One can get the text of the selected item in the list-view of a common dialog. But one can NOT get its PIDL, and if the user has chosen to hide known extensions (the default), then one cannot really tell what file was selected without either its extension or its PIDL. So possible ways to solve this might be: Obtain an IShellView fr...