PC Review


Reply
Thread Tools Rate Thread

COM Exception 8001010d

 
 
Anders Eriksson
Guest
Posts: n/a
 
      25th Feb 2011
I'm using WM_COPYDATA to send a string from one program to an other.
In the receiving program I have to override WndProc, see code below. In
WndProc I need to call a button_click function that does a call on a COM
server.

This results in a COMException: 8001010d, See below for full exception.

According to some threads I have found using Google, the problem is that
WndProc is using COM and therefore I can't call a COM server from WndProc.

Anyone that has an idea on how to solve this?

// Anders

Exception:

System.Runtime.InteropServices.COMException was unhandled
Message="Hämtningen av COM-klassfabriken för komponenten med CLSID
{14660C3E-3CF7-4CA5-9B32-913F3DD6F19F} misslyckades på grund av följande
fel: 8001010d."
Source="DCMarkerLib"
ErrorCode=-2147417843
StackTrace:
vid DCMarkerLib.LEngine.CreateDocument(Dictionary`2 dict,
DocsType type) i C:\Users\ame\Documents\Visual Studio
2008\Projects\SandvikCoromant\DCMarker\DCMarkerLib\LEngine.cs:rad 460
vid DCMarkerLib.LEngine.CreateImage(Dictionary`2 dict, String
id) i C:\Users\ame\Documents\Visual Studio
2008\Projects\SandvikCoromant\DCMarker\DCMarkerLib\LEngine.cs:rad 854
vid DCMarkerLib.Job.CreateImage(Dictionary`2 dict, Int32 block)
i C:\Users\ame\Documents\Visual Studio
2008\Projects\SandvikCoromant\DCMarker\DCMarkerLib\Job.cs:rad 259
vid DCMarkerLib.Job.Parse() i C:\Users\ame\Documents\Visual
Studio 2008\Projects\SandvikCoromant\DCMarker\DCMarkerLib\Job.cs:rad 133
vid DCMarker.Form1.button1_Click(Object sender, EventArgs e) i
C:\Users\ame\Documents\Visual Studio
2008\Projects\SandvikCoromant\DCMarker\DCMarker\Form1.cs:rad 91
vid System.Windows.Forms.Control.OnClick(EventArgs e)
vid System.Windows.Forms.Button.OnClick(EventArgs e)
vid System.Windows.Forms.Button.PerformClick()
vid DCMarker.Form1.loadBtnfnc() i C:\Users\ame\Documents\Visual
Studio 2008\Projects\SandvikCoromant\DCMarker\DCMarker\Form1.cs:rad 39
vid DCMarker.Form1.WndProc(Message& m) i
C:\Users\ame\Documents\Visual Studio
2008\Projects\SandvikCoromant\DCMarker\DCMarker\Form1.cs:rad 55
vid
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
vid
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
vid System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
vid System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG&
msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove)
vid
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
vid
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
vid
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
vid System.Windows.Forms.Application.Run(Form mainForm)
vid DCMarker.Program.Main() i C:\Users\ame\Documents\Visual
Studio 2008\Projects\SandvikCoromant\DCMarker\DCMarker\Program.cs:rad 32
vid System.AppDomain._nExecuteAssembly(Assembly assembly,
String[] args)
vid System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
vid
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
vid System.Threading.ThreadHelper.ThreadStart_Context(Object state)
vid System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
vid System.Threading.ThreadHelper.ThreadStart()
InnerException:


CODE:
private delegate void loadBtn();

private void loadBtnfnc()
{
button1.PerformClick();
}

protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_COPYDATA:
Win32.CopyDataStruct CD =
(Win32.CopyDataStruct)m.GetLParam(typeof(Win32.CopyDataStruct));
string strData =
System.Runtime.InteropServices.Marshal.PtrToStringAuto(CD.lpData);

textBox1.Text = strData;
textBox1.Refresh();

// load job file
loadBtn x = loadBtnfnc;
x();
break;

default:
// let the base class deal with it
base.WndProc(ref m);
break;
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs Microsoft ASP .NET 1 16th Nov 2007 05:57 PM
the exception unknown software exception (0x0eedfade) occured in the application at location 0x7c81eb33 mohammed.haseeb@gmail.com Windows XP Internet Explorer 1 25th Jul 2006 10:53 PM
The exception unknown software exception (0xc0000409) occurred in the application at location 0x00000000. Lars-Erik Aabech Microsoft ASP .NET 5 11th Jul 2005 07:44 AM
Publish exception to Email in Exception Handling Exception Block =?Utf-8?B?ZW15?= Microsoft C# .NET 1 31st Mar 2005 12:45 PM
OL2002 error (8001010d)...? Kenneth Microsoft Outlook Discussion 1 3rd Dec 2004 01:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:22 PM.