Jump to content

Help with unmanaged Code

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Saniza007

Saniza007

    Newbie

  • Members
  • Pip
  • 1 posts
Can Somebody suggest me how can I get rid of unmanaged code errror .I am converting excel input file to the output text file and I need to use lots of function with Byval and now I am getting error of Context switch Deadlock and I do not have any idea how do I overcome it.

Error

ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context 0x554fe8 to COM context 0x555158 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
What does your code look like, how are you implementing it, are you using libraries for this?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.