dll

Can you remove an Add-ed Type in PowerShell again?

I'm currently writing a library in C# and was using PowerShell to quickly test it on some occasions. However, this prevents me from re-building the project as PowerShell obviously still has the DLL open. Is there a way of unloading the DLL again after adding it with Add-Type? The documentation doesn't seem to have clues on that and the ...

Is there a way to get an errorlevel from FileProtocolHandler or url.dll?

In one of my programs I am using rundll32.exe url.dll,FileProtocolHandler c:\path\to\a.file to open files. I would like to handle errors in case this file could not be opened but I can't figure out how to find out if there was an error or not. That's my code: QProcess::startDetached( QString( "rundll32.exe url.dll,FileProtocolHandler " ...

CustomAction succeeds on development computer, fails on deployment computer

I'm creating a WiX installer to install a program which connects to a database. To help with this, I've created a C dll which checks to see if a certain instance of SQL exists on a server: extern "C" UINT __stdcall DBConTest(MSIHANDLE hInstaller) { FILE *fp; fp = fopen("dbcontestdll.txt", "w"); _ConnectionPtr pCon; int iErrCode; HRE...

Making C functions available to php

I have a C dll containing functions and enumerations I want to make accessible from php. How can I do it? ...

Add COM 32 to VB.NET

How can I add a COM DLL to A VB.NET project? ...

Multiple C++ .lib projects to .dll projects, Lua crashes!

Hello, Today I've tried to get Edit & Continue to work in my solution, which looks like this: Game Engine .lib <- Game .lib <- Editor .exe <- Server .exe <- Client .exe Which works nicely. But now I wanted to turn the engine and game .libs into .dlls, so I can use the Edit & Continue ...

Qt windows libmysql.dll

I have installed MySQL 5.1.49 and the binary QT 4.6.2 for Visual Studio 2008. I configured Qt as follow: C:\Qt>configure -static -no-webkit -plugin-sql-sqlite -plugin-sql-mysql -I C:\mysql\include -L C:\mysql\lib\optC:\Qt\src\plugins\sqldriver Everything went fine, no errors. When I run nmake on my application everything runs fine, no...

Calling a C++ .dll from C# throws a runtime error ...

Hi all, The following line is generating a runtime error in a C# GUI: int x = myclass.number_from_dll(); I'm using Microsoft Visual Studio 2008. The code in C# is: class myclass { [DllImport("strat_gr_dll.dll", EntryPoint = "number_from_dll")] public static extern int number_from_dll(); } The code in the C++ .dll is: // This...

Where's the DLL for SportsStore.UnitTests???

Hey there SO, I reading Steven Sanderson's book, Pro Asp.NET MVC 2 Framework. I'm on page 116 and I'm running into trouble trying to use NUnit. The book says that I should locate the DLL for SportsStore.UnitTests (one of three projects in the SportsStore solution.) But when i go to SportsStore\SportsStore.UnitTests\bin\Debug\ there is ...

Convert a dll to a lib for static linking?

Is there a free way to statically link a dll? I've tried dll to lib but $999 is too expensive. What are alternatives since I want to have 1 nice exe instead of 1 exe + 1 DLL. Thanks ...

Windows: How to get types from a DLL that may not exist?

I'm writing code that requires a DLL that exists only on Windows 7. However, I will deploy to older platforms, so I want to use the DLL if it exists on the user's system. I can use LoadLibrary() to get a HMODULE, and GetProcAddress() to get methods from that HMODULE. This allows me to get the method, and it will still compile. But how d...

register dll - GUIDs not found in registry

i've got a c#-dll and registering via regasm tells me success, but the GUIDs have not been added to the registry and therefore, the component can't be used anywhere. and i've got simply no idea why :( class attributes: [ProgId( "blup" )] [ClassInterface( ClassInterfaceType.None ), ComSourceInterfaces( typeof( blap ))] [Guid( "0CFEF92B-...

Help with DLL to Lib

I have converted a dll to lib. I gave it the lib and dll file and told it to remove the unnecessary stuff. I #included the .h file it created, and called GLU_DLLMAIN() in InitInstance just like I saw in the samples, but it still crahes on start up when it tries to initialize my static GLU object. What am I doing wrong? what is the proper...

Using LuaInterface - ERROR_DLL_INIT_FAILED

I've been trying to integrate Lua into my managed code, using LuaInterface. I'm using the lua51.dll that came with the assembly I downloaded, but when I try to create a new Lua object, the constructor fails with ERROR_DLL_INIT_FAILED, or HRESULT 0x8007045A. I checked that I'm building as x86. What else can be the problem? ...

The type "x" is defined in an assembly that is not referenced. VS 2010 C#

Hi all, I am having a problem I just couldn't solve and would like some input. I am working with multiple class libraries in Visual Studio 2010, .net 4.0 Framework, in C#. I have a class library project which references the assembly output(.dll file) of another Visual Studio solution. The reference was added correctly to the class li...

How do I cleanup .NET stuff when a C++/CLI DLL unloads?

I'm new to C++/CLI, so please bear with me... I'm working on a mixed C++/CLI DLL, which should act as a bridge between a Win32 process and a .NET assembly. In the DLL, I need some .NET stuff to be present during the lifespan of the DLL. Initializing is not that big a problem, but I couldn't figure out when can I safely cleanup the .NET ...

When should non-control library DLLs display windows and other GUI elements?

I believe this mostly applies to custom dialog boxes being put into DLLs, but I'm sure there are some outlying situations I haven't thought of. Is there ever a reason for a DLL (besides perhaps a Control Library) to display dialog boxes, popups or other GUI elements? I see that it takes away control from a developer using that library, b...

C# Compiler says function is not defined, when it is...

I just need another pair of eyes... I don't see anything wrong with the following. In fact, I swear I had something just like this not long ago, and it worked. In my Collections.dll: namespace Collections { public class CSuperAutoPool { public static CSuperAutoPool ActivateByType(Type typeToBeActivated, params object[] act...

Linking the Windows API

Hello, I was using a ITK library. When I wrote a sample program using this library, I've got following linker errors. As we can see these all "unresolved" symbols are Windows API functions and these windows API functions were used by ITK library and not my program. Error 1 error LNK2019: unresolved external symbol _SnmpUtilVarBind...

DLL unloading itself

Is it possible for a function that is inside a DLL to unload the DLL? I need to do this so I can make sure the DLL is not in use, then write to the DLL's file. ...