473,791 Members | 3,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

loading unmanaged dll

Aks
Hi,
I have C# application "applic.exe " and a dll "dyna.dll"

whenever "applic.exe " or "dyna.dll" is loaded, I need them to also
load "test.dll" (unmanaged c++ dll).

I do not have sources of "applic.exe " or "dyna.dll"

Do I need to use linker here? or is there some way of rewriting
binaries to load "test.dll"

or is there any other way such that
whenever applic.exe or dyna.dll is started they automatically load
test.dll.

Thanking you in advance,
Akhila

Jun 20 '06 #1
5 2154
Hi,
"Aks" <ak************ **@gmail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
Hi,
I have C# application "applic.exe " and a dll "dyna.dll"

whenever "applic.exe " or "dyna.dll" is loaded, I need them to also
load "test.dll" (unmanaged c++ dll).

I do not have sources of "applic.exe " or "dyna.dll"

Do I need to use linker here? or is there some way of rewriting
binaries to load "test.dll"

How r u using test.dll ?

As the last resort you could use the Win32 LoadLibraryEx API
I'm not really sure right now, but I think that the compiler load the dll
for you if you are using P/invoke
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jun 20 '06 #2
Aks
Hi,
test.dll has code to register channel hooks in dll main. rest is by
callsbacks. so I am not calling any function of test.dll.

when a exe say client.exe is loaded the test.dll should be loaded as
part of the exe.

Is this possible thru reflection?

I am not sure, but code for LoadLibrary and Invoke should be added in
client.exe. and I do not have access to the code.

Is there any way for this.
TIA,
Akhila

How r u using test.dll ?

As the last resort you could use the Win32 LoadLibraryEx API
I'm not really sure right now, but I think that the compiler load the dll
for you if you are using P/invoke
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


Jun 20 '06 #3

"Aks" <ak************ **@gmail.com> wrote in message
news:11******** *************@r 2g2000cwb.googl egroups.com...
| Hi,
| test.dll has code to register channel hooks in dll main. rest is by
| callsbacks. so I am not calling any function of test.dll.
|

If you don't call any function, what's the need to load the DLL? Bet you
need to call the functions to register the hooks.
| when a exe say client.exe is loaded the test.dll should be loaded as
| part of the exe.
|
| Is this possible thru reflection?
|
No, Reflection is a managed thing, you can't use it to load/call unmanaged
code libraries.

| I am not sure, but code for LoadLibrary and Invoke should be added in
| client.exe. and I do not have access to the code.
|

You can't do anything if you don't have access to the source code.

| Is there any way for this.

Nope.

Willy.
Jun 20 '06 #4
Aks wrote:
Hi,
I have C# application "applic.exe " and a dll "dyna.dll"

whenever "applic.exe " or "dyna.dll" is loaded, I need them to also
load "test.dll" (unmanaged c++ dll).

I do not have sources of "applic.exe " or "dyna.dll"

Do I need to use linker here? or is there some way of rewriting
binaries to load "test.dll"

or is there any other way such that
whenever applic.exe or dyna.dll is started they automatically load
test.dll.

Thanking you in advance,
Akhila


Hi Aks,

What do you mean "dyna.dll" is loaded? I can understand
loading "applic.exe "... you just mean when it is executed, yes?

I'm also not sure what you mean by loading "test.dll", is this some random
call to a "LoadLibrar y" routine? Or do you also need to execute functions
and whatnot? Can you provide any further information?

-- Tom Spink
Jun 20 '06 #5
Aks
If dyna.dll is a com+ dll. it gets loaded into the memory whenever a
client calls new().
the code to register channelhooks is in DLLmain() itself. I need not
have to call any method for this.

when I have access to code of applic.exe,
I add a reference to test.dll,
in Main function call new() on one test.dlls classes
when applic.exe is built, test.dll is linked with it. and whenever
applic.exe runs it will load test.dll

now if I do not have code of applic.exe, I guess there is no other way
to include test.dll in applic.exe and call test.dll method. :-(
-Akhila
Hi Aks,

What do you mean "dyna.dll" is loaded? I can understand
loading "applic.exe "... you just mean when it is executed, yes?

I'm also not sure what you mean by loading "test.dll", is this some random
call to a "LoadLibrar y" routine? Or do you also need to execute functions
and whatnot? Can you provide any further information?

-- Tom Spink


Jun 21 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4506
by: Organza | last post by:
Good morning. Im building a little utility that load dll and show me all his properties and methods. somthing like the object browser. but i have a big problem with it. when im loading a .net dll everything is fine , but when im loading vb6 dll , the dll can not be loaded. anyone knows how to solve it? im using the assembly method to do it.:
4
6901
by: Matt Sawyer | last post by:
I am attempting to use an API (CxApiOem.dll) that has a large number of defines and complicated structs. It's just too much hassle to attempt to use DLLImport to make the desired API calls. Instead, I created a managed C++ DLL (OneBoxAPI.dll) that wraps the desired API calls in a manner which is easy to call from C#. This way I can use the header files that are part of the API for all the defines and structs. I am having a problem...
2
2144
by: NGM | last post by:
Hello All I have a unmanaged C++ DLL, which has been wrapped up with a manged C++ DLL. When i refer to this managed DLL in Windows form based applications it works out fine. But when i refer to the the same managed C++ DLL in ASP.Net application. ngmujumdar@hotmail.com/ amar_a_k@yahhoo.co NG
0
989
by: Adam M. Rosenzweig | last post by:
Hello, I am having a problem getting a particular web service to work on a win 2003 server. This web service does work on my XP box. The web service is written in VB.NET, and uses a declare statement to access a function in an umnanaged dll built using Visual C++ 2003. The function in the dll returns an XLOPER *, which in the VB code I take as an Integer, and use other functions inside a different unmanaged dll to parse the results...
3
2786
by: Mali Guven | last post by:
Hello, I have a native DLL (written in C) which is supposed to call a managed DLL (was written in C#, and an entry point was injected modifying the ildasm'd code). The exectuable calls the native DLL but the native DLL fails to load the managed DLL. The paper that addresses the 'mixed DLL problem' below does not offer any understandable workaround....
6
6879
by: Dan Dorey | last post by:
I actually have two questions here, but I'll start by giving an outline of what I'm trying to do. I'm building an app with a simple plugin architecture (all in the same app domain). I have each plugin in a separate sub-dir inside a "Plugins" directory. Each plugin consists of at least two DLLs (a controller and a driver). However, most drivers also rely on other external DLLs. In one particular case this dependency is to a C++ DLL...
0
1315
by: Arne Adams | last post by:
Hi all, i have a managed c++ dll using both managed and unmanaged code and an unmanaged application that calls the unmanaged code of the managed dll. I did follow http://support.microsoft.com/kb/814472/en-us but still the application crashs before the first call of the unmanaged code. MainFrame.cpp: (unmanaged application) bool WillUseManagedWrapper()
1
1720
by: aircraft | last post by:
Hi folks, I'm trying to load a mixed mode dll from a native c++ application using loadLibrary. If I run the application from the local drive it works without any problem, byt il I run it from the network it crashes at the moment of loading the mixed mode dll with a System.IO.LoadFileException. I know that the problem comes from the code access security policy and that's not my question :) In fact as I know it's not possible to catch...
8
3137
by: =?Utf-8?B?TWFyaw==?= | last post by:
We've got a wierd failure happening on just one machine. One part of our product uses a 3rd party search implementation (dtSearch). DtSearch has a native core (dten600.dll), late-bound, and a managed wrapper (dtSearchNetApi2.dll). For reasons unknown our build and msi packaging process includes dtSearchNetApi2.dll but not dten600.dll in all packages, as well as a couple of assemblies that reference it, even though they are not used by...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10155
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.