By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,331 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,331 IT Pros & Developers. It's quick & easy.

Inherited form with DLLImport

P: n/a
I have a form that uses a C++ dll through DLLImport.

Then I created a new project and had Form1 inherit the DLL
form.

I can run it without problem, but I cannot open the
derrived form in the form designer because I get a
message "An exception occurred while trying to create an
instance of DLLForm.ControlForm. The exception was "Unable
to load DLL (TestDLL.dll).".

Is there a way to keep it from trying to load the DLL in
design mode, or a way to embed the DLL in the DLLForm so
it can load it?

What is the best way to handle the error?

Thanks,
Mike

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Is there a way to keep it from trying to load the DLL in
design mode,
It will not be loaded until you actually call one of its functions. So
if you can, avoid calling any of it's functions in design mode.

or a way to embed the DLL in the DLLForm so it can load it?


The runtime uses the LoadLibrary Win32 API function to load unmanaged
DLLs. If you read the MSDN docs for LoadLibrary it'll tell you where
the function looks to find the requested DLL.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.