Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Custom control using unmanaged dll
 

Custom control using unmanaged dll

hi all

I'm writing a C++ managed custom control as a wrapper for an unmanaged dll. It works perfectly at run time, but the VS form designer is unable to load it. I get the "Could not find type..." error when I open a form containing the control in the designer.

I *think* it's because it's failing to load the unmanaged dll. I have tried copying the unmanaged dll into the the assembly output directory and into the test application output directory but to no avail.

I have a minimal test case which demonstrates the problem, so I'm pretty sure there are no uncaught exceptions.

So my question is, how can I persuade the designer to load the dll?

On a side point, is there any way of getting more information about why VS is unable to load a custom control?

(I'm using VS 2005 SP1)

cheers!
Rob
small_wednesday  Tuesday, June 05, 2007 12:33 AM

Try copying it to your System32 folder.

Malacki  Tuesday, June 05, 2007 1:13 AM
yep, tried that too
small_wednesday  Tuesday, June 05, 2007 2:36 AM
Well that sucks. Is it perhaps dependant on another DLL you'd need to copy over as well?
Malacki  Tuesday, June 05, 2007 8:28 PM
no, I'm using a simple test dll with a single exported class and no dependencies.

I just tried rebuilding and copying the dll into system32, and now it works. Must have done something dumb before, like copied an out of date version.

But VS never seems to unload the dll - if I change the dll, (+ rebuild and copy into system32), voila broken again Sad Process explorer shows it's loaded by devenv.exe, even if I close the solution. This reminds me of VB development 10 years ago. The horror!




small_wednesday  Wednesday, June 06, 2007 1:46 AM

Yeah I've noticed that before, and not just with unmanaged DLLs. Just yesterday, acually, I had to exit / reload VS every time I made a change to a property editor :/

Malacki  Wednesday, June 06, 2007 2:17 AM

You can use google to search for other answers

Custom Search

More Threads

• Force UI of control to refresh on certain control property changed
• Create Popup Alert
• Duplicate component name 'iDKontaDataGridViewTextBoxColumn'. Component names must be unique and case-insensitive.
• Custom UITypeEditor not working for properties of type "System.Windows.Forms.Control"
• Display User Control while accessing data?
• doubt in c#
• How do I create a popup screen to modify the properties of a custom control at design time?
• \field command are deleting in RichTextBox
• Problem with visual inheritance
• Diagonal Labels