Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / December 2004

Tip: Looking for answers? Try searching our database.

How to obtain assembly name in unmanaged call?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gnanaprakash Rathinam - 22 Dec 2004 09:01 GMT
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.
Alan - 22 Dec 2004 12:45 GMT
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" <gnanaprakash.rathinam@oracle.com> ????????????
:8Xayd.3$Tg5.67@news.oracle.com...
> Hi Expert,
[quoted text clipped - 5 lines]
> Thanks,
> GP.
Gnanaprakash Rathinam - 23 Dec 2004 05:59 GMT
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

> Hello GP,
> Perhaps you may get the assebmly name on the managed side, then pass it by
[quoted text clipped - 11 lines]
> > Thanks,
> > GP.
David Levine - 23 Dec 2004 11:14 GMT
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.

> Thanks for your reply,
>
[quoted text clipped - 28 lines]
>> > Thanks,
>> > GP.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.