Menu
  • HOME
  • TAGS

How to use swig with compiled dll and header file only

python,c++,dll,wrapper,swig

Yes, it is possible. SWIG only uses the headers to generate wrapper functions. Here's a simple SWIG file: %module mymod %{ #include "myheader.h" %} %include "myheader.h" Then: swig -python -c++ mymod.i Then compile and link the generated code as a Python extension DLL. You will also need to link in...

Converting .so file of linux to a .dll file of windows

c,dll,ctypes

I'd recommend to recompile it on windows, alternatively you can give a try to dlltool.

In VC++, is there any way to know the export class of a dll without any header files?

c++,visual-c++,dll,export

The closest you can get is by reverse engineering (use a debugger) to find the required memory size before calling a constructor, and maybe you could figure out what members are used for (as well as inheritance and other goodies), but you will definitely not have correct names for anything...

The type 'System.Runtime.InteropServices.SafeHandle' exists in both 'System.Runtime.InteropServices.dll' and 'System.Runtime.Handles.dll'

c#,dll,reference,compiler-errors,interop

I finally found a solution for my problem. It wasn't easy to find but I did it! Since my solution is very specific to my project, I'll post the steps I used to solve it. I hope it can help someone! I unloaded my startup project and created a new...

Attempt to load the C runtime library incorrectly in Winamp's in_midi.dll

c#,.net,dll,pinvoke,winamp

Solved. Add a manifest to your project. At the end of the manifest paste: <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4926" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> </dependentAssembly> </dependency> (there should already be a commented example <dependency>) This will use the Microsoft.VC90.CRT that is in WinSxS. Go to the properties of your project, and...

Specifying an Assembly to Create an Object

c#,.net,winforms,dll,.net-assembly

Thanks to @MarcGravell found a solution to this problem. Refer these links to the original post. Link 01 Link 02 The code as below; public class GenericProxyAttribute : ProxyAttribute { public override MarshalByRefObject CreateInstance(Type serverType) { string zTypeName = serverType.Name; try { Assembly zLibrary = Assembly.LoadFrom(@"C:\Assemblies\Custom.dll"); Type zType = zLibrary.GetType(string.Format("Custom.{0}",...

Can DLLs linked via import libs be unloaded before the host DLL is unloaded?

c++,windows,dll,dllimport

Yes, you have to specify the /DELAY:UNLOAD linker option and call the FUnloadDelayLoadedDLL function. See Unloading a delay-loaded DLL for more information....

Call Delphi XE6 unicode dll from C# asp.net

c#,delphi,dll

BadImageFormatException typically indicates a bitness mismatch. Your Delphi module is 64 bit and the C# module is 32 bit, or vice versa. You have other problems. At least the following: You cast a UTF-16 UnicodeString string to PAnsiChar. That cast is not correct. You return a the address of a...

Get IIS to load dlls used for reading config from a specified directory

c#,asp.net,iis,dll,app-config

So we solved this by wiring up a handler to the AppDomain.CurrentDomain.AssemblyResolve event and loading the assembly manually. It's still not clear to me why our resolver is being triggered but the dll can't be found, but it seems to work....

Unable initialize the Matlab dll in c++

c++,matlab,dll

Because I ran mcc command with -C option, so I need to add the add.ctf file to the path where the dll stored before initializing the dll. I also can run mcc command again without -C option to generate a new dll. And use the new dll instead of the...

Visual 2015 Compiling DLL

c++,visual-studio,dll,g++

You are missing dllexport next to the pomnoz function: __declspec(dllexport) std::string pomnoz(std::string &s, std::string &ds); Then in your application you can dynamically load the dll and retrieve the address to the exported function: HMODULE lib = LoadLibrary(L"test.dll"); typedef std::string(*FNPTR)(std::string&, std::string&); FNPTR myfunc = (FNPTR)GetProcAddress(lib, "pomnoz"); if (!myfunc) return 1; std::string...

Prism 5.0 External 3rd party dll

c#,dll,prism-5

Turns out the module using the external library needs to have it referenced properly but for run-time the library needs to be accessible in the shell (startup project) executing folder

Function pointer in DLL call - how to handle in C#?

c#,dll,callback

You have to declare a delegate type that matches the native function pointer. It probably should look like this: [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int fct_line_callback(double power, IntPtr userdata); Now you can write the pinvoke declaration: [DllImport("foo.dll", CallingConvention = CallingConvention.Cdecl)] extern static int set_line(int width, fct_line_callback callback); If the callback can only be...

Access C# method in DLL from Java

java,c#,dll,dllimport

That's to be expected. Your Java code treats the C# DLL as if it were an unmanaged library. It is not. It does not export unmanaged functions that can be imported using LoadLibrary and GetProcAddress. If you wish to export unmanaged functions from your .net DLL then you can: Use...

IS the run time library just some dynamicly linked library files? [closed]

c++,c,windows,dll,runtime

In the case of MSVC, the runtime library MSVCRxxx.DLL contains all of the code for the C/C++ standard library.

Using different versions of the same DLL in a project

c#,.net,dll

Please open Solution Explorer in visual studio Open References under the project Select AWSSdk reference and go to its properties. Set Specific Version = True and Copy Local = False Make sure your output directory does not contain this dll in it. ...

BadImageFormatException - How to reference System.IO.Compression in my Windows Phone 8.1 app?

c#,.net,dll,windows-phone

Reference Assemblies typically don't contain any actual code -- they're just metadata about types (somewhat like header files in C++). So when .NET tries to use the assembly at runtime, there is no implementation. Consider using Microsoft.Bcl.Compression instead for compression on WP 8....

Controlling the order of dllmain() calls while being injected to another process

c++,windows,dll,dll-injection

I don't think you can safely call shell functions in DllMain. There is a long list of things you can't do due to the way process initialization is done in Windows. You should never perform the following tasks from within DllMain: Call LoadLibrary or LoadLibraryEx (either directly or indirectly). This...

Win64 - JNI: UnsatisfiedLinkError: Can't find dependent libraries

java,dll,jni,unsatisfiedlinkerror,win64

Check for the following. 1) Make sure that there is no typo in the library name . incase of linux it should be some thing like System.load.library("mylib"); then the lib name should be like libmylib.so. 2) You need to add the location of the java library path like -Djava.library.path="path to...

Ensure only one class can access a reference dll?

c#,dll,visual-studio-2013,intellisense

Simply said: You can't do that (but keep reading). Basically, a DLL (From the .NET perspective) is a bunch of code and config files. No more than that. So, given that you'll need to make public those classes in order to be used from another ones outside that assembly then...

Do I really need __declspec(dllexport) when cross-compiling a DLL with MinGW and wclang?

c++,dll,mingw,wclang

No, you do not need __declspec(dllexport), when building a DLL with MinGW; (in fact, I frequently omit it myself). The caveat is that, if just one symbol to be included in the DLL is so decorated, then all others you wish to have exported must be likewise decorated, (unless you...

Call a function of VB DLL file from java using JNA

java,vb.net,function,dll,jna

If your VB DLL is a C-compatible shared library (if you run Dependency Walker on it you'll see labels of the form [email protected]), then the following should work. import com.sun.jna.win32.StdCallFunctionMapper; import com.sun.jna.win32.StdCallLibrary; public class Main { public interface TestLibrary extends StdCallLibrary { void fn_Today(int a,int b); } public static void...

Importing C++ custom library functions into C#

c#,c++,dll,import,dllimport

std::vector<MyClass>, or indeed any unmanaged C++ class, cannot be used for interop to C#. Indeed, even if you wished to consume this function from another unmanaged C++ module you'd have to make sure that you were using the same compiler and dynamic runtime as the DLL which exported the function....

Loading an assembly from a dll's Byte array

powershell,dll,.net-assembly,7zip

The library is using Reflection to find its own path via Assembly.GetExecutingAssembly().Location and initializing some static fields with this value. See the source code: private static string _libraryFileName = ConfigurationManager.AppSettings["7zLocation"] ?? Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "7z.dll"); However, if you load an assembly directly from a byte array, the Location is null and GetDirectoryName...

How to unregister Python COM server

python,windows,vba,dll,com

well the -- unregister command works well for unregistering COM objects , but -- debug is more usable in this position , when someone wants to modify the code. Also if you keep getting the Old instance of the COM object just restart the programs , and it'll detect the...

Crash C# Application using Marshalling

c#,c++,dll,marshalling,vhosts

[DllImport(@"st10flasher.dll")] public static extern uint LoadFile([MarshalAs(UnmanagedType.LPStr)] string FileName, ref uint Fsize); seems wrong: unsigned int LoadFile(char *filename) remove the ref uint Fsize You didn't have a signature for this: [DllImport(@"st10flasher.dll")] public static extern uint BlockNBToErase(bool EraseBlockError); Everything else should be correct....

Intermittent Access Violation when using C# to access C++ DLL

c#,c++,dll

This SetLastError = true is useless unless you are using Windows API. And set the CallingConvention = CallingConvention.Cdecl like [DllImport("Test.dll", EntryPoint = "Test", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] Note that there is code other than your method that could be executed. A DLL can (and often does) have a...

Running two versions of same Dll parallel in Asp.Net

c#,asp.net,.net,dll

This error is because may be you have different versions of ddl but there namespace will be same, and you can reference only distinct namespaces in your project. To overcome this, Either create different namespaces for both versions or use strong names for assemblies....

VC++ .net: Functionality from managed DLL is not exported

c#,c++,visual-c++,dll

It's public ref class BridgedThirdPartyThing for C++/CLI. You don't use __declspec(dllexport). Note that the class needs to be public to be visible to comsuming assemblies....

Create C# dll and use method with powershell

c#,powershell,dll

Your method should be static or you need to create an instance of that type (TestClass). Last can be done using New-Object -TypeName <full qualified type name> -ArgumentList <args> Or in your specific case: $test = New-Object -TypeName AVL_Test.TestClass $test.GetNumber() ...

Statically link libcurl to project (Still requires DLL)

c++,netbeans,dll,libcurl,libcrypto

So i found out how to do it. I just wanted to share it so maybe it could help someone :). Go to Right click your project > Properties > C++ Compiler > Type in Preprocessor Definitions HTTP_ONLY CURL_STATICLIB WITH_SSH2=STATIC And you still need to link this libraries curl ssh2...

holding constructed static arrays in memory for multiple files c++

c++,arrays,dll,linker

In TablesDll.h you should put TABLESDLL_API to the Arrays class too. Otherwise you will not be able to use the parts of NumCalc that depend on Arrays. Also you should have this Arrays NumCalc::arrays; in TablesDll.cpp even though Arrays is an empty class - arrays has to be defined somewhere...

how to edit or see the source code for dll files

dll

1: It's sort of difficult. I mean you can look at the file with a hex editor, but it's not going to look nice. However you can use 3rd party tools in order to get as much info you can about the dll: Dependency walker - useful to get the...

How to call csImageFile.dll (com) functions in c#

c#,asp.net,dll,vbscript

It may be easier to create a runtime callable wrapper (RCW) .NET assembly tlbimp csImageFile.dll /out:Interop.csImageFile.dll /namespace:csImageFile And then use the COM classes exposed by it as if they were regular .NET ones: csImageFile.Manage csImg = new csImageFile.Manage(); csImg.ReadStream("tif", rs("imagedata").value); But don't forget to include a reference to Interop.csImageFile.dll into...

how to connect and read values from kepware using OPCAutomation.dll

dll,plc,opc

OPCAutomation.OPCServer _OPCServer = new OPCAutomation.OPCServer(); _OPCServer.connect("Kepware.KEPServerEX.V5", ""); The second parameter is the OPC Server node and can be left String.Empty. From Reflector: public virtual extern void Connect([In, MarshalAs(UnmanagedType.BStr)] string ProgID, [In, Optional, MarshalAs(UnmanagedType.Struct)] object Node); I'm adding an explample to read and write values: // set up some variables OPCServer...

Where to place local dll in a ASP.NET project?

c#,asp.net,exception,dll,pinvoke

It should be in bin folder in the root of your web app as your .Net assemblies are also located in the bin folder. For web apps bin folder is default where .Net will search for files\configs\etc. For windows app it will be the same folder where exe app is...

Its is better to create class lib or portable class lib?

c#,.net,asp.net-mvc,dll,portable-class-library

Portable class library is the best choice. PCL is for creating code that can be used on multiple platforms in the .NET family. PCL may be useful later if you're planning on using something like Xamarin to publish for android, but isn't useful for anything that doesn't pertain to .NET...

How to run a method on the first call to a .NET dll?

c#,dll

The easy thing to do would be to use the class constructor (aka static constructor) in the classes that require it, so it would be executed once per class. But that still feels not right. But you could encapsulate the calls (as per James' suggestion), and then do your initialization...

.NET Application looking for DLLs in locale specific sub-folder

.net,dll,locale,app-config,subfolder

There is no mechanism in .NET that makes it look for assemblies that contain code in an "en-GB" subdirectory like that. It is only ever used for satellite assemblies, they don't contain code, only resources, and it is the ResourceManager class that does the probing. The only somewhat likely candidate...

How to find the dll which causes a memory leak and not directly referenced by application

c#,wpf,dll,memory-leaks,msvcrt

The answer was not easy to find. I had tried each DLL that I suspected one by one. The leak was an undeleted array in a C++/CLI wrapper class. Since it is a managed dll, I think, the native "new" calls are traced through msvcr110.dll, and ANTS shows leak in...

C# Namespace not found for DLL

c#,dll,c++-cli,wrapper

You're declaring a template, but are not actually instantiating it. C++/CLI templates are just like C++ templates - if you don't instantiate them, they just don't exist outside of the compilation unit. You're looking for generics here (yes, C++/CLI has both templates and generics). And here's how you declare a...

Pinvoke / call native Windows API function from C#

c#,dll,winsock,winsock2,winsockets

You must pass 2 << 8 | 2 as the fist parameter (it is the version requested from the WSA) Note that there is a small bug in the signature Microsoft produced (see Is the .NET use of WSAStartup safe for 64-bit apps?), but it isn't a problem, so you...

Why is a “user breakpoint” called when I run my project with imported .lib, not when code is inline?

c++,visual-c++,dll,runtime-error,breakpoints

Using complex types such as std::string as a parameter at a DLL boundary is tricky. You must ensure that the exe and the DLL use the exact same instance of the library code. This requires that you build them both to use the same version of the DLL version of...

How to free memory in C# that is allocated in C++

c#,c++,memory-management,dll,memory-leaks

You need to call the corresponding "free" method in the library you're using. Memory allocated via new is part of the C++ runtime, and calling FreeHGlobal won't work. You need to call (one way or the other) delete[] against the memory. If this is your own library then create a...

C++ Access violation write to 0x00000000 in dll in mql4

c++,dll,mql4

From the documentation of mql4: http://docs.mql4.com/basis/preprosessor/import The following can't be used for parameters in imported functions: pointers (*); links to objects that contain dynamic arrays and/or pointers. Classes, string arrays or complex objects that contain strings and/or dynamic arrays of any types cannot be passed as a parameter to functions...

Is it possible to create instances of all classes in an assembly?

c#,dll

The simple solution will be using .NET Activator class. It is using reflection but since you want create this object for testing purposes I don't think that overhead will make difference for you. You can use Activator like this: Type type = typeof(SomeClass); object obj = Activator.CreateInstance(type); If you need...

Load same dll multiple times

c#,.net,dll

No, identity of non-strongly-signed assembly is its name alone so you have to change the name. Note that you can use other "Load" methods and even load from byte array, but generally it will bring you more pain than worth. Blog posts by Suzanne Cook is almost required reading when...

Breaking as the code execution enters the Dll or Lib space

c++,visual-studio,debugging,dll

So I'm not sure what you want to achieve - you need the program to break without setting breakpoints, or you need just an information into which function/method from the dll program will enter first? I think you can accomplish that with timeline profiling using for example dotTrace: https://www.jetbrains.com/profiler/whatsnew/

DLL References doesn't work in App_Code classes

asp.net,dll,app-code

As you know, there are two types of projects that you can use to create a website in Visual Studio. The App_Code folder works for Web Site projects, but since you stated that you're using a Web Application project, this is causing you problems. Here's some additional reading on this...

NLog not writing from referenced dll

c#,logging,dll

Ok, so I finally figured out what was going on after logging the trace... I noticed that it was only showing the error rule as loaded.... so I moved the "emaillog" rule above the "error" rule and all worked perfectly.

Use C++ DLL library project in C++ /CLR project

c++,visual-c++,dll,clr

Does the include file for the unmanaged project include <thread>, directly or indirectly? That's probably the cause of the error. Try to make the interface header of the unmanaged project just define the interface, and not include any implementation-dependent include files....

What are the different ways to know which all classes and methods present in a DLL?

c#,dll

I suspect the interviewer was referring to reflection. For example: var assembly = ...; // e.g. typeof(SomeType).Assembly var types = assembly.GetTypes(); var methods = types.SelectMany(type => type.GetMethods()); // etc You'd need to filter the types using Type.IsClass to get just the classes, for example. LINQ is very useful when working...

Eclipse IDE Error code -13 [duplicate]

java,eclipse,multithreading,dll

You have a 64-bit Eclipse and a 32-bit JRE (in C:\Program Files (x86)\Java\jre1.8.0_45) . They have to match. I suggest you get the 32-bit Eclipse as it's something you unzip rather than uninstall/install.

nodejs:How to call c++ DLL function through nodejs?

c++,node.js,dll

Yes, there are some prominent solutions out there for using Nodejs with native/C++. Checkout this node-gyp tutorial: http://www.benfarrell.com/2013/01/03/c-and-node-js-an-unholy-combination-but-oh-so-right/ Or Node-ffi: https://github.com/node-ffi/node-ffi ...

php: loading oracle driver gives error “Unable to load dynamic library - The specified procedure could not be found.”

php,oracle,dll,pdo

Seems like I figured it out and can answer my own question. It looks like XAMPP is delivering a non-suitable ddl with their distribution. The right and most recent oci8 dll's are downloadable here in all possible flavors: http://windows.php.net/downloads/pecl/releases/oci8/2.0.8/. Once I got the right one, it worked like a charm.

How to run a dll as a service?

c++,c,winapi,dll,service

There's actually no inherent reason why you can't use rundll32.exe as the host executable, though use of rundll32 isn't recommended. (To expand on that: I gather you're trying to build a DLL service as an academic exercise, which is fine. In production, you should of course use an EXE, as...

Reference Two DLLs with the same namespaces and types

.net,vb.net,dll

Sorry, I had hoped to paste this a comment, but SO prevents me from doing so. As far as I know, VB has not added the C# Aliasing feature, but your assertion that there is no solution in VB.Net is incorrect. Your referenced post from 2011 points you to using...

System.Windows.Interactivity must be referenced in the main project

c#,wpf,dll,reference

System.Windows.Interactivity.dll is not in the GAC, so .Net doesn't know where to find it. By adding a reference to your main project, you make the build system copy the DLL to the output folder. This lets the runtime find it....

Continuing DLL problems with heatmap.py

python,dll,heatmap

After literally hours of fighting with this, I found a remarkably simple fix. I downloaded Visual Studio (there are perhaps less bulky programmes that can be used), opened the broken dll in VS, clicked "Save As", simply overwriting the existing file, and the error is gone.

Including library in AIR Native Extension causes the error, “The extension context does not have a method with the name…” for all methods

c++,c,actionscript-3,dll,air

Using ProcessMonitor, I found that the the third-party library has a dependency on an external dll, which it was not finding. At the time the ExtensionContext is created, the runtime apparently attempts to resolve the dependencies of the ANE. Since it could not find this dll, the ANE's initializer function...

py2exe fails with “No module named 'clr'” when trying to build exe from script using pythonnet

python,dll,clr,python-3.4,python.net

Install description For reference, I performed standard install of py2exe using pip install py2exe. This puts py2exe into the Lib\site-packages for your python install. Next, I installed pythonnet by downloading the .whl from Christoph Gohlke's unofficial Windows binaries page, then using pip install path\to\pythonnet-2.0.0<version_numbers>.whl. This puts clr.pyd and Python.Runtime.dll into...

When is it a good idea to make a DLL file

c#,.net,dll

What you are after is code reusability, which is a broader subject than making DLL's, which as @Jodrell said, is created when you compile an assembly. The idea of re using code is something which spans across multiple domains and is not thus strictly related to the .NET platform. You...

Embarcadero C++Builder: Separate debug/release DLL references possible?

c++,dll,c++builder

As mentioned on the comments, one possible solution is: Instead of adding the lib/a files to the project, you can use the #pragma link directive in one of your source files to link them. And you can surround it with #ifdef directives to control which files to link in which...

Program does not go in order through constructor thus leading to uninitialized variables

c++,qt,dll

I believe 0xc0000409 indicates stack corruption, which could have resulted from various causes beyond just uninitialized variables. Since you note you've had to manually create a DLL header, there's a possibility that it doesn't completely match what the DLL was actually implemented as. Beyond things like parameter count/types and return...

Where is Microsoft.Build.Tasks.Core.dll located?

.net,dll

The dll is actually named: Microsoft.Build.Tasks.v12.0.dll Found here: C:\Program Files (x86)\MSBuild\12.0\bin\...

Running msi causes “module failed to register” in 32bit win7,but works in 64bit win7

c++,windows,dll,windows-installer

You are most likely not installing the requred VC++ Runtime support files. The target machine will need whatever VC++ runtime architecture you're using, x64 or x86. Including the merge modules won't work because you're using SelfReg from the install, and they aren't available at the time that the registration happens...

How to use C++ dll from C#

c#,c++,.net,dll

In C# you have to use StringBuilder() //define dll [DllImport("mydll.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] public static extern int mymethod(string key, StringBuilder data, IntPtr buflen); //method test private static int testdll() { string key = "123456789"; StringBuilder buf = new StringBuilder(1024); mymethod(key, buf, (IntPtr)buf.Capacity); string buf2 = buf.ToString() return...

Returning into object from Assembly.LoadFrom() in C#

c#,dll

(For the purposes of this answer, I'm going to assume that your Expansion subclass is has a fully qualified name of Intrique.Expansion. I.e. the namespace is the same as the name of the DLL). Because your main program does not reference Intrique.dll, the code in your main program cannot use...

Are you allowed to use any random DLL file as library? [closed]

c#,c++,dll

Depending on the EULA installed along this library, you MAY or MAY NOT be allowed to distribute a copy of this library. But you can always create a software that uses this DLL (i.e. call its functions) and have for requirements that any user of your software should get a...

Batch Script that Installs dll to Assembly folder

c#,.net,batch-file,dll

Try gacutil. Take a look here it seems like a duplicate. BTW: Assembly tag is for low-level assembler.

How to remove error of incompatible variable types in LoadLibrary() function?

c++,dll,types,loadlibrary

Try HINSTANCE hInstLibrary = LoadLibrary(L"DLL_tut.dll"); or HINSTANCE hInstLibrary = LoadLibrary(_TEXT("DLL_tut.dll")); The thing is that your project is probably compiled with UNICODE macro defined, which causes LoadLibrary to use LoadLibraryW version, which requires Unicode string as a parameter. ...

UnsatisfiedLinkError exception while working with dll and java jni4net

java,c#,dll,unsatisfiedlinkerror,jni4net

I considered it to be the classloader problem which it was not when I later suppressed my files to load from same classloader. Further examination shown that the path I was giving was direct path to the file in the directory, and was not pointing to the same direction as...

program linked to SFML dlls wont start, returns 0xC000007B or missing __gxx_personality_v0

c++,dll,sfml

Due to C++ ABI incompatibility the SFML libraries must be built with the same exact compiler as your application gets built with. If you don't use this MinGW compiler, you'll have to rebuild SFML by yourself....

How to return an array of structs to Console Application from Class Library

c++,arrays,dll,structure

Change function signature in to int Disp(employees *) ; it' OK. What is not ok is how you link your DLL. You can either loat it at startup (it happens behind the scenes) or with LoadLibray, but this requires a GetProcAddress too. First way it's easier. It allows you to...

Python ctypes for HANDLE

python,dll,ctypes

Try redefining the function call like this: from ctypes import * from ctypes.wintypes import * dll = WinDLL('myDll.dll') connect = dll.Connect connect.restype = c_short connect.argtypes = [POINTER(HANDLE), POINTER(UINT), LPCWSTR, LPCWSTR, c_int, c_int) And call like this, using byref to pass by reference: self.user_id = HANDLE() self.keep_alive_id = UINT() err =...

Linking to a static lib compiled with MSVC

dll,rust

Ok, a few things. First of all, there's no such thing as a "static DLL": a DLL is a dynamically linked library. Secondly, Rust uses the MinGW toolchain and runtime. Mixing MSVC and MinGW runtimes can cause odd things to happen, so it's probably best avoided if at all possible....

Object instantiation using Reflection works in VB.NET but not C#

c#,.net,vb.net,dll,system.reflection

VB.NET will allow you to do "Late Binding" (when option strict is not used or when it's explicitly allowed through the project properties.) which will let the runtime check whether the object has a certain method before callign it. This is also possible in C#, but then you need to...

PHP 5.3.19: Class 'DOTNET' not found

php,.net,dll

The reason why i was getting this error is because i was editing the WRONG php.ini file. If you develop PHP in visual studio with the php plugin, you have a separate ini file to work with. It is that one that i had to change to get this to...

Missing DLL even though the directory containing it is in the path

windows,visual-studio-2012,dll,vtk

In VStudio, go to your application project properties, select Debugging, and in the Environment option, add PATH=%path_to_the_folder_where_your_your_dll_is_located%; (I'd suggest using relative paths).

Compiling standalone Qt application using MinGW

c++,windows,qt,dll,mingw

I solved my problem now. The problem was that although I edited the variable QMAKE_CXXFLAGS, it was still linking the standard libraries dynamically when linking the application itself, because it doesn't use this variable in the final step of the compilation. I only edited the mkspecs again and added the...

Pass structure (or class) from C++ dll to C# (Unity 3D)

c#,c++,dll,plugins,interop

It should work correctly (at least, here in a small C++ + C# project I have, I was able to make it work with that struct, both in x86 and x64) [DllImport("MyWrapper.dll", CallingConvention = CallingConvention.Cdecl)] private static extern HandInfo MyWrapper_getLeftHand(); The only thing, you must declare the CallingConvention = CallingConvention.Cdecl....

Get VU of VSXu artiste with C++

c++,memory-management,dll,base-address,cheat-engine

The problem is I suppose because you are calling GetModuleHandle within your own process. The solution you can try is to use: GetModuleInformation, it will return base address in MODULEINFO as: lpBaseOfDll The load address of the module. To get process and module handle you can use sample code from...

'The command line is too long' when linking .obj files in Windows command prompt

windows,maven,dll,cmd,linker

I think I got the answer to my question. I can bundle the arguments of the command in an .rsp file and fire it up on my command prompt with the executable after prepending its path by '@'. So, for this command: cl.exe foo.dll (around 1500 .obj files) (couple of...

When to free a dll after exporting object

c++,c,dll,free

The DLL needs to stay loaded for as long as you're using it, and that includes using the ICar instance. If you free the library and then call a function on that ICar, the function might no longer be there - you've freed it. Saying "I do not really need...

Signing a DLL assembly with public key token

c#,.net,dll,strongname,assembly-signing

As Luaan said above, what I wanted to do is not possible. The private key is just that - private. The public key is designed for verification purposes, to ensure that the assembly has not been modified. Removing the strong name was an option, as Luaan said in one of...

Copy dll files to .exe directory in ClickOnce deployment

c#,c++,dll,deployment,clickonce

Ok, figured it out. This blog post describes the hidden possibilities of project files which allow to do what I want: http://blogs.msdn.com/b/mwade/archive/2008/06/29/how-to-publish-files-which-are-not-in-the-project.aspx Basically you should add an item to you project file for each file you will be deploying if you want a custom path for it: <ItemGroup> <PublishFile Include="ExternalDependencies\DSAPI.dll">...

The linker link, but the executable ask for another dll

dll,linker

The problem is solved, there was a error in Makefile, in LDFLAGS a "-L/directory/lib", refering to a /lib directory that contain libgtksourceview-3.0.dll.a and libgtksourceview-3.0.la corresponding to the wrong dll.

C lib file dependency conflicts

c++,c,dll,shared-libraries

Yes it is. If the conflict is that b1 and b2 have fiction with the same name and different behaviour the linker will pick one of them (the first) and a2 will be served withe wrong one....

JNA couldn't find the specified procedure in dll file through java

java,c#,dll,enums,jna

The problem here is that your DLL is a .Net DLL, which is not a native DLL. JNA only loads and understands native DLLs, that is, DLLs built to function outside the .Net framework. What this means is that you need a different glue between Java and .Net. I have...

Debugging a C++ Program that uses a 3rd party dll

c++,debugging,dll,visual-studio-2005

Resolved: Configuration Properties -> C/C++ -> General -> Debug Information Format was disabled. Setting this to Program Database (/Zi) fixed this issue....

Is storing personal libraries as console applications a bad idea?

.net,dll

The immediate benefit is that I can easily implement integration tests within the main application. Why would you want to do that? I don't see that as a benefit at all. Why would you want to deploy your tests when you deploy your production code? And why would having...

Determine .lib / .dll with header file

c++,dll,header,static-libraries

There's no automatic way to "look up" which lib goes with a given header. When you compile, the linker simply takes all the function calls on one side and all the libs on the other side and starts matching. Here are the standard solutions, in order from best to worst:...

Translating DLL Call functions from C to Delphi

c,delphi,dll

It would be more useful to see the DLL's actual .h file instead of documentation, as documentation tends to not mention what the calling conventions actually are (and this case is no exception). You are declaring your Delphi functions as stdcall, which may or may not be correct. cdecl is...

C# calling batch file failed to copy dll files to System32 folder

c#,batch-file,dll,windows-7-x64,system32

If your app is a 32-bit application, then the file will end up in the %windir%\SysWOW64 folder. See this page on Msdn for more details. Your 32-bit application should be able to see this file. I should point out that copying dlls to your system folder is usually a bad...