dll

CUDA - Maintain pointers to global memory

I have a .NET program that is utilizing CUDA. The CUDA is accessed through a C DLL. What I am doing is initializing my CUDA application by allocating buffers (cudaMalloc) on the device at program startup. Pointers to these buffers are then maintained in static variables declared in the DLL. Data is copied to and from the buffers thro...

Finding external calls in a C++ dll

We currently use a hardware driver's DLL for a particular piece of hardware we interface with. However, we also have an old internally developed DLL written with VC++ around 2002 that wraps that DLL for a few core functions. This code has been long lost, and was developed well before I came on the scene. So, it cannot be supported or eve...

Why use DllImport Attribute as apposed to adding a reference?

I've seen a couple of examples such as this: [DllImport("user32.dll")] static extern bool TranslateMessage([In] ref Message lpMsg); [DllImport("user32.dll")] static extern IntPtr DispatchMessage([In] ref Message lpmsg); But, what I don't understand is why someone would do that as apposed to just referencing the DLL like they do other...

Problem loading UserControl with DLL reference in Design View

I have a C# project with a UserControl in it. This user control depends on a particular C++ Mixed mode dll which in turns, acts as a facade to an unmanaged C++ DLL C# C++ Mixed C++ Umnanaged [ main app ] ---> [ myUC ] ---> [ OCShell.dll ] ---> [ OCC.dll ] In the Design View, I cannot add th...

Link external libraries portably?

I've got a .dll file created in VC++ 2008 that needs to be widely distributed, but also requires external resources (namely OpenSSL libraries) to operate. The dll compiles and runs perfectly well on my own system, as well as any other system with the appropriate external libraries manually installed on them, but I need for the .dll itsel...

Is it true that there will always be a .lib(import library) associated with the .dll you build?

Or do I need to instruct the compiler explicitly ? ...

Handling a Struct native to C# in C++.

Here is my call in C cli::array<mercurial::fileItem>^ tmp = mercFlowCLR::merc::getFolderList(gcnew System::String(remotePath)); Here is my C# Structure: public struct fileItem { public string fileName; public bool isFolder; } My getFolderList is returning of type in C#: List<mercurial::fileItem> The C++ DL...

Visual Studio 2008: Use external Debug-DLL for Debug-Run and external Release-DLL for Release-Run

Short version: If running a program from VS2008 in Release mode, I want it to use pathA\externaldll.dll. If running a program from VS2008 in Debug mode, I want it to use pathB\externaldll.dll Long version: I have a programm that is linked against external dll-files (VTK). I have built the external application myself in both Debug and ...

requiring msvcr80.dll and msvcr80d.dll in the same dll?

how can it be that a dll that i build here (in debug mode) tries to load msvcr80.dll and msvcr80d.dll ... i assume this leads then to a conflict as it can resolve the same symbols twice ... i have no idea why the dependency to msvcr80.dll comes in. according to dependency walker ouput the dependency comes directly from my dll and not vi...

Can pipeline be used in sharing Dll in different process?

Hello all, Before I get into to my question,let me explain what I am exactly doing.I have a main Process say ProcessA,I have hooked ProcessA and also injected dll(say myDll.dll) into the process space of ProcessA.Now at one point ProcessA kicks on another process which is ProcessB.Both the process A and B are in totally diffe...

std::stringstream bugs?

I've got my own DLL which is being injected into another process. From the other process, the DLL sends IPC messages via boost::message_queue to my application. I'm using std::stringstream to construct the messages, as following: class Client { ... private: template &lt;class T> void AddMessageParameter(const T &m) ...

add/remove dll reference c#

I'm developing a desktop application. For that I'm creating class libraries. At the development time I have to rebuild the class library multiple times for functional testing and update reference to DLL. But once I add a reference to a DLL, then add some code to a class file and rebuild it, and add a reference to the newly built DLL, it'...

Living on the edge: can I change a constant string in a deployed asp.net website page dll?

(Unfortunately, this question is about a non-recommended practice. While I appreciate advise against doing what I request here, I know it isn't good practice anyway, but every now and then we just have to and open our trick bag ;-)) In a situation where we accidentally published an asp.net website, without updatability, with one wrong U...

writing unmanaged DLL consumable by C#/.NET code

I need to implement a small part of my application logic in native code. To test PInvoke capabilities I created a simple solution with an unmanaged C++ Win32 Dll and a WPF project that consumes the dll functions using PInvoke. The problem I run into is that i receive exception about "unbalancing the stack" and "possible signature mismatc...

Reference third party dll in Visual Studio 2010 gives original dll path?

I'd like to add a third party dll from Blend 4 to my source control, so taht I don't have to install Blend (or perhaps just til SDK) on my TFS Build server, in order to have a succesfull build. I've copied the dll (Microsoft.Expression.Interactions.dll) from C:\Program Files (x86)\Microsoft SDKs\Expression\Blend.NETFramework\v4.0\Librar...

DLL loading with hardlink

I am trying to devise a method which helps to load DLL from a common location for various products. This helps the following directory structure to avoid file replication. INNSTALLDIR/Product1/bin INNSTALLDIR/Product2/bin .. INNSTALLDIR/ProductN/bin> Instead of replicating DLLs in each product's bin directory above, I can cre...

plugin pattern with .dll. how can I extract plugin interface from dll?

I have an application that's suppose to be realized in plugin pattern. Plugins are located in dll files and I'm loading them on the fly, depending on the parameter given from a user via command line. That is, if user wants to use plugin1 he types that name as a parameter in command line when running the app and I am supposed to load it o...

How would I inform an isolated application of the location of dependent DLLs?

I have a couple of isolated applications that I am writing that all rely on dlls that are also written by myself and team. Things were fine when we only had a few dlls but not the build output directory is getting rather cluttered and hard to navigate. I would ultimately like to have the output build directory contain the following str...

How to get a DLL loading process handle

Hi there, I'm trying to get the handle to the process which loaded a dll from the dll. My approach is: in DLL_PROCESS_ATTACH I call EnumWindows(EnumWindowsProc,NULL); my EnumWindowsProc implementation is the following: BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) { if(GetCurrentProcessId() == GetWindowThreadProcessId(hW...

Avoid Other applications load my dll

Hi, I have created a ContextMenu DLL (to dispaly icon overlay and other shell context menus) and register it in my system. Acutally, since it is a context menu dll, I wish only explorer exe should load my dll. But in my case, applications like 'Thunderbird', 'Process Explorer', 'Visual studio', ... etc are all using my dll. Is there ...