windows

A good (and free) VCL GUI alternative

I've got a project with a rather messy VCL codebase built on Borland C++ Builder 6. I intend to rewrite most parts of it since it's hardly maintainable in it's current state. I'm looking for a good and free alternative to VCL. It is a Windows-only closed source commercial project. So main requirements are: Free for commercial closed-s...

Compile Build and c file on Windows

I have a directory that has the following files Build asc2uni.c asc2uni.1 I have to compile it, but the problem is I don't know how what is the compiler to use for this format and how to do it. Any ideas? Edit: I am trying to compile this on Windows XP. Edit 2: The Build file content: cc -I../Modules -O -o asc2uni asc2uni.c ../M...

shutdown a hard drive

How can you shutdown a harddrive ? i want to do this to be able to safely remove my sata drive even though it's hotplug. WMI does't seems to have the method. ...

Question about hard drive , 'seek' and 'read' in windows OS

Does anyone know when calling 'seek' and 'read' , how is the hard-drive physicly affected? If i'll be more specific, I know that the harddrive has some kind of a magnetic needle that is used to read the data from the magnetic plates. So my question is , when is the needle actualy moved to the reading location? Is it moved when we are c...

Is anybody experiencing slowness when using Visual Studio 2008?

Is anybody experiencing extreme slowness when using Visual Studio 2008? I have a fairly beefy machine so I don't think hardware is the issue, and I didn't have these issues with 2005. Basically everything that I do is slow, from opening a new project, to opening code, to saving files. All of my Windows Updates are up, I have VS2008 SP...

Backup Algorithm

I am looking at writing a program (.Net)for backing up files on a computer. How would I go on about knowing what files have changed to backup (I don't really want to scan the last modified dates each time. Are there any backup algorithms for backing up only the bits of a file have changed. What are the O notations for the algorithm? ...

How to setup Mercurial and hgwebdir on IIS?

I've been looking all over for decent instructions on how to get hgwebdir working on IIS but I haven't found much of worth. There's this "step by step" on the Mercurial wiki, but it's not very good. There's also this and this, but again, I can't find good steps to lead up to where those get started. ...

SQL Server's port is blocked

Developed a Windows application that remotely accesses an SQL Server online. However, the client's ISP blocks port 1433. What are the other options to connect to SQL Server from the windows app? ...

Send large byte arrays between AppDomains in the same process

I'm building a network server and starting a lot of AppDomains on the server to which requests are routed. What will be the fastest way to send off a request payload to one of the AppDomains for processing? Read in the payload from the socket into a byte array and marshal it. Marshal the network stream (inherits from MarshalByRef) to t...

PostMessage() on Vista64 behaves weird

The scenario is like Process A invokes certain function foo in Process B, that actually does a PostMessage() on Process C. Process A invokes the function foo when then there is a WM_KEYDOWN message. This works just fine on all 32 bit platforms, but on Vista 64 - when there is a single keydown a burst of events is generated and there a...

How to implement CTRL-A key combination in C++

I want to implement some action when CTRL-A is pressed . How can I do this in C++ on Windows Platform . I am using VS 2005 . Any pointers will help. ...

How to run my ruby application using ruby extension library (in c), in windows?

Hello, I would be thankful for any help on this: I want to write an extension to my c library. I created file zmq.cpp that uses library libzmq (written in C++). I created makefile using ruby extconf.rb, then I run nmake. It all went fine. Nmake generated files librbzmq-i386-mswin32.def librbzmq-i386-mswin32.lib librbzmq-i386-mswin32...

IIS 6.0 Debugging methods

I need some help from you about debugging high CPU usage (w3wp.exe) on server (Windows Server 2003 R2). I used debugdiag to anaylze but the problem is that this piece of software is not detecting any kind of problem. Have you ever met any problem with high CPU usage on w3wp.exe (100% all the time)? Have you got any tutorial how to debu...

Maximum CreateProcessWithLogonW and NetUserAdd

I have written a small function that will load multiple instances of an executable using CreateProcessWithLogonW the pseudo-code: for ( i=0;i<100;i++) { sprintf(user,"user%i",i); sprintf(pass,"pass%i",i); if(NetUserGetInfo(user,pass)==NOT_FOUND) { NetUserAdd(user,pass); } aaProcessCreateWithLogin("prog.exe",user,pass); } it wo...

How to hook external process with SetWindowsHookEx and WH_KEYBOARD

I am trying to hook for example Notepad without sucess. Making a global hook seems to work fine. Testing on XP SP2. Edit: Amended code works now. MyDLL code #include <windows.h> #include <iostream> #include <stdio.h> HINSTANCE hinst; #pragma data_seg(".shared") HHOOK hhk; #pragma data_seg() //#pragma comment(linker, "/SECTION:.share...

Is it possible to duplicate the following credential process in VB.NET?

Solution (kinda): Turns out this impersonation with .NET's security only allows application-level access. Since the COM object is at the system level, the impersonated user still cannot instantiate it. I figured this out by right-clicking the executable and selecting "Run As...", the program functioned fine. I found out that launches t...

IIS log files and load balancer?

We host our ASP.NET applications on two web servers (Server 2003, IIS 6) that reside behind a hardware load balancer. When I look at the IIS logs, the c-ip value in the IIS (v6) logs are ALWAYS the IP address of the load balancer. I noticed in the http headers, there is an X-Forwarded-For header that appears to have the requesting IP add...

Wrong hour in C++

// Simple program to get the date and time on Windows // It compiles and works fine but displays the wrong hour! // Using Visual C++ 2008 Express on XP SP2 #include <Windows.h> #include <iostream> using namespace std; void main() { SYSTEMTIME st; GetSystemTime(&st); cout << "Year : " << st.wYear << "\n"; cout...

Ho do I go about getting and setting the input language of another application?

Here's the problem: I have a user with disabilities and using a specialized virtual keyboard. He doesn't have any trouble switching languages in his virtual keyboard, but it doesn't always change the input language (input keyboard?) of the currently-active application - which is exactly what he needs. So is there any API calls I can do ...

How to open an std::fstream (ofstream or ifstream) with a unicode filename ?

You wouldn't imagine something as basic as opening a file using the C++ standard library for a Windows application was tricky ... but it appears to be. By Unicode here I mean UTF-8, but I can convert to UTF-16 or whatever, the point is getting an ofstream instance from a Unicode filename. Before I hack up my own solution, is there a pref...