dll

Return List/Array from unmanaged C# DLL

拈花ヽ惹草 提交于 2019-12-31 07:13:07
问题 I have Unmanaged C# DLL: [DllExport(ExportName = "GetStudentsList", CallingConvention = CallingConvention.StdCall)] static public List<StudentsStruct>GetStudentsList() { return List<StudentsStruct>; } [DllExport(ExportName = "maxElement", CallingConvention = CallingConvention.StdCall)] static public int maxElement(int a, int b) { return c; } I want to return List<StudentsStruct> from the function. And I want to run above function in a C++ Application: using GetStudentsListFn = List

gfortran, DLL, underscore

我们两清 提交于 2019-12-31 07:09:05
问题 I want to access some subroutines from a third party DLL. The functions use STDCALL as the calling convention. Running dumpbin /export foo.dll gives me something like: ... 7 6 00004B40 Foo@16 ... I compile my code using: gfortran test.f90 -o test.exe -Wl,foo.dll I get an error: undefined reference to '_foo_' (note the underscores). I have tried adding the -mrtd compilation flag, as well as other flags I googled, all to no avail. How can I tell fortran to not add the underscores? edit: A bit

Form UI Freeezes even after using Backgroundworker when using Flickr.Net API

拟墨画扇 提交于 2019-12-31 05:15:09
问题 Im trying to upload some images using the Flickr.net API.The Images are uploaded but the User Interface freezes.I have inserted the code for uploading in a Background worker private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { foreach (var item in imagelist) { flickr.UploadPicture(item, Path.GetFileName(item), null, null, true, false, true); } MessageBox.Show("Success"); } The flickr object is created earlier from another form and passed to this form. I call the worker

DLL thread safety

本小妞迷上赌 提交于 2019-12-31 05:12:25
问题 I am developing a DLL in MS VC express c++ that will be loaded in multiple client applications at the same time, the DLL has a shared memory space created using data_seg(".SHARED_SPACE_NAME") . In this shared memory space there are some vectors that can be modified. Lets assume we have a function in the DLL body called doCalc(): _DLLAPI void __stdcall doCalc(int argument) { //Add to vector //Loop through vector //Erase from vector //etc. } If doCalc is called at the same time from two or more

C#: How to embed DLL into resourcefile (no dll copy in program directory)

余生长醉 提交于 2019-12-31 05:12:12
问题 I have a C# application (project A) that requires X.dll. I have added the project that produces X.dll to A as a reference in visual studio. I have also added the release build of X.dll to a resource file in A as a binary. I have told project A not to copy X.dll to the output directory. Now I want A.exe to load, say "hey I can't find this file", then look in the resource file and use Assembly.Load(byte[]) get X.dll back. I have the code that re-magicifies the DLL back, however this code never

Stymied by ASP.NET Compilation Error CS0009

僤鯓⒐⒋嵵緔 提交于 2019-12-31 04:40:07
问题 I'm getting error below when I debug my ASP.NET MVC app. Any thoughts on how I could solve this? Any idea how the problem would have occurred in the first place? I promise you I didn't go randomly deleting dll's from deep within protected directories on my system. Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code

can i create Dll with VC++ 2008 and use it in VC++ 6?

别来无恙 提交于 2019-12-31 04:38:08
问题 I have made a DLL with VC++ 2008 and when i use it in console application VC++ 6.0, there is an exception: (msvcr90.dll): 0xc0000005: Access Violation 回答1: Access Violation in this case can mean so many things, and the msvcr90.dll reference can be very much misleading. If you pass invalid data to any of the MSVC standard library functions, the access violation will occur within msvcr90.dll and not in your code (when viewing the stack trace or looking at the exception info. That said, there

Mozilla use a C DLL with js-ctypes

冷暖自知 提交于 2019-12-31 04:14:47
问题 I'm tying to build a dll, and then use it with a Firefox extension. I managed to build a DLL using gcc under Windows : #include<stdio.h> int add(int a,int b) { return(a+b); } I try now to use it through my dll. After reading some posts, especially this one, I couldn't manage to make this work: Reference a binary-component to js-ctypes Each time I try ctypes.open, I have the error message: couldn't load the library . However, the DLL path is correct. Here is the JS code: Components.utils

Python Ctypes Load Library

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 04:02:33
问题 I am using windows 7 64 bit machine. I installed Visual studio 2010 and developed a simple win32 dll to add 2 numbers.. The dll is created and i used a test application to test the dll and it works fine.. Now i write python script(shown below) to use this library. But i get the following error message. Traceback (most recent call last): File "C:\Users\sbritto\Documents\Visual Studio 2008\Projects\MathFuncsDll\Debug\MathFuncs.py", line 5, in <module> lib = ctypes.WinDLL('MathFuncsDll.dll',use

How do I pull DotNetOpenAuth assembly references into unit test project for ASP.NET MVC4 solution?

蓝咒 提交于 2019-12-31 03:55:06
问题 Tl;dr version: I am stuck with the exception: System.IO.FileLoadException : Could not load file or assembly 'DotNetOpenAuth.AspNet, Version 4. 0 .0.0 ... A bit dismayed that msft used so many static classes and methods for auth in the new MVC4 project template. Want to wrap all membership/auth functionality into a class that implements an interface so that I can mock for unit tests. After a couple of evenings of struggling, I have decided to start from scratch, so I removed all DotNetOpenAuth