dll

What happens to global variables declared in a DLL?

Let's say I write a DLL in C++, and declare a global object of a class with a non-trivial destructor. Will the destructor be called when the DLL is unloaded? ...

Checking version of file in Ruby on Windows

Is there a way in Ruby to find the version of a file, specifically a .dll file? ...

Passing EXE data down to one or more DLLs

Hi, Our current application is a single OpenGL EXE containing multiple pages. The EXE is responsible for accessing data sent across the network via UDP. It accumulates the data and stores it in a host of singleton structures. The individual pages within the EXE access the singleton structures to process the data as they see fit. In ...

How can I use classes from VisualBasic-Express in VBA for Excel or Access projects?

I saved my VB-Express code as .dll and registered it with regasm and made a .tlb file. But when I try to run a function from it in an Excel-modul I get: Run-time error ‘453’: Can’t find DLL entry point RegisterServiceProcess in kernel32 What step did I miss? ...

How to protect yourself against shell DLLs loaded into your process?

When you use a standard Windows "file open" dialog using GetOpenFileName(), the shell will load various DLLs that it requires to display the file list, including custom ones. In my application, I found that the DLL that TortoiseCVS uses to draw overlays on the icons was calling GdiPlusShutdown(), and so some time after displaying a "fil...

Embedding one dll inside another as an embedded resource and then calling it from my code

I've got a situation where I have a DLL I'm creating that uses another third party DLL, but I would prefer to be able to build the third party DLL into my DLL instead of having to keep them both together if possible. This with is C# and .NET 3.5. The way I would like to do this is by storing the third party DLL as an embedded resource ...

Best resources for converting C/C++ dll headers to Delphi?

A rather comprehensive site explaining the difficulties and solutions involved in using a dll written in c/c++ and the conversion of the .h header file to delphi/pascal was posted to a mailing list I was on recently, so I thought I'd share it, and invite others to post other useful resources for this, whether they be links, conversion to...

Secure DLL with license file

What is the best way to secure the use/loading of a DLL with a license file? ...

Is there a Windows/MSVC equivalent to the -rpath linker flag?

On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables. Can this also be accomplished on Windows? As far as I know, dlls are always searched in the executable's directory and in PATH. My scenario: I would like to put shared libraries into location...

Building and deploying dll on windows: SxS, manifests and all that jazz

Hi, Since VS 2005, I see that it is not possible to simply build a dll against MS runtime and deploy them together (http://www.ddj.com/windows/184406482). I am deeply confused by manifest, SxS and co: MSDN documentation is really poor, with circular references; specially since I am more a Unix guy, I find all those uninformative. My cor...

Dynamically importing a C++ class from a DLL

What is the correct way to import a C++ class from a DLL? We're using Visual C++. There's the dllexport/exports.def+LoadLibrary+GetProcAddress trifecta, but it doesn't work on C++ classes, only C functions. Is this due to C++ name-mangling? How do I make this work? ...

How to get my own code's module handle?

I'm trying to find a resource in my own module. If this module is an executable, that's trivial - GetModuleHandle(NULL) returns the handle of the "main" module. My module, however, is a DLL that is loaded by another executable. So GetModuleHandle(NULL) will return the module handle to that executable, which is obviously not what I want....

How to get the executable path from a Managed DLL

I have a managed DLL (written in C++/CLI) that contains a class used by a C# executable. In the constructor of the class, I need to get access to the full path of the executable referencing the DLL. In the actual app I know I can use the Application object to do this, but how can I do it from a managed DLL? ...

DLL information

How exactly do dlls work? There seems to be an awful lot of them, but I don't know what they are or how they work. So, what's the deal with them? ...

Specifying a non-.NET dependency in Visual Studio

Hello, I'm calling a non-.NET dll from my project using P/Invoke, meaning that the .dll must always be present in the .exe's directory. Is there any way to tell Visual Studio of this dependency, so that it will automatically copy the .dll to the output directory when compiling, and will automatically include the .dll in the setup? Or ...

Problems adding a COM component reference to a VB.NET project

I have a third party COM dll that I'm trying to add to a vb.net (2008 express) project. I put the dll in C:\WINDOWS\system32\ and registered it with "regsvr32 vxncom.dll". When I go to projects > add reference and go to the COM tab it shows up in the list of available components/libraries. But, when I select the library and hit ok, visua...

What standard techniques are there for using cpu specific features in DLLs?

Short version: I'm wondering if it's possible, and how best, to utilise CPU specific instructions within a DLL? Slightly longer version: When downloading (32bit) DLLs from, say, Microsoft it seems that one size fits all processors. Does this mean that they are strictly built for the lowest common denominator (ie. the minimum platform s...

Convert console exe to dll in C

I am interested in calling SoX, an open source console application, from another Windows GUI program (written in Delphi naturally). Instead of dealing with scraping and hiding the console window, I would like to just convert the application to a DLL that I can call from my application. Before I start down this path I am curious how m...

Does a memory leak at unload of a DLL cause a leak in the host process?

Consider this case: dll = LoadDLL() dll->do() ... void do() { char *a = malloc(1024); } ... UnloadDLL(dll); At this point, will the 1k allocated in the call to malloc() be available to the host process again? The DLL is statically linking to the CRT. ...

WinDbg Dr. Watson minidump - requires pdb/dll originally built for installed version?

I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly? My problem is that our pdb files are only kept for major releases (unfortunately). This is a daily build, which I can rebuild myself, but I'm getting tripped up on ...