windows

How to extract numbers from text file using Windows batch file?

I need to do the following using cmd (Windows command line). I have one file named DDD.CLI026.WK0933.DDDMR45.001.head. The data in file is as follwing (in one long line) HEAD HEALTHDMD Weekly DDD.CLI026 Centocor W200908021012 TRAIL0101 000000000581 00000CKSUM00000223680 I need to extract 581 from 000000000581 and copy it in anoth...

Is it worth checking for null pointer in QueryInterface() implementation?

IUnknown::QueryInterface() is passed a void** parameter denoting an address where to put the retrieved interface. STDMETHOD QueryInterface(/* [in] */ REFIID riid, /* [iid_is][out] */ void** ppvObject) Should the implementation of QueryInterface() check this pointer for being null (and then immediately return E_POINTER) or just write t...

When return E_POINTER and when E_INVALIDARG?

COM interfaces methods can return various HRESULT values to signal invalid argument values passed. When do I return E_POINTER and when E_INVALIDARG? As I understand if a method receives an index in an encapsulated collection and it is out of bounds that is E_INVALIDARG. If a method receives an Interface** pointer where it is meant to st...

Internet Explorer context menu context bits

I am trying to add two new entries to the context menu, one for images and one for anchors. I am using 0x2 for images 0x20 for anchors they are displayed correctly but when there is an image with a link only the image link is showed they do different things so i would like both items to show up? ...

Error 800706B5 when calling IWebBrowser2->get_Document

On Vista using IE8, I have an instance of IWebBrowser2, which I am using to obtain the current HTML document: IWebBrowser2* browser; CComPtr<IDispatch> disp; HRESULT hr = browser->get_Document(&disp); When this is executed by an Administrator, the call succeeds. However, when called by a regular user, the call returns an error code of...

How to set DB2 ODBC driver locale?

I want to import data from a DB2 database into MS Access via ODBC. The connection is set up and working but decimal values get converted due to some locale issue (German Windows). 234.75 ends up as 23475 in the Access table. I had the same issue with Oracle but was able to fix it by setting the ODBC drive to US locale. How can I do tha...

Get rid of "Publisher Unverified" warnings in Windows for executables

I have made an application for Windows & everytime I run the application by opening the executable file I get the "Publisher Unverified" warning in Windows. It is fine if I was the only audience for this app but thats not the case. Is there any way to program my app such that this message does not show up for the users. ...

Running application on Startup under different User

Hi Guys, I have a .Net app that i install and set to run at Startup. The installer also creates a user that has write permissions to the appropriate application folders and registry sections, preventing the currently running user from modifying the restricted areas. However, i am unable to figure out how to run the application under a ...

Batch file encoding

I would like to deal with filename containing strange characters, like french é. Everything is working fine in the shell : C:\somedir\>ren -hélice hélice Know if I put this line in a .bat file, I obtain the following result : C:\somedir\>ren -hÚlice hÚlice See ? é have been replaced by Ú The same is true for command output. If I ...

Get the full audio device name from Windows

Is there a way to get the full audio device name in Windows XP and later? I can use MIXERCAPS but the szPname member will limit to 32 characters (including NULL). For an audio device name of "Microphone (High Definition Audio Device)", I only get back "Microphone (High Definition Aud". This is due to MAXPNAMELEN being defined to 32. I h...

Windows Computer Profiler

We create a lot of internal tools in order to work with the data we use. Occasionally we'll run into a problem with one of those tools on a designer or artists computer and will need to spend considerable time on there computer to try and diagnose where the problem may be coming from. This creates problems because while a programmer is...

How do I compile a GNUstep application that uses NSApplication on Windows?

I am exploring with compiling an application with GNUstep on Windows. This is my main.m file: #import <???/???.h> int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [NSApplication sharedApplication]; [pool release]; } I realize this is an incomplete fragment to say the le...

Create ODBC settings at install time?

Traditionally, my client software forces a configuration of the ODBC source by going into 'Administrative Tools' and manually creating a new ODBC connection. Is there anyway to configure a new ODBC connection during an install? On a related note, is there a way to capture an existing ODBC connection for use in this theoretical process?...

Installing a windows application through web page

How can I install a windows application through web paged "Like installing yahoo messenger"? ...

How would you write a .bat or .cmd file to remove an element from the PATH?

Related: How to list the elements of the path in a batch file? How does FOR work? How would you write a batch file or CMD file to remove an element from the path? It should handle gracefully: differences in case shortnames and long names I've done this using tr.exe but it's slow and complicated and uses temporary files, which mak...

Changing a value in the machine.config

What is the effect of changing a value in the machine.config file? Will this trigger the equivalent of IISReset on the machine? If not, will a running application immediately pick up new values added to this file? ...

How to turn screensaver on (windows 7) by a code (in cmd)?

How to turn screensaver on (windows 7) by a code (in cmd)? ...

Differences between Emacs and Vim

Without getting into a religious argument about why one is better than the other, what are the practical differences between Emacs and Vim? I'm looking to learn one or the other, but I don't see a difference between them so I can't decide. I have never used an editor of this type (I've always been a bigger fan of IDEs), so anything that ...

Redirect on certain URLs

Hi I have a problem where I'm setting up an internet Kiosk in a public place and when a user goes to a certain URL I want it to redirect to another particular URL. For example I want it setup so that if a user goes to www.example.com/step1 I want the browser to automatically go to www.example.com/step2 The only restriction here is that...

Dynamically create WIX files without having to edit the wix files manually

Suppose you release the next version of your software, you will have to manually update your WIX files to remove obsolete files and add new files, etc. My use case is as simple as "recursively add the files under /sample/path in the user target C:\Program Files\MyApp". Is there a program that does this sort of automation? ...