Link to home
Start Free TrialLog in
Avatar of pleasure
pleasure

asked on

How to keep dll loaded?

hi experts,
I'm using VC++ 6.0 to write a dll as wrapper class to allow my java program to interact with crystal report. I managed to preview the report but the preview screen just dispapear once the dll is unloaded, at the moment i need to display a modal dialog box in order the make the preview screen alive. So my question is, how can i keep the dll loaded or in other word, make the preview screen displayed until i hit the close button..

cheers..
Avatar of Chase707
Chase707

The DLL should stay loaded until all process have stopped using it.  I'm not familiar with using COM in java, but the DLL normally will be unloaded automatically by windows after the last referencing process has called Release.   So somehow you are Releasing your reference to the DLL in Java before you are done using it.

Chase707
Avatar of DanRollins
The answer is to not unload the DLL until you are finished with it.

Why are you unloading it now?

An alternative might be to take a 'snapshot' of the report as a BMP.  That would make sense if it is a graphic like a pie chart or something.

-- Dan
ASKER CERTIFIED SOLUTION
Avatar of thegroup
thegroup

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi thegroup,
Welcome to EE!  The experts in this section have agreed to post Comments rather than Answers.  This prevents the question from getting 'locked' which makes it more likely that the Asker will recieve exactly the kind of help needed.  In this case, there is still a lot that needs to be explained about the question before anyone has any right to post an Answer.  So, in the future, please post Comments like everybody else.  Thanks!
-- Dan
>> The experts in this section have agreed to post Comments rather than Answers.
Actually only some experts have.  

You are welcome to post an answer if your answer does answer the question and no one else has posted a previous answer in a comment.  (i.e. don't post an answer as an answer if other experts have already answered the question in comments.)

In this case the question is so unclear that its not clear that your answer really does answer the question and it largely duplicates answers previously posted by other experts, so it probably should have been a comment.
>>Actually only some experts have
Check the Locked Q's section of the C++ TA list and notice that *none* of the top experts are locking questions these days.  The only recent ones in there are this and another obvious newbie mistake.

>>so it probably should have been a comment.
At some point 'probably should be a comment' crosses the line into 'very definitely, without a doubt, hand-to-bible, really, really, really *must* be a comment' territory.  The thing is, the realm on the one side of that line is a couple of square microns while the other side is a few parsecs.

-- Dan
>> notice that *none* of the top experts are locking
>> questions these days.
Tnen that is what you should say.  What yous said was that all experts in the area have agreed not to answer questions.  That is not true.

And I assure you that not all the top experts agree.  This one doesn't!

>> At some point 'probably should be a comment' crosses
>> the line into 'very definitely, without a doubt,
I don't have the authority to tell someone that their post has to be a comment.  I can only make a suggestion.  They have to decide.
nietod,
>>All
Your word, not mine ...
>>This one doesn't
Ah, the exception that proves the rule!

There is a discusion going on the Expert Input section that you might want to join.  These things have been hashed and rehashed, but there is some actual possibility that coding changes are about to take place.  The concensus is that Answer Locking is bad and needs to be restricted or conceptually modified.  I'm sure you will want to air your opinion:

    http:Q.20304200.html

-- Dan
>> The experts in this section
"the experts"  That means all the experts.  

If I say would say "the comments from Dan are wrong"  does that botter you?  Certainly some comments are wrong, but that implies that all of them are wrong.
My phrasing was precise, in order leave some intentional ambiguity.  If I say "Seattle weather is rainy" there's room to interpret it as "always rainy" or "often rainy" or "usually rainy."   If the reader imagines rainfall 24/7/356, then it's his problem, not mine.

Anyway, if you said that, I'd assume you were referring to thread-local or recent comments.  If you add 'all' I'd broaden the scope, but even then I'd sensibly limit it to only comments posted here at EE.

-- Dan
"rainy" doesn't mean it rains all the time.  It specifically means it rains often.  

However "The experts in this section have agreed "  can't possibly be interpretted to mean "some" of the experts.  It says "the experts".   It means that if one is an expert in this section they have agreed to this.  Not all have.

>>It says "the experts".   It means that if one is an
>>expert in this section they have agreed to this.  Not
>>all have.

If I say the people voted George Bush in office, it doesn't mean all the voters.  It's implied to mean that the majority voted George Bush in office.  More over, in actuallity, not even the majority voted George Bush in office, but that's another topic.. :-) :-)

The point is, that the word "ALL" exist for a purpose.  It service to give a more defined meaning to communication.
With out it, the sentance is ambiguous, and can be interpret to mean ALL, MOST, or SOME.
Hi pleasure,
I think you forgot this question.
Can you please remove it from the LOCK Question list by either awarding the points to deserving expert, or rejecting the posted answer.

Thank you
"people voted for bush" means that some peeople did.    "the people voted for bush" means that they all did.   "The people" means ALL the people.  
>>"the people voted for bush" means that they all >>did.   "The people" means ALL the people.  
That's not true.  That's a very common expression, which I hear all the time.  Surely you don't think when someone saids that, that they actually mean ALL the people.
If you do believe that, then you're one of the few that does.
Most people know that "MOST" is implied in such a statement.

Just as if I said "The stars are bright."
That doesn't mean that all stars in the galaxcy are bright.

If you believe "THE" in front of a noun is the same as "ALL", then you're in the minority.
Most people know that "The Stars" and "All the Stars" are not the same.
Otherwise, there would be no purpose for the word "ALL"
Dear pleasure

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "DanRollins"

comment(s) as an answer since you never gave more feedback.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: https://www.experts-exchange.com/commspt/


PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Avatar of pleasure

ASKER

i had give up using this method..anyway..thanks all for the advice u all given..thanks..