473,387 Members | 1,476 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,387 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.
Nov 16 '05 #1
3 1478
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.

Nov 16 '05 #2
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.


Nov 16 '05 #3
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.
>
>



Nov 16 '05 #4

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

Similar topics

0
by: id | last post by:
Hi all, I was wondering if someone can shed some insight into this problem i'm having. I am decent with C++ but very new to managed C++. I have a managed c++ class library which wraps some...
1
by: Tom | last post by:
Given a path to an assembly in unmanaged code does anyone know of a way to load the assembly and enumerate out the types as strings using the mscorlib API? Thanks in advance Tom
4
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...
11
by: babuyama | last post by:
Hi, Is there a way to obtain library name at compile/preprocessor time? Assuming that the compilation unit, myfile.c is part of mylib.a, from myfile.c code at compile/preprocessor time, I would...
0
by: karunakar | last post by:
Hi All I am not able to read the class name I want read the particular class name string path = System.Configuration.ConfigurationSettings.AppSettings; string className = path + ".User";...
1
by: Ian Lazarus | last post by:
Hello, Project = class library dll implemented in C++ as a managed wrapper around an unmanaged class, and a small project to consume it (shown at bottom). Running the consumer code results in...
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: Gene Vangampelaere | last post by:
I have a webservice that provides a list with updates (Class SoftwareUpdate). The list is an ArrayList : Public Class SoftwareUpdates Inherits ArrayList My WebMethod looks like this : ...
6
by: Maguila007 | last post by:
Hi Is there any way to obtain the name of the function, inside the function which was called. Ex: function something() { alert( "The name of the function you invoke is " ......should
7
by: uncle | last post by:
config file that contains lines like... assemblyname|classname|methodname I want to invoke that static method. I found the following examples which make sense... Type theClass =...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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
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
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,...

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.