Getting UNMANAGED stack trace in C#
-
Is it possible to get UNMANAGED stack trace in c#. Here is what I am trying to do: I have a COM written in c#. I have VB6/C++ code calling this COM component. In the COM component, I want to be able to find out who called the COM function(s). I have tried using the System.Diagnostics.StackTrace class, but that seems to only return MANAGED stack traces. For Example: COM Interface/Implementation
[Guid(###)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ISkel
{
[DispId(1)]
void DoSomething(int id);
}[Guid(###)]
[ClassInterface(ClassInterfaceType.None)]
public class Skel : ISkel
{
public void DoSomething(int id)
{
...
}
}VB (VBProject Name = VBProject1)
Private Sub Command1_Click()
dim s as new Skel
s.DoSomething(1)
End SubFrom the C# code, I want to get a value indication that the calling project (VBProject1) and the method (Command1_Click()) Any ideas/suggestions? Thanks in advance.
-
Is it possible to get UNMANAGED stack trace in c#. Here is what I am trying to do: I have a COM written in c#. I have VB6/C++ code calling this COM component. In the COM component, I want to be able to find out who called the COM function(s). I have tried using the System.Diagnostics.StackTrace class, but that seems to only return MANAGED stack traces. For Example: COM Interface/Implementation
[Guid(###)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ISkel
{
[DispId(1)]
void DoSomething(int id);
}[Guid(###)]
[ClassInterface(ClassInterfaceType.None)]
public class Skel : ISkel
{
public void DoSomething(int id)
{
...
}
}VB (VBProject Name = VBProject1)
Private Sub Command1_Click()
dim s as new Skel
s.DoSomething(1)
End SubFrom the C# code, I want to get a value indication that the calling project (VBProject1) and the method (Command1_Click()) Any ideas/suggestions? Thanks in advance.
AFAICT, the StackTrace will only work with managed calls. I can't find any method of getting the unmanaged stack trace from managed code.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Is it possible to get UNMANAGED stack trace in c#. Here is what I am trying to do: I have a COM written in c#. I have VB6/C++ code calling this COM component. In the COM component, I want to be able to find out who called the COM function(s). I have tried using the System.Diagnostics.StackTrace class, but that seems to only return MANAGED stack traces. For Example: COM Interface/Implementation
[Guid(###)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ISkel
{
[DispId(1)]
void DoSomething(int id);
}[Guid(###)]
[ClassInterface(ClassInterfaceType.None)]
public class Skel : ISkel
{
public void DoSomething(int id)
{
...
}
}VB (VBProject Name = VBProject1)
Private Sub Command1_Click()
dim s as new Skel
s.DoSomething(1)
End SubFrom the C# code, I want to get a value indication that the calling project (VBProject1) and the method (Command1_Click()) Any ideas/suggestions? Thanks in advance.