A
ashish
HI,
I have some question about using unmanaged 32 bit COM (C++) dll with
C# . We use Visual Studio 2005 to develop this C# dll on 64 bit
machine.
(1) When I call the C# dll built with ANY CPU option (which use the 32
bit COM (C++) dll) from C# console application (built with ANY CPU
option), it returns below error while I create new for 32 bit COM dll,
FYI, the ExOWAClient is C# dll where I add the reference for 32 bit
COM dll.
System.Runtime.InteropServices.COMException was unhandled
Message="Retrieving the COM class factory for component with CLSID
{5F56FA52-1A76-4776-B90A-24FF9030A1D4} failed due to the following
error: 80040154."
Source="ExOWAClient"
ErrorCode=-2147221164
StackTrace:
at ExOWAClient.ExRestoreShortcut.RestoreShortcutMessage(String
owaId, String emailAddress) in C:\Project2\ExOWAClient\ExOWAClient
\ExRestoreShortcut.cs:line 44
at TestOwaClient.Program.Main(String[] args) in C:
\Project2\OWAForm\TestOwaClient\TestOwaClient\Program.cs:line 12
at System.AppDomain.nExecuteAssembly(Assembly assembly,
String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I try P/invoke but it does not work with COM dll either.
There is a work around by building whole application with 32 bit
option (CPU), and it works for my testing enviornment, but it is NOT a
real option for me.
I have to build application using Any CPU (means 64 bit) by calling 32
bit COM dll.
Also, I can not build my 32 bit COM dll with 64 bit either due to some
reson.
I really appreciate your response.
I have some question about using unmanaged 32 bit COM (C++) dll with
C# . We use Visual Studio 2005 to develop this C# dll on 64 bit
machine.
(1) When I call the C# dll built with ANY CPU option (which use the 32
bit COM (C++) dll) from C# console application (built with ANY CPU
option), it returns below error while I create new for 32 bit COM dll,
FYI, the ExOWAClient is C# dll where I add the reference for 32 bit
COM dll.
System.Runtime.InteropServices.COMException was unhandled
Message="Retrieving the COM class factory for component with CLSID
{5F56FA52-1A76-4776-B90A-24FF9030A1D4} failed due to the following
error: 80040154."
Source="ExOWAClient"
ErrorCode=-2147221164
StackTrace:
at ExOWAClient.ExRestoreShortcut.RestoreShortcutMessage(String
owaId, String emailAddress) in C:\Project2\ExOWAClient\ExOWAClient
\ExRestoreShortcut.cs:line 44
at TestOwaClient.Program.Main(String[] args) in C:
\Project2\OWAForm\TestOwaClient\TestOwaClient\Program.cs:line 12
at System.AppDomain.nExecuteAssembly(Assembly assembly,
String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I try P/invoke but it does not work with COM dll either.
There is a work around by building whole application with 32 bit
option (CPU), and it works for my testing enviornment, but it is NOT a
real option for me.
I have to build application using Any CPU (means 64 bit) by calling 32
bit COM dll.
Also, I can not build my 32 bit COM dll with 64 bit either due to some
reson.
I really appreciate your response.