loadlibrary

Interfacing device visa USB in MATLAB using C DLL files

北慕城南 提交于 2020-01-16 19:33:32
问题 I am doing a project in which i have to interface a device via USB using MATLAB. The API (dll files) of the device is written in the C++ so i used loadlibrary command in MATLAB to load it and done interfacing. It's working fine. The problem is that when i run the program from MATLAB it works fine but for running it again i need to plug out the device and then plug in to make it run successfully. But i wrote a C++ interface that is working fine. Can anyone tell me what should i do? The problem

Not finding function using GetProcAddress() C++ VBexpress 13

邮差的信 提交于 2020-01-16 00:36:08
问题 Okay so I'm coming dangerously close to a repost here but my situation is a little bit different than the numerous other posters about this function. I am interfacing with a DLL that was written way back in the day and all I have is the file. I don't have a .lib file so I'm using the LoadLibrary and GetProcessAddress functions. I followed the tutorial on the MSDN website to get the basic structure. the DLL is located in the project folder. it compiles. at run time, I am getting a numerical

DllImport vs LoadLibrary, What is the best way?

爱⌒轻易说出口 提交于 2020-01-11 09:41:08
问题 i'm usually using Win32 API in c#.NET. But not declare all in one application. Sometimes usually using user32, sometimes gdi32 ... I think when i declare all api function, those use lot of memory. What is the best way using API in .NET ? 回答1: Most of the Win32 API is available through managed abstractions. Otherwise, declare the ones you need using DllImport . LoadLibrary should really only be used where you have provided alternate functionality, that is, your application can work even

LoadLibrary与LoadLibraryEx

╄→尐↘猪︶ㄣ 提交于 2020-01-08 13:26:13
参考了这个博客: https://blog.csdn.net/cuglifangzheng/article/details/50580279 以及这个博客: https://blog.csdn.net/zhangbohh8662/article/details/47026519 若DLL不在调用方的同一目录下,可以用LoadLibrary(L”DLL绝对路径”)加载。 但若被调DLL内部又调用另外一个DLL,此时调用仍会失败。解决办法是用LoadLibraryEx: LoadLibraryEx(“DLL绝对路径”, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); 通过指定LOAD_WITH_ALTERED_SEARCH_PATH,让系统DLL搜索顺序从DLL所在目录开始。 跨目录调用dll,你应该这样 1 用GetCurrentDir保存当前的工作目录 2 用SetCurrentDir将当前的工作目录,设置为你的DLL所在的路径,需要使用绝对路径 3 用LoadLibrary你的DLL 4 使用SetCurrentDir恢复到原来的工作路径 上面的方法不行的话, 试下: 若DLL不在调用方的同一目录下,可以用LoadLibrary(L"DLL绝对路径")加载。但若调用的DLL内部又调用另外一个DLL,此时调用仍会失败

Dynamically linked DLL is loaded immediately after starting the application

筅森魡賤 提交于 2020-01-06 10:20:51
问题 I've dynamically linked libhunspell.dll (HunSpell) to my application. It works, but there is a dumb problem which I don't know why it happens. Even before I use LoadLibrary("path\\to\\libhunspell.dll"); to load it and use it, on the start of the application it attempts to load the library by itself. If I place the libhunspell.dll into the path where my main executable resides, it can load it, otherwise it reports an error, immediately after starting the application - This application has

Dynamically linked DLL is loaded immediately after starting the application

。_饼干妹妹 提交于 2020-01-06 10:16:12
问题 I've dynamically linked libhunspell.dll (HunSpell) to my application. It works, but there is a dumb problem which I don't know why it happens. Even before I use LoadLibrary("path\\to\\libhunspell.dll"); to load it and use it, on the start of the application it attempts to load the library by itself. If I place the libhunspell.dll into the path where my main executable resides, it can load it, otherwise it reports an error, immediately after starting the application - This application has

Get path to dll loaded using LoadLibrary(“MyDll.dll”)

[亡魂溺海] 提交于 2020-01-03 18:51:55
问题 I'm loading a dll by using it's name like this: HANDLE hlib = LoadLibrary("Winfax.dll"); Now I want to know from which path the dll was loaded. Is there a way to get the full path and file name for a dll handle? 回答1: Check out GetModuleFileName: GetModuleFileName Function using hlib as the HMODULE. 来源: https://stackoverflow.com/questions/5117462/get-path-to-dll-loaded-using-loadlibrarymydll-dll

can not load a DLL file

杀马特。学长 韩版系。学妹 提交于 2020-01-03 04:49:09
问题 Every time I try to load DLL (COM) I get the following error: LDR: LdrpWalkImportDescriptor() failed to probe for its manifest, ntstatus 0xc0150002 I searched a lot but found nothing. Please I really believe in this site experts and I hope to get a solution to this problem. I know that the problem is from manifest file but I really don't know what is it and how to fix this I use VS2010 C++ and LoadLibrary 回答1: This is the description of the error code from ntstatus.h: // // MessageId: STATUS

getting libstruct to work in matlab for dll pointer argument

风格不统一 提交于 2020-01-02 10:25:37
问题 I'm trying to call a dll function in matlab. I have a C++ struct as shown in sixense.h: typedef struct _sixenseControllerData { float pos[3]; float rot_mat[3][3]; float joystick_x; float joystick_y; float trigger; ... } sixenseControllerData; and functions I could call: SIXENSE_EXPORT int sixenseInit( void ); SIXENSE_EXPORT int sixenseGetAllNewestData( sixenseAllControllerData * ); I can easily get this to work with calllib('sixense','sixenseInit') since there is no input, but for the

Issue while loading a dll library file… java.lang.UnsatisfiedLinkError: Can't load library

。_饼干妹妹 提交于 2020-01-02 02:20:10
问题 While loading a dll file, I am getting the following exception: Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Transliteration\rlpnc-3.1.0-sdk-ia32-w32-msvc80\rlp\bin\ia32-w32-msvc80\btrntjni.dll: The system cannot find message text for message number 0x%1 in the message file for %2 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.load0