PC Review


Reply
Thread Tools Rate Thread

Custom Component

 
 
Fred Chen
Guest
Posts: n/a
 
      13th Aug 2003
Hi,

I've created a custom component.

I would like my component to reference the runtime assembly when it is
added to a form. (The reason for this is because my component in the
design-time assembly is derived from the Component class, and I don't
want to expose that class to the user)

For the CompactFramework you can use the RuntimeAssemblyAttribute in
System.CF.Design.

Is there a simular attribute that is that can be used in the full
Framework?

Thanks,
Fred
 
Reply With Quote
 
 
 
 
Richard Grimes [MVP]
Guest
Posts: n/a
 
      13th Aug 2003
Fred Chen wrote:
> I would like my component to reference the runtime assembly when it is
> added to a form. (The reason for this is because my component in the
> design-time assembly is derived from the Component class, and I don't
> want to expose that class to the user)


I don't understand, your component at runtime should also derive from
Component, otherwise it is not a component! If you don't derive from
Component you don't get features that the runtime container and the control
need (for example Dispose()).

Your control can behave differently at designtime and runtime by checking
the Component.DesignMode property. For example, at runtime your component
could access a remote machine, but at design time it could simulate the
connection.

> For the CompactFramework you can use the RuntimeAssemblyAttribute in
> System.CF.Design.


The reason for this is that the compact framework is a totally different
framework to the desktop version, so you need two versions of the control:
one that the compact framework will accept so you can test the component on
the actual smart device; the other version is used in the designer which
cannot use the compact framework version because it runs on the desktop.

> Is there a simular attribute that is that can be used in the full
> Framework?


not that I know of, but then again, I don't understand that there is a
reason for it

Richard
--
my email (E-Mail Removed) is encrypted with ROT13 (www.rot13.org)


 
Reply With Quote
 
Fred Chen
Guest
Posts: n/a
 
      13th Aug 2003




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Fred Chen
Guest
Posts: n/a
 
      13th Aug 2003


Hi Richard,

Thanks for your quick response.

I need to reference a runtime assembly because my component uses the DTE
object to initialize properites in the component using the current
project's properties (the project it is being added to).

When I run a test application that uses my component, I get an exception
saying I can't reference the current DTE object.

When I remove the designer assembly from the reference list, after
adding the component, and add the runtime assembly the test application
works fine.

The runtime assembly is the designtime assembly with the code that uses
the DTE object removed.

This is why I need to use designtime and runtime assemblies.

Any ideas on how to add the runtime assembly instead of the designtime
assembly to the reference list?

Thanks,
Fred



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
The system has called a custom component and that component has failed and generated an exception. lil_miss_sassy_girl@yahoo.com Microsoft Windows 2000 Developer 0 31st Jan 2005 05:23 PM
The system has called a custom component and that component has .. =?Utf-8?B?QW1pdCBCaGF0bmFnYXI=?= Microsoft Windows 2000 Advanced Server 2 17th Aug 2004 06:47 AM
Custom Component Fred Chen Microsoft Dot NET Compact Framework 3 2nd Sep 2003 11:58 PM
RE: Custom Component David So [MSFT] Microsoft Dot NET Compact Framework 0 15th Aug 2003 06:13 AM
Re: Custom Component Neil Enns [MSFT] Microsoft Dot NET Compact Framework 1 15th Aug 2003 02:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:53 AM.