using COM object in .NET Compact Framework

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
i need to use COM object in my application running on Pocket PC 2003. I used
tlbimp utility to create clr assembly and added it into my project. But when
i try to create instance of COM object

BALSYSLib.BalSystemClass sys = new BALSYSLib.BalSystemClass();

InvalidOperationException is thrown. It is even thrown earlier then the
program reaches that line - propably JIT compiler throws it (it is thrown
while entering procedure containing that code).

I tried to use another COM object same way on PC and it works properly.

Thanks for any help or idea how to solve this problem
 
Michal,

Is the COM object installed on the machine that has the CF on it? If it
is not, then you need to install the COM object, as well as the assembly
generated.

Hope this helps.
 
The COM object is installed, generated assembly is not - it is just copied to
the same directory. I use Visual Studio .net 2003 it copied that assembly.
What i am suprised is that if i do the same thing on PC platform instad of
Pocket PC i works. Is it possible that it is some kind of bug in .NET Compact
Framework?




Nicholas Paldino said:
Michal,

Is the COM object installed on the machine that has the CF on it? If it
is not, then you need to install the COM object, as well as the assembly
generated.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Michal Rizek said:
Hi,
i need to use COM object in my application running on Pocket PC 2003. I
used
tlbimp utility to create clr assembly and added it into my project. But
when
i try to create instance of COM object

BALSYSLib.BalSystemClass sys = new BALSYSLib.BalSystemClass();

InvalidOperationException is thrown. It is even thrown earlier then the
program reaches that line - propably JIT compiler throws it (it is thrown
while entering procedure containing that code).

I tried to use another COM object same way on PC and it works properly.

Thanks for any help or idea how to solve this problem
 
Michal,

Ahh, looking around, the CF does not support full COM interop. Check
the section of MSDN titled "Writing Unmanaged Functions for Microsoft .NET
Compact Framework-based Applications", located at (watch for line wrap):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/unmanagedfuncs.asp

Also, when searching, I found this, which appears to offer full COM
interop for the CF (but I can't vouch for whether or not it works, it might
work for you):

http://whitepapers.zdnet.co.uk/0,39025945,60065442p-39000416q,00.htm


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Michal Rizek said:
The COM object is installed, generated assembly is not - it is just copied
to
the same directory. I use Visual Studio .net 2003 it copied that assembly.
What i am suprised is that if i do the same thing on PC platform instad of
Pocket PC i works. Is it possible that it is some kind of bug in .NET
Compact
Framework?




Nicholas Paldino said:
Michal,

Is the COM object installed on the machine that has the CF on it? If
it
is not, then you need to install the COM object, as well as the assembly
generated.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Michal Rizek said:
Hi,
i need to use COM object in my application running on Pocket PC 2003. I
used
tlbimp utility to create clr assembly and added it into my project. But
when
i try to create instance of COM object

BALSYSLib.BalSystemClass sys = new BALSYSLib.BalSystemClass();

InvalidOperationException is thrown. It is even thrown earlier then the
program reaches that line - propably JIT compiler throws it (it is
thrown
while entering procedure containing that code).

I tried to use another COM object same way on PC and it works properly.

Thanks for any help or idea how to solve this problem
 
Thanks a lot. I will check it out....

Nicholas Paldino said:
Michal,

Ahh, looking around, the CF does not support full COM interop. Check
the section of MSDN titled "Writing Unmanaged Functions for Microsoft .NET
Compact Framework-based Applications", located at (watch for line wrap):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/unmanagedfuncs.asp

Also, when searching, I found this, which appears to offer full COM
interop for the CF (but I can't vouch for whether or not it works, it might
work for you):

http://whitepapers.zdnet.co.uk/0,39025945,60065442p-39000416q,00.htm


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Michal Rizek said:
The COM object is installed, generated assembly is not - it is just copied
to
the same directory. I use Visual Studio .net 2003 it copied that assembly.
What i am suprised is that if i do the same thing on PC platform instad of
Pocket PC i works. Is it possible that it is some kind of bug in .NET
Compact
Framework?




Nicholas Paldino said:
Michal,

Is the COM object installed on the machine that has the CF on it? If
it
is not, then you need to install the COM object, as well as the assembly
generated.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,
i need to use COM object in my application running on Pocket PC 2003. I
used
tlbimp utility to create clr assembly and added it into my project. But
when
i try to create instance of COM object

BALSYSLib.BalSystemClass sys = new BALSYSLib.BalSystemClass();

InvalidOperationException is thrown. It is even thrown earlier then the
program reaches that line - propably JIT compiler throws it (it is
thrown
while entering procedure containing that code).

I tried to use another COM object same way on PC and it works properly.

Thanks for any help or idea how to solve this problem
 
You may also be interested in knowing that full COM Interop is supported in
the Whidbey CF.

--
Sam Gentile
Microsoft MVP - .NET/C#
INETA Speaker
CLR Blog: http://samgentile.com/blog
..NET Portal and Slides http://samgentile.com/

Michal Rizek said:
Thanks a lot. I will check it out....

Nicholas Paldino said:
Michal,

Ahh, looking around, the CF does not support full COM interop. Check
the section of MSDN titled "Writing Unmanaged Functions for Microsoft
.NET
Compact Framework-based Applications", located at (watch for line wrap):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/unmanagedfuncs.asp

Also, when searching, I found this, which appears to offer full COM
interop for the CF (but I can't vouch for whether or not it works, it
might
work for you):

http://whitepapers.zdnet.co.uk/0,39025945,60065442p-39000416q,00.htm


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Michal Rizek said:
The COM object is installed, generated assembly is not - it is just
copied
to
the same directory. I use Visual Studio .net 2003 it copied that
assembly.
What i am suprised is that if i do the same thing on PC platform instad
of
Pocket PC i works. Is it possible that it is some kind of bug in .NET
Compact
Framework?




:

Michal,

Is the COM object installed on the machine that has the CF on it?
If
it
is not, then you need to install the COM object, as well as the
assembly
generated.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

message
Hi,
i need to use COM object in my application running on Pocket PC
2003. I
used
tlbimp utility to create clr assembly and added it into my project.
But
when
i try to create instance of COM object

BALSYSLib.BalSystemClass sys = new BALSYSLib.BalSystemClass();

InvalidOperationException is thrown. It is even thrown earlier then
the
program reaches that line - propably JIT compiler throws it (it is
thrown
while entering procedure containing that code).

I tried to use another COM object same way on PC and it works
properly.

Thanks for any help or idea how to solve this problem
 
Back
Top