How to know whether a dll is in use

J

James Dow Allen

Advice on where you might get better answers is constructive.

Did you mention a specific ng that your experience shows
would be useful? (OP implied Windows' forums were unhelpful.)

I've seen suggestions to use ng's which were defunct or
useless, despite their appropriate-sounding names.

For example, if someone is looking for a discussion relating
religious fanaticism to Windows programming, I wouldn't
recommend talk.windoze, alt.similarities.limbaugh.islamists,
or even soc.american.idiots. Instead comp.lang.c would seem
to be the proper choice.

James
 
K

Kenny McCormack

Since there's no such thing as a "dll" on any of the platforms on which I
use C

[snip]

A simple "I don't know would suffice" or (better) silence.
You don't have to reply to every thread, you know, especially if you
all you're going to say is "I have nothing constructive to add."

Mr. Gowen: Welcome to CLC! Enjoy your stay...

I assume you are getting an idea of the kind of psychological damage
that CLC regs exhibit.
 
L

lawrence.jones

Antoninus Twink said:
I was going based on my experience a few years ago when I had to use
Windows to create a PDF. If you had the PDF open in Acroread and tried
to update the PDF, you couldn't actually overwrite it because Acroread
had the file locked. I was told by someone that Windows locks files open
for reading by default, so it's interesting to find out that actually
this insane misfeature was a conscious choice by the cretins who put
together Adobe's piece of crapware.

I think you misunderstood what you were told. A file opened for read
is, by default, locked against being opened *for write*, but can be
opened by other readers. Having the file you're reading change
underneath you can be very bad, particularly for a semi-binary format
like PDF, so it's a genuine feature, not a misfeature. Likewise, a file
opened for write is locked for both reading and writing by default since
reading a not yet fully written file can be equally bad and allowing
two processes to write the same file in an uncoordinated fashion is a
recipe for disaster.
 
S

Seebs

Did you mention a specific ng that your experience shows
would be useful? (OP implied Windows' forums were unhelpful.)

No, because my experience has shown that the most helpful way to handle
Windows issues is to run screaming.

-s
 
A

Antoninus Twink

Having the file you're reading change underneath you can be very bad,
particularly for a semi-binary format like PDF, so it's a genuine
feature, not a misfeature.

I really don't agree.

Here is a common work pattern: I'm creating a PDF file, reading through
on page 50 of the output, and I notice a typo. I fix it, recompile the
PDF and want to carry on reading.

In xpdf, I just leave the file open, the compiling overwrites it, xpdf
notices the file has changed and reloads it, putting me right back on
page 50 where I was before.

In acroread, I need to remember to close the file manually before
recompiling. Then I need to manually reopen it and manually navigate
back to page 50.

I know which behavior I consider a feature and which a misfeature.
 
A

Antoninus Twink

The interviews were a cross-section of the population while the poll
consisted only of those who felt strongly about the issue (about 54 %
of the population did vote).

The funny thing about democracy is that whenever governments ask the
people for their opinion in a referendum, they seldom like the answer
they get back.

For better or worse, the system is set up to favor governments who
plow on with their programs whether or not the governed agree with each
of the individual policies.
 
A

Antoninus Twink

not because they're against clc's religion but because they're outside
its topic range

Spurious distinction - for you and your lackeys, "topicality" *is* the
religion of clc.
 
L

lawrence.jones

Antoninus Twink said:
In xpdf, I just leave the file open, the compiling overwrites it, xpdf
notices the file has changed and reloads it, putting me right back on
page 50 where I was before.

In acroread, I need to remember to close the file manually before
recompiling. Then I need to manually reopen it and manually navigate
back to page 50.

I know which behavior I consider a feature and which a misfeature.

I agree with your characterization of the overall process, but the fault
is with acroread, not Windows's default locking. Without the default
locking, any change to the file would likely cause acroread to crash;
preventing that seems like a feature to me. It's acroread being a naive
application that's the misfeature.
 
R

robertwessel2

I really don't agree.

Here is a common work pattern: I'm creating a PDF file, reading through
on page 50 of the output, and I notice a typo. I fix it, recompile the
PDF and want to carry on reading.

In xpdf, I just leave the file open, the compiling overwrites it, xpdf
notices the file has changed and reloads it, putting me right back on
page 50 where I was before.

In acroread, I need to remember to close the file manually before
recompiling. Then I need to manually reopen it and manually navigate
back to page 50.

I know which behavior I consider a feature and which a misfeature.


Some of this happens because of the difference in the way Windows and
Unix treat files. In *nix the file exists until there are no more
links to in *and* no one has it open anymore. At that point the OS
deletes it. That makes it possible for an application to
"delete" (aka unlink) a file that another application has open - the
original application continues to access the "old" contents, which
will be retained until there are no references to it.

If the application then monitors the directory, it can see an update,
and then automatically do a close and reopen.

You can get similar behavior out of Windows, but you have to open the
file with FILE_SHARE_DELETE (NT Windows lineage only) to allow another
process to rename or delete the file. And of course an applications
could just not leave the file open (perhaps by loading it in its
entirety, or by copying it to a temporary area). Note that some
applications *do* support this sort of mechanism. Visual Studio, for
example, will notify you if the source file you have open has been
changed by someone else (at the point where you go to save it - it
would be nice if it was earlier).

I don't think either behavior is correct in all cases (locking the
file or permitting the file to be changed while an application has it
open), but my take is that locking the file is more likely the correct
behavior unless the application declares it doesn't care (although
clearly many more Windows applications *should* make such a
declaration). And there are plenty of annoying corner cases.
Consider the VS example: so I've changed the source file as has
someone else - now what?
 
N

Nick Keighley

Have lost all cognitive reasoning?
possibly

Are you drunk?
no

What the hell are you
talking about? "Most" is not a comparison at all.

"What do you respect most?" Implies some sort of set of entities which
some sort of ordering. "out of red, yellow and blue I like blue the
best". "I think mauve is the most suitable colour for your bedroom".

In order to ask the question "which do you respect most?" there must
be more than one entity in the discussion.
Maybe he meant "which of America and the American President which do
you resepect most?" or "out of all the physical objects in the entire
universe, which do you respect most?". I think he was trying to make a
political point but it passed me by.
 
N

Nick Keighley

[...]  The interviews were a
cross-section of the population while the poll consisted only of those
who felt strongly about the issue (about 54 % of the population did vote)..

where I come from that's called a high turnout
 
N

Nick Keighley

On  2 Dec 2009 at 12:25, Dik T. Winter wrote:

The funny thing about democracy is that whenever governments ask the
people for their opinion in a referendum, they seldom like the answer
they get back.

I like the Irish approach. keep asking the same question until they
get the right answer. Or the Italian appraoch where the question was
so convoluted that no one actaully knew what they were voting for.
For better or worse, the system is set up to favor governments who
plow on with their programs whether or not the governed agree with each
of the individual policies.

Switzerland (and California?) might disagree with you here. Maybe it's
the politician's that are wrong?
 
N

Nick Keighley

[...]  Visual Studio, for
example, will notify you if the source file you have open has been
changed by someone else (at the point where you go to save it - it
would be nice if it was earlier).

my version of Visual Studio does better than that. It tells me
"immediately". I have a text editor that manages a similar trick. I'd
assumed Windows had some "tell me if this file changes" facility.
 
G

gwowen

my version of Visual Studio does better than that. It tells me
"immediately". I have a text editor that manages a similar trick. I'd
assumed Windows had some "tell me if this file changes" facility.

It does. FindFirstChangeNotification(), FindNextChangeNotification(),
WaitForSingleObject and friends
 
J

James Dow Allen

.
I like the Irish approach. keep asking the same question until they
get the right answer. Or the Italian appraoch where the question was
so convoluted that no one actaully knew what they were voting for.

With polls, the person who phrases the question determines the
outcome. I ignore poll results that don't state the exact wording
of a question.

Another interesting thing about "democracy" is the peculiar faith
in the 50% threshold. I recall a poll some yearsa go where something
like 40% of Indians supported violence against Muslims but, 40% being
less than 50%, the headline was "Indians favor religious harmony."
.
Switzerland (and California?) might disagree with you here. Maybe it's
the politician's that are wrong?

I've often thought that legislators *listening* to voters was often
the cause of problems rather than *not listening*. In California,
a rather rich "country", schools and other public services have
deteriorated dramatically, and the State is on the verge of
bankruptcy.
Cutting taxes insanely is *not* something that legislative and
government professionals forced upon unwilling voters!

James
 
A

Antoninus Twink

"What do you respect most?" Implies some sort of set of entities which
some sort of ordering. "out of red, yellow and blue I like blue the
best". "I think mauve is the most suitable colour for your bedroom".

It seemed obvious to me that he meant "which particular qualities of
Obama do you respect especially?". In fact, I can't see how you could
read it any other way.
 
R

robertwessel2

[...]  Visual Studio, for
example, will notify you if the source file you have open has been
changed by someone else (at the point where you go to save it - it
would be nice if it was earlier).

my version of Visual Studio does better than that. It tells me
"immediately". I have a text editor that manages a similar trick. I'd
assumed Windows had some "tell me if this file changes" facility.


I thought it did too, but I when went to verify the behavior before
posting it didn't show the immediate change. I am using VS05 for some
stuff at the moment, so I may be seeing an older behavior.
 
A

Antoninus Twink

I thought it did too, but I when went to verify the behavior before
posting it didn't show the immediate change. I am using VS05 for some
stuff at the moment, so I may be seeing an older behavior.

Is the file on a local disk or a network mount?

I've experienced problems using Linux's dnotify (now inotify) system
over NFS - it's easy to imagine the Windows equivalent would have
similar difficultues.
 
R

robertwessel2

Is the file on a local disk or a network mount?

I've experienced problems using Linux's dnotify (now inotify) system
over NFS - it's easy to imagine the Windows equivalent would have
similar difficultues.


I tried both. As I mentioned, I was expecting the other behavior, and
I tried on a network drive first, then when it didn't happen, on a
local drive (especially given that the network drive in question is
NetWare, which always has a few quirks compared to a native Windows
share).
 

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

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top