The activation context being deactivated is not the most recently activated one.

S

Simon Jefferies

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:[email protected]
www.callofcthulhu.com www.deadlandsgame.com
-
 
J

Jeffrey Tan[MSFT]

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.
 
S

Simon Jefferies

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:[email protected]
www.callofcthulhu.com www.deadlandsgame.com
-
 
J

Jeffrey Tan[MSFT]

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.
 
J

Jeffrey Tan[MSFT]

Hi Simon,

Ok, I will wait for your reproduce project for this issue.

Thanks

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.
 
J

Jeffrey Tan[MSFT]

Hi Simon,

Do you still have concern on this issue? Please feel free to send me
reproduce project.

Thanks

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.
 
S

Simon Jefferies

Hello,

I've managed to recreate a project without using the C# DLL and don't seem
to be getting any problems. I will add the C# DLL to the project and try to
see what happens. I'll let you know if things work or not and will post here
shortly.

Thanks for your help,

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:[email protected]
www.callofcthulhu.com www.deadlandsgame.com
-
 
J

Jeffrey Tan[MSFT]

Hi Simon,

Ok, I will wait for your further feedback.

Thanks

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.
 
S

Simon Jefferies

Hello,

I've got as far as to put in the code to call the C# library, and its
fine...

one difference between this sample program and my original program is that
the listview DragDrop event is now being called? In the original program I
had to intercept it on the tab control (parent control), would this cause
this exception?

If not, is there anything I can try as I am a bit stumped :)

Regards
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:[email protected]
www.callofcthulhu.com www.deadlandsgame.com
-
 
J

Jeffrey Tan[MSFT]

Hi Simon,

Thanks for your feedback.

Sorry, I am not fully understand your statement. What does your "this
sample program" mean? I did not get any sample program. Also, I did not see
your "original program". So I did not understand your following statement
problem.

Can you show me your problem with some reproduce project or code snippet?

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.
 
J

Jeffrey Tan[MSFT]

Hi Simon,

Have you seen my reply? Is your problem resolved?

Please feel free to feedback. Thanks

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.
 
J

Jeffrey Tan[MSFT]

Hi Simon,

Thanks for your feedback.

I have seen your attached project. As you said, your application is a
VB.net project, which used an assembly AssetMan.dll writen in C#.

First, your project will connect to database, which I did not have the
environment. So when I run the project, I will get exception.

Can you provided me a reproduce project has no dependency? So that I can
reproduce your issue easily.

Also, there is no source code for AssetMan.dll, with the C# souce code for
this assembly, I think I can not find the cause for this issue. Can you
provide me some C# code snippet for it?

Thanks for your understanding.

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.
 
J

Jeffrey Tan[MSFT]

Hi Simon,

I have received your 2 attached projects.

For the main project "TestDragDropApp", I have succeeded run it without any
error or problem. I dragging a file from desk top to the listview, the
handler copied it into c:\temp, I could not reproduce the problem on my
system.

For your another C# library project "AssertMan", I see that it mainly
manipulate data with your database. As you may know, I did not have the
database environment, and I can not find out where is the problem.

Anyway, "TestDragDropApp" works well, is it because this project did not
call "AssertMan" library? Also, is your problem due to manipulate database
or populate data into the winform application?(I mean is your problem
WinForm control problem or Ado.net issue?)

Till now, I am much confused about your problem, I am not sure where your
problem is. I think you should concentrate your issue, find out the SMALL
code snippet that can reproduce your problem, then set up a project with
ONLY this small code snippet. I want it to be small code project, because I
want to discard the unnecessary code, so that we can focus on the KEY and
REAL problem.(Such as discard the database dependency etc..)

If you have the problem of find the small code snippet to reproduce the
problem, I think it would require intensive troubleshooting which would be
done quickly and effectively with direct assistance from a Microsoft
Support Professional through Microsoft Product Support Services. Then, you
may get one-by-one support from my colleague.

You can contact Microsoft Product Support directly to discuss additional
support options you may have available, by contacting us at 1-(800)936-5800
or by choosing one of the options listed at
http://support.microsoft.com/default.aspx?scid=sz;en-us;top.
If this is not an urgent issue and your would like us to create an incident
for you and have Microsoft Customer Service Representative contact you
directly, please send email to (remove "online." from this no Spam email
address): mailto:[email protected] with the following
information,
*Include "Followup: <Tomcat IssueID>" in the email Subject.
*Location of the post
*Subject Line
*First Name, Last Name
*MSDN Subscriber ID
*Company name (if any)
*Phone number
*e-mail address

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.
 
J

Jeffrey Tan[MSFT]

Hi Simon,

Have you seen my reply? Does it make sense to you?

Please feel free to feedback. Thanks

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.
 
S

Simon Jefferies

Hello,

Thanks for your reply,
Anyway, "TestDragDropApp" works well, is it because this project did not
call "AssertMan" library? Also, is your problem due to manipulate database
or populate data into the winform application?(I mean is your problem
WinForm control problem or Ado.net issue?)

Yes, I think the problem is when it calls the AssetMan library, but the
exception doesn't happen when I do call the AssetMan library from my sample
project. Its related to just my main project.
I think you should concentrate your issue, find out the SMALL
code snippet that can reproduce your problem, then set up a project with
ONLY this small code snippet. I want it to be small code project, because
I
want to discard the unnecessary code, so that we can focus on the KEY and
REAL problem.(Such as discard the database dependency etc..)

I was hoping with the small sample project it would break as well, but
unfortunately it didn't. So I need to sit down with my main project and to
strip out code to see where the problem lies.
If this is not an urgent issue and your would like us to create an
incident
for you and have Microsoft Customer Service Representative contact you
directly, please send email to (remove "online." from this no Spam email
address): mailto:[email protected] with the following
information,
*Include "Followup: <Tomcat IssueID>" in the email Subject.
*Location of the post
*Subject Line
*First Name, Last Name
*MSDN Subscriber ID
*Company name (if any)
*Phone number
*e-mail address

This isn't an urgent issue, although I'm worried that I may encounter this
problem in the future. I am considering an alternative in my project, but it
would be helpful to get this item resolved. So I will look into this matter
further with the support options you mentioned.

I'd like to thank you for your help,

Best Wishes
Simon Jefferies
Tools Programmer, Headfirst Productions
mailto:[email protected]
www.callofcthulhu.com www.deadlandsgame.com
-
"Jeffrey Tan[MSFT]" said:
Hi Simon,

I have received your 2 attached projects.

For the main project "TestDragDropApp", I have succeeded run it without
any
error or problem. I dragging a file from desk top to the listview, the
handler copied it into c:\temp, I could not reproduce the problem on my
system.

For your another C# library project "AssertMan", I see that it mainly
manipulate data with your database. As you may know, I did not have the
database environment, and I can not find out where is the problem.

Anyway, "TestDragDropApp" works well, is it because this project did not
call "AssertMan" library? Also, is your problem due to manipulate database
or populate data into the winform application?(I mean is your problem
WinForm control problem or Ado.net issue?)

Till now, I am much confused about your problem, I am not sure where your
problem is. I think you should concentrate your issue, find out the SMALL
code snippet that can reproduce your problem, then set up a project with
ONLY this small code snippet. I want it to be small code project, because
I
want to discard the unnecessary code, so that we can focus on the KEY and
REAL problem.(Such as discard the database dependency etc..)

If you have the problem of find the small code snippet to reproduce the
problem, I think it would require intensive troubleshooting which would be
done quickly and effectively with direct assistance from a Microsoft
Support Professional through Microsoft Product Support Services. Then, you
may get one-by-one support from my colleague.

You can contact Microsoft Product Support directly to discuss additional
support options you may have available, by contacting us at
1-(800)936-5800
or by choosing one of the options listed at
http://support.microsoft.com/default.aspx?scid=sz;en-us;top.
If this is not an urgent issue and your would like us to create an
incident
for you and have Microsoft Customer Service Representative contact you
directly, please send email to (remove "online." from this no Spam email
address): mailto:[email protected] with the following
information,
*Include "Followup: <Tomcat IssueID>" in the email Subject.
*Location of the post
*Subject Line
*First Name, Last Name
*MSDN Subscriber ID
*Company name (if any)
*Phone number
*e-mail address

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.
 
Top