Hi,
I have read article of hosting ActiveX control. It is really good. I will be glad if help me a little to figure out of an error.
Basic information:
1.Smart device application(Pocket PC 2003 SE ) Emulator 2.0 and Target device.
2.Visual studio 2005 (released version)
3..Net Compact Framework 2.0
4..Net Framework 2.0
5.c#, ActiveX control
I have an ActiveX control for video playback which is implemented on Desktop application, is working fine.
My project is now to incorporate that ActiveX control to the device and playing video file. According to the following site i followed every steps.
http://msdn2.microsoft.com/en-us/library/aa446515.aspx. Title is "Hosting ActiveX Controls in the .NET Compact Framework 2.0" . I ran the following command line, AxImp.exe C:\TestActiveX\MediaDBPlayback.dll /source, it produces three files:
* MEDIADBPLAYBACKLib.dll
* AxMEDIADBPLAYBACKLib.cs
* AxMEDIADBPLAYBACKLib.dll
I added AxMEDIADBPLAYBACKLib.cs file under project and also added reference MEDIADBPLAYBACKLib.dll except AxMEDIADBPLAYBACKLib.dll because it was mentioned on the articles.
To resolve following errors
1. "The type or namespace name 'AxHost' does not exist in the namespace 'System.Windows.Forms'"
2.The type or namespace name 'DesignerSerializationVisibility' does not exist in the namespace 'System.ComponentModel' etc.
i added reference some Dlls such as "System.dll", "System.Drawing.dll" "System.Windows.Forms.dll" under "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\" path.
It was necessary to create Strong Name key i also did. After build my solution according to my class name i got "MyMediaControl.dll" dll file. I also registered this dll file as "regasm MyMediaControl.dll /codebase". But it does not install to GAC.
After doing everything i have seen my control to the Toolbox. I Dragged and Dropped to my Emulator Window it showed. But when i build my solution i am facing an error.
The type 'System.Windows.Forms.AxHost' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
i tried to solve this error with the help of internet but i failed to figure out the exact reason.
If you tell me reason it would really help. I will be waiting for you valuable reply.
It is too essential because of my delivery of product.
Regards
Morshed