32bit-64bit

Is it safe to use sys.platform=='win32' check on 64-bit Python?

情到浓时终转凉″ 提交于 2019-12-20 15:45:27
问题 The usual check to differentiate between running Python-application on Windows and on other OSes (Linux typically) is to use conditional: if sys.platform == 'win32': ... But I wonder is it safe to use today when 64-bit Python is more widely used in last years? Does 32 really means 32-bit, or basically it refers to Win32 API? If there is possibility to have one day sys.platform as 'win64' maybe such condition would be more universal? if sys.platform.startswith('win'): ... There is also another

What is 32 & 64 bit c++ code?

雨燕双飞 提交于 2019-12-20 07:22:36
问题 I'm trying to get a value from a registry key, and the final program has to work on both 32 & 64 bit machines. The code so far is: HKEY hKey; LONG Result1; LONG result2; Result1 = RegOpenKeyEx(HKEY_CLASSES_ROOT,L"Word.Application\\CurVer",0,KEY_READ,&hKey); cout << Result1; cout << "\n"; TCHAR value[255]; DWORD BufferSize = 255; result2 = RegGetValue(hKey, L"Word.Application\\CurVer", L"", RRF_RT_ANY, NULL, (PVOID)&value, &BufferSize); cout << result2; I'm getting the error '2' back from

How to connect to windows phone 7 from a 64-bit application

别说谁变了你拦得住时间么 提交于 2019-12-20 06:30:28
问题 I have a 32-bit program (written in C++) that can connect to some different devices and as long as it is 32-bit everything works fine. However, now I need to build it as a 64-bit program but then I came across some problems with Windows Phone 7. I found out that a dll (written in C#) that I rebuilt as 64-bit throws exception at this line: MultiTargetingConnectivity connectivity = new MultiTargetingConnectivity(CultureInfo.CurrentUICulture.LCID); The exception is: An unhandled exception of

64-bit executable runs slower than 32-bit version

无人久伴 提交于 2019-12-20 03:07:17
问题 I have a 64-bit Ubuntu 13.04 system. I was curious to see how 32-bit applications perform against 64-bit applications on a 64-bit system so I compiled the following C program as 32-bit and 64-bit executable and recorded the time they took to execute. I used gcc flags to compile for 3 different architectures: -m32 : Intel 80386 architecture (int, long, pointer all set to 32 bits (ILP32)) -m64 : AMD's x86-64 architecture (int 32 bits; long, pointer 64 bits (LP64)) -mx32 : AMD's x86-64

undefined reference to sync_fetch_and_add_4

喜你入骨 提交于 2019-12-20 02:39:32
问题 Whenever I try to use __sync_fetch_and_add with -m32 on a 64 bit machine, I get the following error, while it compiles fine with normal 64 bit. I am using gcc compiler 4.1.2. What can be the problem here and what is the solution? replication.cpp:(.text+0xb3b): undefined reference to `__sync_fetch_and_add_4' replication.cpp:(.text+0xb82): undefined reference to `__sync_fetch_and_add_4' replication.cpp:(.text+0xcc2): undefined reference to `__sync_fetch_and_add_4' /tmp/cc7u9FLV.o: In function

Registry redirection on 64-bit Windows

社会主义新天地 提交于 2019-12-20 02:34:28
问题 I am running 64-bit Windows, and I want to create the registry key HKCU\Software\Classes\Wow6432Node\CLSID\{myguid}\InprocServer32 using C#. What registry key should I tell it to write, so that it will be redirected to the above key? This should also work on 32-bit Windows. I am compiling my app to target x86. 回答1: If you are using .net 4 you should make use of the RegistryView enumeration. Pass RegistryView.Registry32 when you call OpenBaseKey. Use HKCU\Software\Classes\CLSID{myguid}

Compile Console App as 32 bit

余生颓废 提交于 2019-12-20 01:38:01
问题 I have a Windows Console Application that I need to compile as 32 bit. It's written in C# and I have all the Visual Studio 2012 updates. I've tried following several things on here, but I'm never given an option for 32 bit. How can I compile it as 32 bit? 回答1: With Visual Studio you are able to target what platform. By default it will run on "Any CPU" (read 32 or 64 bit), but you can specify if you desire. Look under Project>Properties>Build and look for the "Platform Target" property. 回答2:

Unresolved external symbol error occurring only in 64-bit mode and not in 32-bit build

流过昼夜 提交于 2019-12-19 19:43:13
问题 I have a VC++ code (built using VS2008), which makes use of some static libraries (*.lib files linked statically during compile time). For ease of understanding let's refer my EXE code as "AAA.EXE" & refer the lib files as "A.lib", b.lib etc... Both the AAA.EXE code and static libraries code are built using VS2008. I see that my "AAA.EXE" is working fine in 32-bit version and showing the below linker errors when AAA.EXE is built in 64-bit mode. I have of course rebuilt the static libraries in

Using a 32 bit dll on a 64 bit machine

混江龙づ霸主 提交于 2019-12-19 18:29:31
问题 I have an old project which uses a 32 bit dll. This works fine on 32 bit processor, however when I install the same project on a 64 bit OS it does not work. Is there any way to convert 32 bit dll to 64 bit? Is there an alternative solution solution to make my 32 bit dll work in a 64 bit OS? 回答1: Your 32 bit dll should work just fine on a 64 bit machine as long as it is loaded into a 32 bit process - attempting to load a 32 bit dll into a 64 bit process will fail. If your project is a .Net (e

Is it possible to execute 32-bit code in 64-bit process by doing mode-switching?

自闭症网瘾萝莉.ら 提交于 2019-12-19 17:41:32
问题 In this page, http://www.x86-64.org/pipermail/discuss/2004-August/005020.html He said that there is a way to mix 32-bit code and 64-bit code in a application. He assumed the application is 32-bit (in compatibility mode) and then switch to 64-bit mode to execute 64-bit code and vice versa. Assume my OS is 64-bit linux and my application is 64-bit. I do a far jump to switch to compatibility mode and execute 32-bit code. Does it can work correctly when I do a system call or function call ? Is