被停用的激活上下文不是最近激活的激活上下文。 [英] The activation context being deactivated is not the most recently activated one.

查看:107
本文介绍了被停用的激活上下文不是最近激活的激活上下文。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我得到了第一次机会异常激活上下文是

去激活不是最近激活的。之后又发生了另一个

异常

中出现未处理的类型

''System.Runtime.InteropServices.SEHException'' system.windows.forms.dll"。

我正在做的是从VB.Net中调用一个C#方法(在类库中)

DragDrop事件。


我尝试过使用代理,但这并没有什么区别。它成功执行了

操作,但是当进入主要的

消息循环时会发生异常。


任何想法会发生什么关于?


问候

Simon Jefferies

工具程序员,Headfirst Productions

mailto:si * ***@headfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com

-

Hello,

I am getting a First-chance exception "The activation context being
deactivated is not the most recently activated one." followed by another
exception straight afterwards "An unhandled exception of type
''System.Runtime.InteropServices.SEHException'' occurred in
system.windows.forms.dll".

What I''m doing is calling a C# methods (in a class library) from VB.Net in a
DragDrop event.

I''ve tried using delegates but this made no difference. It performs the
operation successfully, but the exceptions occur when enters the main
message loop.

Any ideas what is going on?

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@headfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com
-

推荐答案

嗨西蒙,


感谢您在此群组中发帖。


我发现此错误不是一般错误。你能粘贴一些代码

片段来重现这个问题吗?


我会等你的反馈。


感谢您的耐心与合作。如果您有任何疑问或

担忧,请随时将其发布在小组中。我正准备等待

的帮助。


祝你好运,

Jeffrey Tan

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有授予任何权利。

Hi Simon,

Thanks for posting in this group.

I found that this error is not a general error. Can you paste some code
snippet to reproduce out this issue?

I will wait for your feedback.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


您好,


感谢您的回复,


我注意到的一件事是,如果一个选项卡控件包含一个列表视图

控件,列表视图控件就无法接收DragDrop事件,选项卡

控制收到它。这里是代码片段:


\\\

Private Sub tabFileView_DragDrop(ByVal sender As Object,ByVal e As

System.Windows.Forms.DragEventArgs)处理tabFileView.DragDrop


如果是e.Data.GetDataPresent(DataFormats.FileDrop)那么

Dim FilesBeingDropped()As String

Dim Filename As String =""


''''''将文件分配给一个数组。

FilesBeingDropped = e.Data.GetData(DataFormats.FileDrop)


For FilesBeingDropped中的每个文件名


''''''将文件添加到选定的文件夹

AddFile(文件名)


下一页


e.Data.SetData(没什么)


结束如果


结束子

////


\\\

Public Delegate Sub Delegate_AddAssetFull(ByVal Filename As String)


Private Sub AddFile( ByVal Filename As Strin g)


'''''添加资产(相对路径)

Dim delAddAsset As New Delegate_AddAssetFull(AddressOf

AssetRepository .AddAssetFull)

delAddAsset(文件名)


结束子

///


AssetRepository类包含在一个C#库中,我已经尝试了直接调用它的
,但是我遇到了同样的问题。如果我注释掉调用AddFile()的行

就行了。


如果你需要任何额外的代码片段,我可以为你发帖子。


问候

Simon Jefferies

工具程序员,Headfirst Productions

mailto:si ** **@headfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com

-

" ;Jeffrey Tan [MSFT]"" <,V - ***** @ online.microsoft.com>在消息中写道

新闻:9R ************** @ cpmsftngxa10.phx.gbl ...
Hello,

Thanks for your reply,

One thing I have noticed is that if a tab control contains a list view
control, the list view control cannot receive the DragDrop event, the tab
control receives it. Here''s the snippet of code for this:

\\\
Private Sub tabFileView_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles tabFileView.DragDrop

If e.Data.GetDataPresent(DataFormats.FileDrop) Then

Dim FilesBeingDropped() As String
Dim Filename As String = ""

'''''' Assign the files to an array.
FilesBeingDropped = e.Data.GetData(DataFormats.FileDrop)

For Each Filename In FilesBeingDropped

'''''' add file to selected folder
AddFile(Filename)

Next

e.Data.SetData(Nothing)

End If

End Sub
////

\\\
Public Delegate Sub Delegate_AddAssetFull(ByVal Filename As String)

Private Sub AddFile(ByVal Filename As String)

'''''' add asset (relative path)
Dim delAddAsset As New Delegate_AddAssetFull(AddressOf
AssetRepository.AddAssetFull)
delAddAsset(Filename)

End Sub
///

The AssetRepository class is contained within a C# library, I''ve tried
calling this directly but I get the same problem. If I comment out the line
that calls AddFile() it works fine.

If you require any additional snippets of code, I can post them for you.

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:si****@headfirst.co.uk
www.callofcthulhu.com www.deadlandsgame.com
-
""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:9R**************@cpmsftngxa10.phx.gbl...
嗨西蒙,

感谢您在此论坛中发帖。

我发现此错误不是一般错误。您可以粘贴一些代码片段来重现这个问题吗?

我会等待您的反馈。

感谢您的耐心与合作。如果您有任何疑问或担忧,请随时在小组中发布。我很乐意帮助您。

致以最诚挚的问候,
Jeffrey Tan
Microsoft在线合作伙伴支持
获得安全保障! - www.microsoft.com/security
此帖子提供就像没有保证,也没有授予任何权利。
Hi Simon,

Thanks for posting in this group.

I found that this error is not a general error. Can you paste some code
snippet to reproduce out this issue?

I will wait for your feedback.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.



您好Simon,


非常感谢您的反馈。


正如您所说,在您评论AddFile之后方法,应用程序很好,但你没有为我粘贴代码。所以我无法重现它。


我建议你为我附上一个完整的小型复制项目,这样我就可以找到发生的事情。


感谢您的耐心与合作。如果您有任何疑问或

担忧,请随时将其发布在小组中。我正准备等待

的帮助。


祝你好运,

Jeffrey Tan

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有赋予任何权利。

Hi Simon,

Thanks very much for your feedback.

As you stated, after you comment "AddFile" method, the application works
well, but you did not paste the code for me. So I can not reproduct it.

I suggest you attach a fully and small reproduce project for me, so that I
can find what happened.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


这篇关于被停用的激活上下文不是最近激活的激活上下文。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆