windows

Syncing Rails development environments on my two computers

So far I have been building my Rail app on a Mac OS X box using TextMate. It's just me, so I haven't used Git. I have just opened and closed the code in the file system, used an AppleScript to take annotated snapshots at key moments, and let Time Machine take care of the rest. I've just ordered a Windows laptop which I'll use for the s...

Error while reading files with native code on windows mobile

Hi all! I'm new here and my english is not really good. Apologize any inconvenience! I'm programming an application for windows mobile with native code (MFC). I'm trying to open a file and this is driving me crazy. I've tried to open it in a thousand diferent ways... And I really achieve it, but when I try to read (fread or getline) t...

Writing Windows service in WCF

Hi I want to write windows service in wcf After searching a lot I only found were tutorials of writing webservice in wcf not windows service. Can any one please provide a link to any tutorial which explains how to write windows service in WCF ...

When implementing several COM interfaces at once how do I upcast to IUnknown?

Suppose my COM object implements two or more COM interfaces: class CMyClass : public IPersistFile, public IPersistStream { }; when implementing QueryInterface() I need to be able to return an IUnknown* pointer. Since both base interfaces are derived from IUnknown I cannot upcast implicitly - such upcast would be umbiguous. To upcast e...

LNK1106 with big binary resource

I have a rather huge .dat-file (896MB) included as a BIN resource in my project. Now I get a LNK1106 link error ("fatal error LNK1106: invalid file or disk full: cannot seek to 0x382A3920".) I use Visual Studio 2005 under Windows XP, and have tried on a 4GB RAM machine with high Virtual Memory settings and lots of disk space. I have tri...

Converting Dataflex/PowerFlex Program for Windows

I have an old program written in Dataflex/PowerFlex from back in the mid 90's and I would like to see if I can get it running on Windows. I have all of the raw code files, but I don't know if I'm missing a runtime, the program needs to be complied or what. I do know that I've seen this program run before, but it had to be fired up throug...

Referring to MS Windows special folders in Emacs

Is there a simple way to find a file on my desktop in Emacs? Instead of going the "C:\Documents and Settings\MyName\Desktop\" way... Maybe there is a way to define aliases in my .emacs which I can use during find-file? ...

How to programmatically tell if two variables are on the same stack? (in Windows)

I'm in a thread. I have an address. Is that address from a variable on the same stack that I'm using? static int *address; void A() { int x; atomic::CAS(address, 0, &x); // ie address = &x // ... } void B() { int y; int * addr = atomic::read(address); // ie addr = address if (addr && on_same_stack(&y, addr)) ...

What is preventing my .NET 2.0 application from running on a 64-bit platform?

I have a .NET 2.0 application that won't run on a 64-bit OS (the customer tried both Server 2003 and Windows 7). The error message is: The application failed to initialize properly (0xc0000135). Googling this message returns little helpful information (one link I found just said if you get this message it's because they don't suppo...

C++ Access to command line arguments outside main?

I have a couple command line apps that both end up calling into com objects. Rather than adding new interface to these com objects, can they access the parameters passed from the command line? Edit: Sort of how I can call GetModuleFileName to get the file name. Im wondering if there is an equivalent method to get the args. ...

Turning display off from Windows Service

I have written a Windows service which should turn the display OFF when certain conditions occur. The code I am using is : private const int MONITOR_OFF = 2; SendMessage(GetDesktopWindow().ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); This same code works from a Windows application but when executed from Windows service...

The Price of DuplicateHandle

Hello :) I'm writing a class library that provides convenient object-oriented frontends to the C API that is the Windows Registry. I'm curious, however, what the best course of action is for handling HREGs, for instances where my key class is copied. I can either Allocate a heap integer and use it as a reference count. Call RegCloseK...

callback/event management with COM/Ole/ActiveX

I am writing a native COM/Ole/ActiveX wrapper for a scripting language. I need some advices to implement events/callback (like onreadystatechange from Microsoft.XMLHTTP object) I noticed that some COM objects can call my custom object through an IDispatch interface. Is it the only way to manage events ? ...

CPU Numbering on a hypertheading enabled system

Hi, I am trying to find out how an OS (Windows, linux) assigns numbers to logical cpus in a Hyper threading enabled environment. ? Does both the OSs first serially assign numbers to the Physical CPUs and then start numbering the logical cpus or is there some other rule followed.. ? e.g. in 2 physical cpu system with hyper threading , d...

SetupDiGetDeviceInterfaceDetail returns only "\" for the path of all USB HID objects

I can tell how many USB HID devices I have (7), but every time I try to get details on any device, the path returned for it is always "\", making it so that I can't access the device at all. I'm using code that is very similar in procedure to this code: HANDLE connectDeviceNumber(DWORD deviceIndex) { GUID hidGUID; HDEVINFO hard...

Bringing active program to the front - with a twist

I have a program written in foxpro (~shudder~) that I've inherited. The issue is, it has some COM controls in it. When you start 2 copies, the second copy will throw errors. So I thought, this could be cleaned up to bring the active copy to the front allowing only a single instance. That would be fine, but the program takes a command...

How might I obtain the IContextMenu that is displayed in an IShellView context menu?

Building a file open dialog replacement. Much of it works now, but I would like to generate the view-mode drop-down for the toolbar directly from the shell view object. Looking at IShellView2, I can see IShellView2::GetView() will give me the FOLDERVIEWMODE's supported. However, that doesn't give me the names of these modes, nor forma...

How can I use my multiple cored dedicated server to run my java application?

I have a game built in a java environment and I use JVM. I have 4 cores @ 2.4Ghz and my server is only using one of those cores... I've tried and searched and I still have no guides to setup multiple cores to run the game like, say 1 core for running the character saving + loading, and 1 core for the server itself, and 1 core for a hel...

Adobe Air GUI Question

Hello, I am new to Adobe Air and I have just started to learn. I am using FlexBuilder 3 to build a desktop app for Adobe Air. I am a bit confused with the GUI development. The app I am building has multiple input screens. What are the best practices for this type of app in terms of windows and input screens? Should I use the Viewstack ...

Max Outgoing Socket Connections in .NET/Windows Server

I have a slightly unusual situation where I'm needing to maintain CLIENT tcp connections to another server for thousands of mobile users on my servers (basically the mobile devices connect to my middle tier server when they are able to, which maintains a more stable connection to the 3rd party server for the mobile devices). Anyways, I'...