dllimport

How to load dll's during debug in VS2013

大憨熊 提交于 2021-02-18 22:34:06
问题 I have some code var aa = a(); b(aa); While debugging, I set a breakpoint on the b() call. Then going to the immediate window , I'd like to be able to execute code from a DLL that is in my project but is not yet loaded . Say I want a new Boo and call Foo() . The code is in the namespace Baz in dll Spongle.dll . When I type >> new Baz.Boo().Foo(aa) I get the error: The type or namespace name 'Baz' is not valid in this scope. If I change my code such that my Boo is already loaded it works fine.

c# dllimport with pointers

寵の児 提交于 2021-02-17 01:59:15
问题 I have a dll that I cannot import in my vs2012 c# project. I have used dllImport before but I have never had to use Marshal or pointers before. Lucky me I guess. This is the code that I currently have. The function being called is fnLDA_GetDevInfo(DEVID *ActiveDevices) DEVID is a normal unsigned integer (#define DEVID unsigned integer) //Allocate an array big enough to hold the device ids for the number of devices present. //Call fnLDA_GetDevInfo(DEVID *ActiveDevices), which will fill in the

Why do these DLLs have two apparently identical entry points?

非 Y 不嫁゛ 提交于 2021-02-11 07:58:39
问题 Today, working on some VB.NET code I had to access two external DLLs in order to use some methods. The help topics that I found told me to use the following external methods: shlwapi.dll → PathIsNetworkPath (Reference 1) mpr.dll → WNetAddConnection2 and WNetCancelConnection2 (Reference 2) However, when I tried to call these methods from my code, I got an error saying that the entry point did not exist. So I did some research and I found out that the DLLs in my operative System (Windows 7

dllimport /dllexport and static libraries compilation under visual c++

不羁岁月 提交于 2021-02-08 19:55:35
问题 I desperatly need your help. Im trying to compile statically the poppler library (specially for qt4) on windows with the visual c++ 2008 compiler. To achieve this task I needed to compile a bunch of other libraries as dependencies for poppler statically too. When I finally generate the static version of poppler I got a linking error when building my app: error LNK2019: unresolved external symbol "__declspec(dllimport)... I already added the new include path and linked the poppler-qt4.lib but

DLLImport does not work on Azure App Service Net. 3.1

99封情书 提交于 2021-02-05 08:01:29
问题 I recently added not C# dll to my service a which acts as HTTP Client. On my Local Machine (Windows 10) everything works perfectly. When tried to send a request on Azure i get following response. <h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3> The developer of the dll and I debugged (VS Remote Debug)

DLLImport does not work on Azure App Service Net. 3.1

萝らか妹 提交于 2021-02-05 08:01:26
问题 I recently added not C# dll to my service a which acts as HTTP Client. On my Local Machine (Windows 10) everything works perfectly. When tried to send a request on Azure i get following response. <h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3> The developer of the dll and I debugged (VS Remote Debug)

C# : Pass int array to c++ dll

梦想的初衷 提交于 2021-02-05 08:00:07
问题 I have a C++ dll which is used to card printing( ID cards ). My implementation done using C#.Net. I used following code to call c++ dll. [DllImport(@"J230i.dll",CallingConvention = CallingConvention.Cdecl,SetLastError=true)] public static extern int N_PrintJobStatus(ref int[] nPrtintjobStatus); int[] pJob = {0,0,0,0,0,0,0,0} ; ret = N_PrintJobStatus( ref pJob); N_PrintJobStatus method signature given as bellow N_PrintJobStatus(int *pJobStatus ) After calling the method it gives following

How to call MessageBox with GetProcAddress function?

我的未来我决定 提交于 2021-02-04 05:59:27
问题 I want to call MessageBox() function in such way: 1). load needed library 2). get the function address 3). call it So, for such aim as I understand, I should define new type with all types of arguments in MessageBox function. It returnes INT and accepts: HWND, LPCSTR, LPCSTR, UNIT. So I registred new type: typedef int(__stdcall *msgbox)(HWND, LPCSTR, LPCSTR, UINT); I have problems with calling such function. Does such way work for all functions or only for exported? How can I call MessageBox

How to call MessageBox with GetProcAddress function?

时光怂恿深爱的人放手 提交于 2021-02-04 05:59:04
问题 I want to call MessageBox() function in such way: 1). load needed library 2). get the function address 3). call it So, for such aim as I understand, I should define new type with all types of arguments in MessageBox function. It returnes INT and accepts: HWND, LPCSTR, LPCSTR, UNIT. So I registred new type: typedef int(__stdcall *msgbox)(HWND, LPCSTR, LPCSTR, UINT); I have problems with calling such function. Does such way work for all functions or only for exported? How can I call MessageBox

c# DLLImport calling c++ method with char* as parameter

落花浮王杯 提交于 2021-01-28 19:08:29
问题 I got an external DLL (c++) with the follwing method: void _stdcall Set_Config(char* config) I use the following c# code to call the method: [DllImport(DllName,CharSet=CharSet.Auto)] public static extern void Set_Config(String config); But when i execute my c# code i get either an acces violation exception or an System.Runtime.InteropServices.SEHException. (My dll is 32 bit, and my c# compiler compiles to 32 bit) I also tried to replace String config with Stringbuilder, but the same result.