32bit-64bit

Using a 32bit or 64bit dll in C# DllImport

て烟熏妆下的殇ゞ 提交于 2019-12-17 08:06:23
问题 Here is the situation, I'm using a C based dll in my dot.net application. There are 2 dlls, one is 32bit called MyDll32.dll and the other is a 64bit version called MyDll64.dll. There is a static variable holding the DLL file name: string DLL_FILE_NAME. and it is used in the following way: [DllImport(DLL_FILE_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint=Func1")] private static extern int is_Func1(int var1, int var2); Simple so far. As you can imagine, the software is compiled

Using a 32bit or 64bit dll in C# DllImport

对着背影说爱祢 提交于 2019-12-17 08:06:08
问题 Here is the situation, I'm using a C based dll in my dot.net application. There are 2 dlls, one is 32bit called MyDll32.dll and the other is a 64bit version called MyDll64.dll. There is a static variable holding the DLL file name: string DLL_FILE_NAME. and it is used in the following way: [DllImport(DLL_FILE_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint=Func1")] private static extern int is_Func1(int var1, int var2); Simple so far. As you can imagine, the software is compiled

Use 32-bit jni libraries on 64-bit android

谁说胖子不能爱 提交于 2019-12-17 07:10:12
问题 I've tried running an application using a native library on the Nexus 9. The application exits with an error message: java.lang.UnsatisfiedLinkError: dlopen failed: "lib_xyz.so" is 32-bit instead of 64-bit Is there any known workaround for this problem (except, of course, recompiling the library and making the apk bigger)? 回答1: Found an explanation: 64-bit Android can use 32-bit native libraries as a fallback, only if System.loadlLibrary() can't find anything better in the default search path

Using intptr_t instead of void*?

﹥>﹥吖頭↗ 提交于 2019-12-17 06:09:09
问题 Is it a good idea to use intptr_t as a general-purpose storage (to hold pointers and integer values) instead of void* ? (As seen here: http://www.crystalspace3d.org/docs/online/manual/Api1_005f0-64_002dBit-Portability-Changes.html) For what I've already read: int -> void* -> int roundtrip is not guaranteed to hold original value; I guess int -> intptr_t -> int will do pointer arithmetics on both void* and intptr_t require casts, so none gets advantage here void* means less explicit casts when

How should I prepare my 32-bit Delphi programs for an eventual 64-bit compiler? [duplicate]

北城以北 提交于 2019-12-17 05:36:05
问题 This question already has answers here : How to also prepare for 64-bits when migrating to Delphi 2010 and Unicode (4 answers) Closed 4 years ago . Possible Duplicate: How to also prepare for 64-bits when migrating to Delphi 2010 and Unicode Since I believe that 64bit Delphi compiler will appear soon, I am curious if anybody knows what kind of programs that are now 32bit will compile and work without any changes when using 64bit compiler. And if there is a general rule what kind of changes

File getting copied to SysWOW64 instead of System32

喜欢而已 提交于 2019-12-17 04:01:29
问题 I have to copy a psTool utility to System32 folder when my application runs. I am on 64 bit Windows 7 and whenever, I try to copy the exe to system32 bit folder through File.Copy , the exe always gets copied to SysWow64 instead. When I put a breakpoint on destFile, the path is shown as C:\Windows\System32 but the file does not go in there (goes to sysWow64). I have tried the Special Folder SystemX86 , but the file again goes to sysWOW64. string sourceFile = "C:\bin\Debug\somexe.exe" string

Fast computing of log2 for 64-bit integers

牧云@^-^@ 提交于 2019-12-17 02:36:04
问题 A great programming resource, Bit Twiddling Hacks, proposes (here) the following method to compute log2 of a 32-bit integer: #define LT(n) n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n static const char LogTable256[256] = { -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, LT(4), LT(5), LT(5), LT(6), LT(6), LT(6), LT(6), LT(7), LT(7), LT(7), LT(7), LT(7), LT(7), LT(7), LT(7) }; unsigned int v; // 32-bit word to find the log of unsigned r; // r will be lg(v) register unsigned int t, tt; //

How to determine programmatically whether a particular process is 32-bit or 64-bit

情到浓时终转凉″ 提交于 2019-12-16 22:22:51
问题 How can my C# application check whether a particular application/process (note: not the current process) is running in 32-bit or 64-bit mode? For example, I might want to query a particular process by name, i.e, 'abc.exe', or based on the process ID number. 回答1: One of the more interesting ways I've seen is this: if (IntPtr.Size == 4) { // 32-bit } else if (IntPtr.Size == 8) { // 64-bit } else { // The future is now! } To find out if OTHER processes are running in the 64-bit emulator (WOW64),

processing files in 64 bit machine but developing in 32 bit machine

江枫思渺然 提交于 2019-12-14 03:57:37
问题 i am going to read a TDMS file in matlab using Mexfunction in C language in a 64 bit windows machine, but i will develop the app in 32 bit windows machine. i know in there is a difference between 32 bit machine and 64 bits with the size of variables. i used a lot of fread(.. sizeof(type)..). is it going to be a problem when it is running in 64 bit machine? if so, how can i make it portable to 64 bits mahince? thanks 回答1: The more general problem is that you will have to know what the size of

Can I link a 32-bit native dll (not .Net assembly) into my 64 bit .Net applicaiton?

假装没事ソ 提交于 2019-12-14 03:53:04
问题 We have an old 3rd party component which is a 32 bit native dll. In our COM based app, we link it through Windows API. Now, we are planning to upgrade our app to .Net and running on 64 bit system. My question: Can we still link the old 32 bit native dll into our 64 bit .net app through Windows API? If not, any ideas on how to get it to work? 回答1: 32-bit code cannot be used inside of a 64-bit process, period. However, you can wrap the 32-bit DLL inside of a 32-bit out-of-process COM server (if