Exe calling a dll

B

Bnob

I have made a dll with VB.net, and this dll call a another dll.

Now i will test my dll in a exe program, always in vb.net.

It's working at the first execution of the exe. But when I regenerate
the exe, I can't. So I try to delete the exe in PPC, and I can't
because there a sharing violation with the exe and the two dlls.

Any idea ? What I must do in my code after calling the dll ?
 
C

Chris Tacke, eMVP

The EXE assembly is still loaded. Either you spawned a worker thread and
didn't kill it, or you've only minimized your Form.

-Chris
 
B

Bnob

Le 06.10.2004, Chris Tacke, eMVP a supposé :
The EXE assembly is still loaded. Either you spawned a worker thread and
didn't kill it, or you've only minimized your Form.

-Chris

When I exit from my exe, I do a me.close. My exe is not running in the
memory.

In my dll I do a System.Threading.Thread.Sleep(200), but I don't kill
the thread.
If I must kill it, how can i do this?
 
D

Dick Grier

Hi,

The way that I kill a thread is to have the thread process monitor a flag
that I set when I exit the app (Closing event). If this flag is set, then I
exit the thread.

You also can use the Abort method in the threading extensions in
www.opennetcf.org.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top