windows

In windows,how do we identify whether a file is 64 bit or 32 bit?

In windows,how do we identify whether a file is 64 bit or 32 bit? ...

C - Feof(stdin)-how to indicate end of input in Windows?

Hi I have this code int x,y,m; for(;;){ m=scanf("%d %d",&x,&y); if (m!=2 || m==EOF){ break; } else{ printf("/%d/%d/\n",x,y); } } if (feof ( stdin )){ printf("End of input\n"); }else if(m!=2){ printf("There was an error\n"); } Under linux ctrl+D indicates end of input , and for windows ctr...

C++: Datatypes, which to use and when?

I've been told that i should use size_t always when i want 32bit unsigned int, i dont quite understand why, but i think it has something to do with that if someone compiles the program on 16 or 64 bit machines, the unsigned int would become 16 or 64 bit but size_t wont, but why doesnt it? and how can i force the bit sizes to exactly what...

Correct way to find out if a service is running as the SYSTEM user

Hi All. What is the correct way to find out if a process is running as the SYSTEM user. I'm looking for a win32 C API to check for the system user. We used to check if the username was "SYSTEM", but since Windows Server 2008 R2 the SYSTEM user appears to be localised. I.e SYSTEEM on a Dutch system. I cant find much information about...

How to open different websites from same physical directory and different Default documents in iis7?

title says all..... ...

Passing a file with multiple patterns to grep

Let's say we have two files. match.txt: A file containing patterns to match: fed ghi tsr qpo data.txt: A file containing lines of text: abc fed ghi jkl mno pqr stu vwx zyx wvu tsr qpo Now, I want to issue a grep command that should return the first and third line from data.txt: abc fed ghi jkl zyx wvu tsr qpo ... because each o...

Performing GLM within python script on windows 7 64

Dear Stackoverflow users, I'm trying to perform GLM (Generalized linear model) repeatedly within a python script (within a loop). 1- I tried to use Stats within Scipy glm function but description is quite inexistant and I think I did not use it well --> error message "ValueError: only ttest_ind implemented". I searched within stats.py f...

Direct access to memory devices under Windows / Linux

Hello I'm currently writing a software to test the integrity of flash-memory devices. (using c++ iostreams) To achieve this goal files with random content are written to the device, read back, copied, moved, compared ( I put the device under stress condition, and check if the data is valid from time to time)... Everything looks great on...

Passing more than one variable to ExecMethod

I am trying to call wmisetbrightness, but it takes two inputs. How do I pass more than one input to ExecMethod? Code snippet below is obviously wrong. // set up to call the WmiSetBrightness Method BSTR MethodName = SysAllocString(L"WmiSetBrightness"); BSTR ClassName = SysAllocString(L"WmiMonitorBrightnessMethods"); IWbemClassObject* pC...

Does marshaling a marshaled interface give me a marshaller to the proxy or the original interface?

Here is a concrete example: I create a IWeBrowser2 interface by calling wb.CoCreateInstance(CLSID_InternetExplorer, 0, CLSCTX_SERVER);. This gives me a marshaled interface from my process into whichever of the running iexplore.exe processes happens to contain this browser tab in my thread A. Now I use the IGlobalInterfaceTable to get a...

Python file.write creating extra carriage return

I'm writing a series of SQL statements to a file using python. The template string looks like: store_insert = '\tinsert stores (storenum, ...) values (\'%s\', ...)' I'm writing to the file like so: for line in source: line = line.rstrip() fields = line.split('\t') script.write(store_insert % tuple(fields)) script.writ...

win32: detect if start menu is auto-hidden?

I want to position a window at the bottom of the screen. If the start menu is present, I want it to lie along the top of the start menu. If it is not (or it is auto-hidden), I still want it to be in the same position as it would be if the start menu was there, meaning there will be a gap of a few pixels. Currently I get the monitor work...

Transforming a c# class into a visual control

Hi, I new to c# and windows form programming. Here is the problem i am trying to solve. I have to write an application that uses an multiple instance of an ActiveX control. Therefore, I dragged as many control as necessary to my Form. Now my problem is that i'd like to add some personalised methods to this activeX. The logical solution...

Windows WMI recent hardware detection

WMI : I don't know how to detect these hardware : DDR3 memory ms online docs, memorytype lists only DDR2 http://msdn.microsoft.com/en-us/library/aa394347%28v=VS.85%29.aspx hard disk with SATA : it seems WMI reports IDE notebook integrated video camera Do you know about other tips / caveats using WMI and recent hardware ? Is there an...

How to connect to a DB on windows

I have a SQL server 2005 server database on a server and need to conect to it from a client on the same server network, any ideas? ...

Git appears to have hijacked my windows command prompt

I installed Git for windows XP, and for some reason I couldn't get it to work. It threw and error code that showed it was looking for a network drive (drive Z:\ instead of the local drive C:). I got tired of fooling with it and decided to try the bash that came with GIT. Well, I got into the command prompt and saw the following: Z:\[...

How can I handle arrow keys in a custom component in delphi?

I'm using delphi XE. I'm developing a component that is come from TPanel. TApGUITab=class(Tpanel) I handled key down event by handling WMKeyDown message, but it isn't called when I press arrow keys and it sets focus to another control instead of calling the event. What should I do now? ...

css difference between firefox/Mac & firefox/Windows

I'm working on a template with a designer and we see different things. In my browser on mac the input field are next to the labels but for the designer in his browser the input fields are under the labels. I use eric meyer's css reset so everything should be correct. Here's a screenshot to illustrate what I mean (left is what it should ...

Are there any usability rules for window titles?

Hi, I am developing a ERP software inhouse and one of the requests is to have the the username of the person creating any document to appear on the window title when that document is opened. It will be something like [USR] - Transport Order 123456 Are there any usability rules that I am not adhering to by doing this? It just looks a bi...

How to call WMI function correctly

The following code fails when ExecMethod is called. Can anyone pinpoint what I am doing wrong? #define _WIN32_DCOM #include <iostream> using namespace std; #include <comdef.h> #include <Wbemidl.h> # pragma comment(lib, "wbemuuid.lib") int main(int iArgCnt, char ** argv) { HRESULT hres; // Step 1: ----------------------------...