dll

How to hook external process with SetWindowsHookEx and WH_KEYBOARD

I am trying to hook for example Notepad without sucess. Making a global hook seems to work fine. Testing on XP SP2. Edit: Amended code works now. MyDLL code #include <windows.h> #include <iostream> #include <stdio.h> HINSTANCE hinst; #pragma data_seg(".shared") HHOOK hhk; #pragma data_seg() //#pragma comment(linker, "/SECTION:.share...

Modifying C++ DLL to support unicode - common pitfalls to avoid?

I have a windows DLL that currently only supports ASCII and I need to update it to work with Unicode strings. This DLL currently uses char* strings in a number of places, along with making a number of ASCII Windows API calls (like GetWindowTextA, RegQueryValueExA, CreateFileA, etc). I want to switch to using the unicode/ascii macros de...

use vc++ class library in c#

hi, i have created a simple "public ref class" in the vc++ project, which is configured to generate a dynamik library. In the c# Project (simple console application) i added the vc++ project as to the References and doing a "using myVC++library". But when i try to create an object from the vc++ dll i always get: System.BadImageFormatExce...

Loading 32bit DLL using Excel 2007 (Vista 64bit version)

I discovered that I can NOT load any 32-bit DLLs using my version of Office 2007. I’m using Vista 64bit and I assume that Office is also in 64-bit mode. Is it possible to start Excel in 32-bit mode Or Is there a way to declare a DLL using VB to load a 32-bit DLL? Since I don’t have the source code to some of the DLLs I am using, I can’t...

How should I ensure that my Visual Studio installer updates DLLs when installing an older version?

I recently noticed that my installer (VS 2008) does not remove the DLLs during uninstall. This is not too much of a concern to me but the following is a concern: when I install an older version of my software, it does not overwrite the DLLs -- it keeps the newer version. When I am rolling back my system to an older version, I would li...

Is there a way to get Visual Studio to unload dlls?

I have a Visual Studio 2008 project with some legacy native C++ DLL projects, and some newer WPF projects that use the DLLs. When I open the WPF xaml windows in the designer, Visual Studio loads up the native DLLs to be able to display the window. The problem is, is that if I now need to make a change in the legacy DLLs, I need to cl...

Problem with dynamic loading of a dll into my program.

I'm trying to add plugins to my program, and this looks good, except that I can't cast the correct type from the dll. I Have a solution with several projects on it. One of the project is a country Layer, that actually holds a CountryBase (defined as public abstract class CountryBase : CountryLayers.ICountryBase ) The Interface (public i...

Are cross-dll allocations ok?

If I have an app that uses at least two dlls, is it generally safe to allocate resources in one dll and free them in another? I'm thinking specifically about calling fopen and fclose in different dlls, but I'd also like to know that it's safe for other resources (memory pointers, handles, etc...). I think as long as everything is compi...

Change settings of a running process

Hi, I noticed that when a process starts for the first time, it statically reads some system parameter info only once and keeps it until terminated which means, that if there is some modification to the system parameters already read by the process, they wouldn'y reflect until the process is restarted. e.g. Launch Notepad and type ';...

Call C++ code from a C# application or port it?

I've recently been wrestling with an algorithm which was badly implemented (i.e. the developer was pulled off onto another project and failed to adequately document what he'd done) in C#. I've found an alternative (from numerical recipes) which works but is written in C++. So I'm thinking probably the safest way to get something workin...

Call external dll function (c#) from postgres...

Is it possible? How? Thanks! ...

What might prevent a DLL from loading with LoadLibrary?

I have a JD Edwards business function, which is written in Microsoft Visual C++ as a C module. I'm using LoadLibrary to access a third party DLL. In a standalone test program, the code runs just fine. When I run it from within JDE, LoadLibrary returns NULL and GetLastError returns 126, which means The specified module could not be found ...

Unresolved external symbol link error

i have a project where i need mouse hooks to be used, so i have added a MOUSE HOOK DLL project to my solution...on rebuild..i am getting the follwoing errors Error 3 error LNK2005: "struct HHOOK__ * MyHook" (?MyHook@@3PAUHHOOK__@@A) already defined in projdialog.obj projdialogDlg.obj Error 4 error LNK2005: "struct HINSTA...

Create DLL : How can I use a dll to create a new dll ?

In visual studio 2005: I want to create a dll base on another dll. For example : I want to create a DLL -- new.dll, and it uses a DLL -- old.dll; How can I create a new.dll have old.dll inside? I mean, I don't need to include old.dll in my project when I use new.dll? Thanks for any advisement. ...

How do I get my ATL COM DLL IE plugin to work in Mozilla?

I have COM DLL(ATL Project) which handles the download dialog in IExplorer. I want that same DLL to work in Mozilla. What do I have to do for this? Is it possible? ...

How to get the filename of a DLL ?

Hi, I have a C++ Windows application myapp.exe which loads several plug-ins. Plug-ins need to find the path to their DLLs. I can use GetModuleFileName for this, but it need the handle for the plug-in DLL. I don't know where to get this handle. GetModuleHandle(NULL) returns the handle to the executable. One option is to use GetModuleHa...

Compile a DLL in C/C++, then call it from another program

I want to make a simple, simple DLL which exports one or two functions, then try to call it from another program... Everywhere I've looked so far, is for complicated matters, different ways of linking things together, weird problems that I haven't even begun to realize exist yet... I just want to get started, by doing something like so: ...

How to hide the exporting functions in DLL

I don't want user to see all the exporting functions through Dependence in my DLL, is there a way to do it? I complie my DLL with C++ and MS Visual Studio. ...

application couldn't be initialized error (manifest file problem)

Hi there. I am trying to use a library (.dll) in my project. Everything seems to be set up fine. It all works in release mode. When I go debug on it, I get this darn error on startup: ldr: ... application couldn't be initialized error (or similar, I translated it) I learned that this has to do with manifest files. I fumbled around a ...

Using a .net compiled dll inside native c++

Hi, as i understand that any .NET program gets compiled to MSIL which is fed to the CLR which compiles it to the assembly code and along with the help of JIT it executes it. I was wondering, as .NET is a wrapper around the win32 api and the CLR ultimately converts the MSIL to assembly program. Isn't it possible for me to write some func...