How can I use a DLL file from Python?

For ease of use, ctypes is the way to go. The following example of ctypes is from actual code I’ve written (in Python 2.5). This has been, by far, the easiest way I’ve found for doing what you ask. import ctypes # Load DLL into memory. hllDll = ctypes.WinDLL (“c:\\PComm\\ehlapi32.dll”) # Set up prototype and … Read more

Dependent DLL is not getting copied to the build output folder in Visual Studio

I found that if ProjectX referenced the abc.dll but didn’t directly use any of the types DEFINED in abc.dll, then abc.dll would NOT be copied to the main output folder. (It would be copied to the ProjectX output folder, to make it extra-confusing.) So, if you’re not explicitly using any of the types from abc.dll … Read more

Why do 64-bit DLLs go to System32 and 32-bit DLLs to SysWoW64 on 64-bit Windows?

I believe the intent was to rename System32, but so many applications hard-coded for that path, that it wasn’t feasible to remove it. SysWoW64 wasn’t intended for the dlls of 64-bit systems, it’s actually something like “Windows on Windows64”, meaning the bits you need to run 32bit apps on a 64bit windows. This article explains … Read more

Can’t find how to use HttpContent

Just use… var stringContent = new StringContent(jObject.ToString()); var response = await httpClient.PostAsync(“http://www.sample.com/write”, stringContent); Or, var stringContent = new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, “application/json”); var response = await httpClient.PostAsync(“http://www.sample.com/write”, stringContent);

DLL and LIB files – what and why?

There are static libraries (LIB) and dynamic libraries (DLL) – but note that .LIB files can be either static libraries (containing object files) or import libraries (containing symbols to allow the linker to link to a DLL). Libraries are used because you may have code that you want to use in many programs. For example … Read more

Resolving LNK4098: defaultlib ‘MSVCRT’ conflicts with

There are 4 versions of the CRT link libraries present in vc\lib: libcmt.lib: static CRT link library for a release build (/MT) libcmtd.lib: static CRT link library for a debug build (/MTd) msvcrt.lib: import library for the release DLL version of the CRT (/MD) msvcrtd.lib: import library for the debug DLL version of the CRT … Read more

How can I test a Windows DLL file to determine if it is 32 bit or 64 bit? [duplicate]

A crude way would be to call dumpbin with the headers option from the Visual Studio tools on each DLL and look for the appropriate output: dumpbin /headers my32bit.dll PE signature found File Type: DLL FILE HEADER VALUES 14C machine (x86) 1 number of sections 45499E0A time date stamp Thu Nov 02 03:28:10 2006 0 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)