PC Review


Reply
Thread Tools Rate Thread

ActiveX control hosting using the concept of Alex Feinman

 
 
Frank
Guest
Posts: n/a
 
      10th Jan 2006
Hi,

I try to host an ActiveX control in a C# and a VB.NET application. I
try to use the concept of Alex Feinman, who has shown, how something
like that works with the windows media player control. The original
sample of Alex Feinman works fine. I try to change this sample so that
I can host my own ActiveX controls. I get several errors. I use AxImp
to get the source code for the wrapperclass of my ActiveX controls.
This file could not be compiled, because of two errors: The code line
System.ComponentModel.DefaultEvent is not valid and the code line
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")] is not valid.
I remove this two lines. Now I can compile my sample app. ( Was it
wrong to remove this two lines?)
Now I want to insert my control from the toolbar in a form of my app. I
got an error while doing this: "Failed to create 'MyControlCtrl'.
'System.InvalidCastException: Unable to cast object of type
'Microsoft.CompactFramework.UnsafeControl' to type
'System.Windows.Forms.AxHost'.
I solve this problem, but I can't remember how. Now I can build my app.
If I run my app on my device, I got an error in line 315 - 317 of
AxHost.cs ( protected virtual void ResizeControl() ) :
IOleWindow wnd = GetOcx() as IOleWindow;
IntPtr hwnd;
wnd.GetWindow(out hwnd);

The problem is that wnd is null. (The return value of GetOcx() is not
null, but GetOcx() as IOleWindow is null.)

How can I solve this problem. I don't think, that the ActiveX control I
want to host is the problem. I tried to host a dummy control, that does
not implement any methods/events, too. I tried to host the controls
with a modification of the original sample and with a new C# app and
with a new VB.nET app. Every time with the same errors.

Frank

 
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
PowerAwareApp by Alex Feinman andyw999-NO-SPAM-PLEASE-@hotmail.com Microsoft Dot NET Compact Framework 0 25th Oct 2006 10:41 AM
Alex Feinman DataGrid Example =?Utf-8?B?bW9iaWxlbW9iaWxl?= Microsoft Dot NET Compact Framework 2 26th Jul 2006 05:09 AM
ActiveX control hosting using the concept of Alex Feinman Frank Microsoft Dot NET Compact Framework 2 19th Dec 2005 12:33 PM
Windows Media Activex by Alex Feinman Noulouk Microsoft Dot NET Compact Framework 1 4th Oct 2005 05:53 PM
Windows Media Activex by Alex Feinman Noulouk Microsoft Dot NET Compact Framework 0 7th Jun 2005 09:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 PM.