I am busy writing an setup program for my application. I am using some shell functions like SHGetSpecialFolderLocation to get Program files location. The problem is that this function requires a specific version of a shell dll to be present on the system. What do I do if I install the app on a older system like NT or 98 and the version of the system dll is old ? Is there a set of redistributable shell objects that will ensure the application work on all environments or is there another solution to this problem ?
I have a very strange error in my multithreaded application. The situation is as follows:
I have one dialog window open, this dialog spawns 2 threads (thread 2, thread 3] when it is initialized.
This thread spawns two other threads (thread 4, thread 5). After spawning those threads, it retrieves data from a buffer
The two other threads are identical and retrieve data from 2 diffenrent COMM ports and put the data in the buffer.
When data is successfully retrieved, it notifies thead 3.
Before shutting down, it notifies the monitor thread (3) and shuts down thread 4 and 5. It waits until the threads are cleaned up.
Its sole purpose is to monitor thread 2 and notify the dialog when data is arrived.
This thread cleans up itself after it recieved the notification that thread 2 is stopped.
[thread 3, thread 4]
These two threads retrieve data from two different COMM ports. The retrieved data is stored in a std::vector managed by thread 2.
You may think that I have too much thread for this purpose (2 would be enough for this type of work), but this is by design. The extra monitor thread is used because this is a test application. In the real application the monitor threads do some real work.
Now for the problem. Everything works like a charm, except when I try to stop thread 2. It actually manages to stop thread 3 and 4. After that, the thread is cleaned up (the thread 2 and 3 are gone in PView thread 2 not). But then, BANG the program crashes in the middle of the following function: AfxUnlockTempMaps at the following line: pThreadState->m_pSafetyPoolBuffer = malloc(pApp->m_nSafetyPoolSize);
The error message in the output window of VS2005 is:
Unhandled exception at 0x02845922 (dbghelp.dll) in TestInput.exe: 0xC0000005: Access violation reading location 0x0152070c.
The location is always the same and no pointer is even near that address...
I noticed that the problem does not occur when thread 3 and 4 stop sending data to the buffer of thread 2. Here are some code snippets:
The call where the data is added to the buffer of thread 2
I still don't know why the problem occurred, but it was in the dbghlp.dll library when the function CheckStack64 was called. This function call was made from within the Visual Leak Detector libray and without linking to that lib, everything works fine.
I am developing a marker application. Basically allows free-hand drawing with the mouse. When i draw a line, i want the window below also to visible. I am not able to create a transparent Pen for this? i tried BS_HOLLOW, but it doesn't draw at all.
It's slightly complicated in that you can overload operator new and operator delete but you can't overload the new and delete operators in the same sense as overloading, say '+'. The reason is that your overloaded
operator<code> new is only responsible for allocating memory, but someone must call the constructor, right? Same goes for delete, you can free memory, but someone must call the destructor. <br />
<font face="Verdana" size="1"><a href="http://blogs.wdevs.com/senthilkumar">My Blog</a> | <a href="http://www.codeproject.com/script/articles/list_articles.asp?userid=492196">My Articles</a> | <a href="http://geocities.com/win_macro">WinMacro</a></font>
I have a CListCtrl with report style. I want to programatically select the row of that list control. The row gets selected, but sometimes i need to manually scroll down in order to see the selection. What i want is that the selected row should automatically comes up in the view and there'll be no need to manually moving the vertical scrol bar. How can i do so ??
I have a tree control on a dialog bar and I add some nodes into the tree bar on right clicking the tree control.
My problem is when I right click a node, the particular node is selected and immediately the selection jumps to other nodes.
It behaves very peculiarly. The right click doesnt select the actual node instead the selection jumps to other nodes.
How do i prevent this from happening.
Thanx in advance.
Last Visit: 31-Dec-99 18:00 Last Update: 16-Sep-21 22:24