473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 2139
Hi,
"Aks" <ak**************@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.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*********************@r2g2000cwb.googlegrou ps.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 "LoadLibrary" 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 "LoadLibrary" 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
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...
4
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. ...
2
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...
0
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...
3
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...
6
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...
0
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...
1
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...
8
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.