?
Solved

Process problems. Active X .

Posted on 1999-12-16
7
Medium Priority
?
243 Views
Last Modified: 2013-11-25
When i test my activex component in
the ActiveX test container it leaves
the tstcon32 still running in the
processes. I can't get rid of that
and i don't know what i'm doing
wrong.

I was first thinking that i should lock my object so it has a strong lock. But i'm not sure if this works.

I have not done much to my project so i think it's better to tell how it is made:

MSVC++ 6.0
1. Atl Com appwizard. (everything default.)
2. New atl object->control>full control->add control based on->Listbox (every thing else is default)
3. Compile
4. Implement
::RegisterDragDrop(m_hWndList, (IDropTarget *) this);

Now the process is still in memory so that i manually must end the tstcon32 if i want to compile the program again.

5. Make my class derive from IDropTarget and add the pure virtual functions.

6. Create a destructor and add
RevokeDragDrop and DestroyWindow

What shall i do?

If you help me get rid of this problem i would be very happy.

Your sincerely
andla
0
Comment
Question by:andla
  • 5
7 Comments
 
LVL 1

Author Comment

by:andla
ID: 2288242
Edited text of question.
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 2290872
TstCon32 does not call DllCanUnloadNow() and it does not call CoFreeUnusedLibraries. But this isn't a big problem because Test Container is supposed to test a control and you should terminate it whenever you want to rebuild.

However, if you close Test Container and it doesn't terminate properly, then that is a different problem.
0
 
LVL 1

Author Comment

by:andla
ID: 2291167
I will check out the functions you mention. When i use the same control in iexplore i can't compile it. This error occurs.

LINK : fatal error LNK1168: cannot open Debug/dragtemp.dll for writing
Error executing link.exe.

Ok i can live with the problem for a time but later on i belive this will only give me problems.

Have you tried to create the program in the same way i did?

What do you suggest?

Your sincerely
andla
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 1

Author Comment

by:andla
ID: 2294673
I'm still stuck. :-(
0
 
LVL 1

Accepted Solution

by:
vlad44 earned 1600 total points
ID: 2310162
RegisterDragDrop calls AddRef() to IDropTarget. Make sure you call Release() for each AddRef().
For example:

class TDropTarget : public IDropTarget{
  ULONG m_ulRef;
public:
  TDropTarget(void):m_ulRef(1){}
....
};

after RegisterDragDrop() m_ulRef == 2, after RevokeDragDrop() m_ulRef == 1, then you need to call Release() once more.

0
 
LVL 1

Author Comment

by:andla
ID: 2362850
Sorry for taking long time. I'm still a beginner to this. I feel a bit ashame because i really can't call the Release() from the destructor. I got link errors all over my head. Please give me a hint.

Your sincerely andla.
0
 
LVL 1

Author Comment

by:andla
ID: 2362855
I tested the CoDisconnectObject and it also failed.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
How does storytelling impact the web? What goes into a great story on the web? And how can it be used for marketing purposes? All of these questions will be answered.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question