473,403 Members | 2,222 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,403 software developers and data experts.

How to obtain assembly name in unmanaged call?

Hi Expert,

Is there a way to obtain assembly name in an unmanaged call? During Interop
call between managed to unmanaged, I would like to know in unmanaged code
about the caller of assembly file name?

Thanks,
GP.
Jul 21 '05 #1
4 2007
Hello GP,
Perhaps you may get the assebmly name on the managed side, then pass it by
one public method to the unmanaged side.

"Gnanaprakash Rathinam" <gn*******************@oracle.com> дÈëÏûÏ¢ÐÂÎÅ
:8X************@news.oracle.com...
Hi Expert,

Is there a way to obtain assembly name in an unmanaged call? During Interop call between managed to unmanaged, I would like to know in unmanaged code
about the caller of assembly file name?

Thanks,
GP.

Jul 21 '05 #2
Hi GP,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get the name of an Assembly
in an unmanaged call. If there is any misunderstanding, please feel free to
let me know.

As far as I know, there isn't a direct way for us to get the Assembly name
in unmanaged code. However, we can get it easily in managed call. So we can
try to write a managed method which returns the name of the assembly and
interop with this assembly. You can use tlbexp.exe to export the type
library. Here is some more information.

http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrfTypeLibraryExporterTlbExpexe.asp

We have to use a COM client to call the exported library. A win32 call
isn't suitable.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Thanks for your reply,

But the problem here is different, due to some valid reason I can't modify
the signature of unmanaged call, In my appdomain there may be more than one
or more assemblies loaded and each may try to call unmanaged function
concurrently and based on the caller of the assembly I need to perform some
operation in my unmanaged function. I know that using managed & unmanaged
call stack trace I can retrieve the assembly name, but this is very lengthy
procedure. I looking for more easy way to do the same!!!

-GP
"Alan" <li***@channel.com> wrote in message
news:OJ**************@TK2MSFTNGP15.phx.gbl...
Hello GP,
Perhaps you may get the assebmly name on the managed side, then pass it by
one public method to the unmanaged side.

"Gnanaprakash Rathinam" <gn*******************@oracle.com> дÈëÏûÏ¢ÐÂÎÅ
:8X************@news.oracle.com...
Hi Expert,

Is there a way to obtain assembly name in an unmanaged call? During

Interop
call between managed to unmanaged, I would like to know in unmanaged code about the caller of assembly file name?

Thanks,
GP.


Jul 21 '05 #4
If you cannot add an argument to the method signature to identify the caller
then you are left with walking the stack to determine the caller. This is
expensive (i.e. non-performant) but if it is your only option, there you
are. You can cache the results so that further calls can be quickly looked
up.

Your best solution is to modify the unmanaged call signature.

"Gnanaprakash Rathinam" <gn*******************@oracle.com> wrote in message
news:_k*************@news.oracle.com...
Thanks for your reply,

But the problem here is different, due to some valid reason I can't modify
the signature of unmanaged call, In my appdomain there may be more than
one
or more assemblies loaded and each may try to call unmanaged function
concurrently and based on the caller of the assembly I need to perform
some
operation in my unmanaged function. I know that using managed & unmanaged
call stack trace I can retrieve the assembly name, but this is very
lengthy
procedure. I looking for more easy way to do the same!!!

-GP
"Alan" <li***@channel.com> wrote in message
news:OJ**************@TK2MSFTNGP15.phx.gbl...
Hello GP,
Perhaps you may get the assebmly name on the managed side, then pass it
by
one public method to the unmanaged side.

"Gnanaprakash Rathinam" <gn*******************@oracle.com> дÈëÏûÏ¢ÐÂÎÅ
:8X************@news.oracle.com...
> Hi Expert,
>
> Is there a way to obtain assembly name in an unmanaged call? During

Interop
> call between managed to unmanaged, I would like to know in unmanaged code > about the caller of assembly file name?
>
> Thanks,
> GP.
>
>



Jul 21 '05 #5

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

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
14
by: Teis Draiby | last post by:
I am about to move my C++ application to C#. Parts of my previous application consisted of inline SSE2 assembly code optimized for the P4 processor. What options do I have to integrate that part...
3
by: Gnanaprakash Rathinam | last post by:
Hi Expert, Is there a way to obtain assembly name in an unmanaged call? During Interop call between managed to unmanaged, I would like to know in unmanaged code about the caller of assembly file...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
5
by: Julie | last post by:
I'm currently working in a mixed mode project where the exe is C#, there is a managed C++ (DLL) assembly, that in part, includes some calls into a native (unmamanged) DLL. I can build/link/run...
5
by: OneFang | last post by:
Hi I hope I make sense here. I want to be able to obtain the name of the method that calls a method within my class. So If I have my class that has a method LogInfo() And my client code...
0
by: DPR | last post by:
Hi, I've recognized that a mixed assembly with unmanaged exports and an unmanaged "DllMain" can't be unloaded from a (unmanaged) process, even if it's no longer needed and the (unmanaged)...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
2
by: ME | last post by:
How would one obtain the parameter VALUES of a method that has already run? I can find the method using the StackTrace and StackFrame classes but once I find the method I would like to obtain the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.