It is not all that clear what you want to do. Which thread are you talking
about?
Both dialects of C++ (managed and unmanaged) have no trouble calling
functions of the Win32 API. In particular, calling GetUserName() and
LookupAccountName() might take you where you want to go.
Thank you for responding Will. Sorry for not offering more detail.
I have the following .NET C# code using .NET System.Security.Principal;
m_iIdnt = new System.Security.Principal.GenericIdentity(t.UserName,"custom
authentication");
m_iPrincipal = new
System.Security.Principal.GenericPrincipal(m_iIdnt,roles);
System.Threading.Thread.CurrentPrincipal=m_iPrincipal;
What I would like to do is access the Identity from what happened above, but
from a C++ app rather than the following .NET app;
Sure, you can expose your C# class as COM object and use COM interop,
question is why would you do that when simply calling the Win32 API's gives
you the same information.
Thanks Willy for helping me out here. One more outrageous question. Can I
access the .NET runtime thread using Win32 API's. (which contains the
Principal and Identity that I want) thx. -greg the newbie
Thanks Willy for helping me out here. One more outrageous question. Can I
access the .NET runtime thread using Win32 API's. (which contains the
Principal and Identity that I want) thx. -greg the newbie
<note>
I am not passing on your design strategy, simply answering the question that
you asked.
</note>
You can mix unmanaged C++ and Managed Extensions fro C++ (soon to be called
C++/CLI) in the same module. So one option is to have functions free
functions in an unmanaged module call on member functions in an MC++ class
which call on the requisite functions in your C# class. This works best when
you think in terms of interfaces. Don't think of sharing managed types with
unmanaged code.
The light bulb is beginning to flicker.
.... and I acknowledge there are larger design issues here, even if I don't
understand them yet.
I am still looking for keywords and keynote concepts in the answers to my
questions.
I realize I am not asking the right questions yet.
Is CLI common language interface?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.