Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

.Net 2.0 Com Error loading type library/DLL

rlcrlc Posts: 448Member
I have a thread which contains several COM objects from a third party. Most of the objects get created correctly, however one does not get created correctly in a specific instance. The thread can be called in two locations in my main service.

1) a MSMQ message is received, and a loop on main serivce calls a class on the main serivce, it then calls the thread. (this one works fine)

2) a class which contains a filesystemwatch processes a file and calls the thread (the instance of this class is a member of main service, this method does not work)

The error and stack calls are below... interesting enough while in debug if I enter the createobject call in the watch screen it works!! even at same part where the exception occurs.... This leads me to believe that somehow the scope is different, or thread access, or something ... I will note this exact code works fine in .Net 1.1 Any ideas would be appreciated.

~rlc


Exception:

Unable to cast COM object of type 'System.__ComObject' to interface type 'LTRASTERIOLib.ILEADRasterIO'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00140710-B1BA-11CE-ABC6-F5B2E79D9E3F}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
________________________________________________

Stack on error:
> UltraService.exe!UltraService.Global.CreateIRasterIO() Line 1005 + 0x26 bytes Basic

UltraService.exe!UltraService.CommSCPProcessThread.New(String vStudyUID = "1.2.840.113619.2.1.1.2703937184.671.1146331407.828", String() vFolderName = {Length=1}, Boolean vIsFromSentinal = True, Integer vSCPThread = 2) Line 22251 + 0x9 bytes Basic

UltraService.exe!UltraService.Sentinal.ProcessAllFiles() Line 246 + 0x22 bytes Basic

UltraService.exe!UltraService.Sentinal.CheckWaitLoop(Object sender = {System.Timers.Timer}, System.Timers.ElapsedEventArgs e = {System.Timers.ElapsedEventArgs}) Line 83 + 0xa bytes Basic

[External Code]
____________________________________________--
Stack normal(after the call was successful):
> UltraService.exe!UltraService.Global.CreateIRasterIO() Line 1012 Basic

UltraService.exe!UltraService.CommSCPProcessThread.New(String vStudyUID = "1.2.840.113619.2.55.1.1762927365.1893.1150893457.249", String() vFolderName = {Length=1}, Boolean vIsFromSentinal = False, Integer vSCPThread = 4) Line 22251 + 0x9 bytes Basic

UltraService.exe!UltraService.Communication.StudyRecieved(String studyUID = "1.2.840.113619.2.55.1.1762927365.1893.1150893457.249", String() vFolderName = {Length=1}) Line 11159 + 0x21 bytes Basic
UltraService.exe!UltraService.Communication.ULTCloseConnection(Integer hNet = 58371680) Line 13708 + 0x3a bytes Basic
UltraService.exe!UltraService.Communication.m_dcmInet_NetReceiveReleaseRequest(Integer hNet = 58371680) Line 15162 + 0xe bytes Basic

[External Code]

Comments

  • DrMartenDrMarten Posts: 748Member
    : I have a thread which contains several COM objects from a third party. Most of the objects get created correctly, however one does not get created correctly in a specific instance. The thread can be called in two locations in my main service.
    :
    : 1) a MSMQ message is received, and a loop on main serivce calls a class on the main serivce, it then calls the thread. (this one works fine)
    :
    : 2) a class which contains a filesystemwatch processes a file and calls the thread (the instance of this class is a member of main service, this method does not work)
    :
    : The error and stack calls are below... interesting enough while in debug if I enter the createobject call in the watch screen it works!! even at same part where the exception occurs.... This leads me to believe that somehow the scope is different, or thread access, or something ... I will note this exact code works fine in .Net 1.1 Any ideas would be appreciated.
    :
    : ~rlc
    :
    :
    : Exception:
    :
    : Unable to cast COM object of type 'System.__ComObject' to interface type 'LTRASTERIOLib.ILEADRasterIO'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00140710-B1BA-11CE-ABC6-F5B2E79D9E3F}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
    : ________________________________________________
    :
    : Stack on error:
    : > UltraService.exe!UltraService.Global.CreateIRasterIO() Line 1005 + 0x26 bytes Basic
    :
    : UltraService.exe!UltraService.CommSCPProcessThread.New(String vStudyUID = "1.2.840.113619.2.1.1.2703937184.671.1146331407.828", String() vFolderName = {Length=1}, Boolean vIsFromSentinal = True, Integer vSCPThread = 2) Line 22251 + 0x9 bytes Basic
    :
    : UltraService.exe!UltraService.Sentinal.ProcessAllFiles() Line 246 + 0x22 bytes Basic
    :
    : UltraService.exe!UltraService.Sentinal.CheckWaitLoop(Object sender = {System.Timers.Timer}, System.Timers.ElapsedEventArgs e = {System.Timers.ElapsedEventArgs}) Line 83 + 0xa bytes Basic
    :
    : [External Code]
    : ____________________________________________--
    : Stack normal(after the call was successful):
    : > UltraService.exe!UltraService.Global.CreateIRasterIO() Line 1012 Basic
    :
    : UltraService.exe!UltraService.CommSCPProcessThread.New(String vStudyUID = "1.2.840.113619.2.55.1.1762927365.1893.1150893457.249", String() vFolderName = {Length=1}, Boolean vIsFromSentinal = False, Integer vSCPThread = 4) Line 22251 + 0x9 bytes Basic
    :
    : UltraService.exe!UltraService.Communication.StudyRecieved(String studyUID = "1.2.840.113619.2.55.1.1762927365.1893.1150893457.249", String() vFolderName = {Length=1}) Line 11159 + 0x21 bytes Basic
    : UltraService.exe!UltraService.Communication.ULTCloseConnection(Integer hNet = 58371680) Line 13708 + 0x3a bytes Basic
    : UltraService.exe!UltraService.Communication.m_dcmInet_NetReceiveReleaseRequest(Integer hNet = 58371680) Line 15162 + 0xe bytes Basic
    :
    : [External Code]

    _____________________________________________________________________

    Hi,

    Try putting a copy of the DLL file within the BIN folder of your
    solution/project or put the full file path into the part
    of your code which references it.

    Regards,

    Dr M.


  • rlcrlc Posts: 448Member
    [b][red]This message was edited by rlc at 2006-8-15 9:8:13[/red][/b][hr]
    Yes, indeed the first thing I did was remove the reference and temp files, re-register the com object and reference it again. The strange part is the code still works fine when called in one part of my application, and from the debugger as well... and it all works fine with .net 1.1. I am aware of some changes the .Net framework has made to the COM integration, but nothing specific to this... The other weird thing is the other 3 objects which are from the same third party work fine in both locations. They use the same creation method for all objects..

    ~rlc


  • rlcrlc Posts: 448Member
    I have narrowed this down considerably today... The problem is apparently related to fact that the second method starts when a FSW catches an event. There must be something that has changed in how this handled... more to come.

    ~rlc
Sign In or Register to comment.