DLL Needed For Excel VBA Sleep()? - vba

When using:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Is it required to have some sort of DLL? If so, which DLL and where can I obtain it?

kernel32.dll is part of Windows, and as such will be on every Windows OS based machine.

Related

tensorflow c API lib is missing "cc" folder with lot of header files

I downloaded an official tensorflow c api lib for windows with cpu from https://www.tensorflow.org/install/lang_c.
The file is:
libtensorflow-gpu-windows-x86_64-2.5.0.zip
But the lib doesn't contains folder "cc" that contains lot of header files used in examples in the github page. (For example: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/label_image/main.cc)
So I guess that its lib files do not contains compiled code for those missing functions.
I confused, where can I downloaded a tensorflow c api compiled lib that allow me to write code like in the github examples?

Creating a shared lib using CMake

I have a set of files (cxx and hpp) that I would like to make into a shared lib. I would like to link that shared lib against My main application file (InjMain.cxx) to create the final executable.
Below are the following set of CMake commands that I use.
set(INJ_SRC
src/functions/AFunction.cxx
src/functions/BFunction.hpp
src/functions/CInterface.hpp
src/functions/DImpl.hpp
src/functions/EInterface.hpp
)
add_library(INJ_LIB SHARED ${INJ_SRC})
add_executable(TEST_INJ src/InjMain.cxx)
target_link_libraries(TEST_INJ ${INJ_LIB})
The above doesn't seem to work. However if I use
add_executable( TEST_INJ ${INJ_SRC} src/InjMain.cxx)
that seems to be working ok. What am I doing wrong?

Is .lib file required for applications with load time Dynamic linking?

It says that in case you use load time dynamic linking with DLL it looks up functions entries and other things from a .lib file.
However I cannot find any information on whether this .lib file is required only at compile time or if it needs to be shipped with the program executable for it to work
Lib files are linked into final executable or DLL - so no, you don't need to ship Lib files to users of the application.
If you are building DLL you may provide lib file for your DLL to developers to simplify using of your DLL.

DLL hinstance with in the same dll

I have an MFC dll with is used in an application.This Dll doesn't have DLLMain function.Now how do i retrieve hinstance of the said dll with in the dll?I am using VS 2010.
GetModuleHandle function will return the HINSTANCE of the dll or the exe.
Pass the name of your dll as the first argument.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683199(v=vs.85).aspx

MSVC 2008 - Unresolved External errors with LIB but only with DLL, not with EXE project

I have a DLL that I am trying to link with a libjpeg LIB using MSVC 2008 that is generating Unresolved External Symbol errors for the libjpeg functions. I also have a test project that links with the exact same libjpeg library file and links without error and runs fine too.
I have triple-checked my LIB path and dependent LIBS list settings and literally copy and pasted them from the EXE project to the DLL project. I still get the errors. I do have the libjpeg include headers surrounded by extern "C" so it is not a name mangling issue and the unresolved external warnings show the "missing" libjpeg functions as undecorated (just a leading underscore and the # sign parameter byte count suffix after each name).
What could make the linker with the DLL project be unable to find the functions properly when the test EXE project has no trouble at all? I'm using the pre-compiled 32-bit static multi-threaded debug library which I downloaded from ClanLib.
Thanks,
Robert
After a lot of experimentation I found the solution. It turns out the problem was due to a difference in the calling convention used by the DLL and the LIB projects (In MSVC 2008 this is set on the Project Properties, "Configuration Properties -> C/C++ -> Advanced" setting. The DLL project was set to __stdcall and the LIB was __cdecl. Recompiling LIBJPEG with __stdcall fixed the problem.