|
Is it possible to send for me TAPI source code.
|
|
|
|
|
|
Hello,
I was wondering, are the STL containers thread safe?
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
They are in a sense that you can safely access distinct containers from differnet threads (actually, even that is not true for the version that ships with VC 6.0). However, you need to take care of locking when accessing a container from different threads.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Thanks for your reply,
I guess that I don't have to remove the Lock() and Unlock() calls in my code .
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
|
Thanks,
I guess that I don't have to remove the Lock() and Unlock() calls in my code .
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hi
I am not able to put the icon size 8x8 on to the button, But the 16x16 and 32x32 are comming with the below code..
HICON hBtnIcon = ::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON2));
SendMessage(hWndCtrl, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hBtnIcon);
::ShowWindow(hWndCtrl, SW_SHOW);
Can I have solution form you?
Regards,
Murali.
|
|
|
|
|
I have a situation were i create dynamic objects and each of them use the
same class(and set of functions in it) to do certain task. To handle the
concurrency issues that may arise while calling same functions at a time -
what are the best solutions?
Is making the function Inline suitable in this scenario in any manner ?
U Live And Let Others Live
|
|
|
|
|
You could use a CCriticalSection to ensure that a method is synchronized. For example:
class CMyClass
{
public:
bool doSomething()
{
if (!m_cs.Lock())
return (false);
...
m_cs.Unlock();
return (true);
}
protected:
CCriticalSection m_cs;
} /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi!
I'm a fellow that has big problems on starting this next datastructure lab in c++ . I have so much in my mind right now and I don't know if I'm gonna complete this lab on time.
So i'm wondering if there are someone that could help me with this lab?
We use at the school visual studio 6.0
Here's the lab description:
A) Hash table
Now your going to make an article-storage were the articles will be saved in a hash-table for fast prompt accessible. For every article saves the information of the article-number, article-type and the amount articles in the storage.
You should be able to “hash” on the article-number( i.e article-number is the key). You should be able to ADD, SEEK and LIST the articles in the storage.
The programme shall handle collision with "Separate Chaining” i.e create linked list at collisions. You shall therefore make an array of pointers that initiate to NULL, afterward you should be able to seek and add articles that are missing.
At collision you do your linked list. Use here as said a linked list and a string class.
Remember when you add an article for the first time to the index, you have to move the NULL-pointer to point at the new post and then link the article last in the list.
If an article with that article-number already exist in the list, the numbers on the storage should increase on the one that already existed.
Does’nt the articlename correspond, then you could yourself decide how it’s gonna be solved in your programme.
Assume from these files(must use)
1. Hash.h
2. Hash.cpp
3. Article.h
B) Sorting
This task goes out on that you have to implement 3 optional sorting-algorithms. The algorithms shall be choosed so an algorithm works with O(n2), next with O(n log n) and the last one with O(n).
Write a programme that at random takes number-values to a file. This file shall be used as indata for sorting. After the sorting, shall the result be written out into a result-file. The result-file shall also be used as indata for sorting, to see how the algorithms works on the already sorted or almost sorted data ( if some values changes).
You shall have to create data-files with 5 different quantity of numbers to sort. These values shall be used as indata to respective algorithm. Run the algorithm with indata that is both sorted and unsorted.
You shall use these following numbers: 100 000, 200 000, 400 000, 800 000 and 1 600 000 values. Same computer must be used to check all values to have a more fair result and the computer may not work with other things during the process of the sorting.
Is it so that your computer makes the sorting too quick or too slow, you may have to change some numbers so you get a better result, NOTE that the quantity of the numbers shall double for each sorting.
Every algorithm shall have two variables, compare and swap, that counts how many comparision and copies of values has been made during the sort. These two variables shall be used in comparision between the different algorithms.
Registrate also the time the algorithms take when they are used, by using following class:
1. Timer.h
2. Timer.cpp
Do a table with your results that contains these facts:
• Run with an unsorted and a sorted data
• Values for compare and swap for respective run
• Time-consumption for respective run
Here comes the code for the following files.
1. Hash.h
<br />
#ifndef _HASH_H<br />
#define _HASH_H<br />
<br />
#include "LinkedList.h"<br />
<br />
class Hash<br />
{<br />
public:<br />
Hash();<br />
~Hash();<br />
<br />
private: <br />
const int TABLESIZE;<br />
LinkedList *m_table;<br />
};<br />
<br />
#endif<br />
2. Hash.cpp
<br />
#include "Hash.h"<br />
<br />
Hash::Hash() : TABLESIZE(11)<br />
{<br />
m_table = new LinkedList[TABLESIZE];<br />
}<br />
<br />
Hash::~Hash()<br />
{<br />
delete[] m_table;<br />
}<br />
3. Article.h
<br />
#ifndef _ARTICLE_H<br />
#define _ARTICLE_H<br />
<br />
#include "String.h"<br />
<br />
class Article<br />
{<br />
public: <br />
Article(int i_key, int i_number, String i_type);<br />
<br />
private:<br />
int m_key;<br />
int m_number;<br />
String m_type;
}; <br />
<br />
#endif<br />
4. Timer.h
<br />
#ifndef TIMER_H<br />
#define TIMER_H<br />
<br />
class Timer<br />
{<br />
public:<br />
Timer(){ m_startTime = 0; m_stopTime = 0; }<br />
int startTimer();
double stopTimer();
<br />
double getTime();
private:<br />
<br />
double m_startTime;<br />
double m_stopTime;<br />
double m_frequence;<br />
};<br />
<br />
#endif<br />
5. Timer.cpp
<br />
<br />
#include <windows.h><br />
#include "timer.h"<br />
<br />
<br />
int Timer::startTimer()<br />
{<br />
LARGE_INTEGER start, freq;<br />
if(!QueryPerformanceFrequency(&freq))<br />
return 0;<br />
m_frequence = (double) freq.QuadPart;<br />
QueryPerformanceCounter(&start);<br />
m_startTime = (double)start.QuadPart;<br />
return 1;<br />
}<br />
<br />
double Timer::stopTimer()<br />
{<br />
LARGE_INTEGER end;<br />
QueryPerformanceCounter(&end);<br />
<br />
m_stopTime = (double)end.QuadPart;<br />
<br />
return (m_stopTime-m_startTime) * 1000.0 / m_frequence;<br />
}<br />
<br />
double Timer::getTime()<br />
{<br />
return (m_stopTime-m_startTime) * 1000.0 / m_frequence;<br />
}<br />
That's all. You can send me the programme by mail if you finished the lab. That would be awesome!
THANK U ALL!
|
|
|
|
|
El_Maco wrote:
You can send me the programme by mail if you finished the lab.
I don't think you're going to get any takers here. If you have a specific problem or question, we'd be happy to help you.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
No problem.
Please give me the contact number for your schools acidemic dishonesty board. Somethings they have a different name, whoever the group is that investigates cheating.
|
|
|
|
|
Hi, ALl
I am having a problem with a Printer running on Window XP... The computer would run into BLUE SCREEN during shutting down if the Printer had been turned before shutdown?
One solution is to uload or stop the printer driver before shutdown.
My questions are:
1) how to write a program that can stop or unload the printer driver?
2) how to let XP automatically unload the driver instead of manually just before shutdown?
Your help and contribution appreciated!
JW
DJ
|
|
|
|
|
hi everybody,
can anybody give me a link or resource that might show how to draw large graphics more fast just like Microsoft MapPoint and illustrator??
thanks.
abel.
|
|
|
|
|
Use Direct Draw that is fastest way to draw something.
Make a surface in VGA memory,get the pointer of it, write any thing whatever you want.
If you don't know anything about DX. just make a memDC and write something there and blt it.
|
|
|
|
|
I'm creating a program to move a robotic arm with six axis. For each axis I have three pushbuttons. I'll use the rotate main arm for an example. The main arm has a left, right and stop pushbuttons. This works fine as it is, but I would like to limit this to two pushbuttons (left and right). Is there a way that I can press the left or right button so that when pressed it moves in the direction being pressed or stops when released? Right now each button has a funtion. The left button is OnLeft(). Inside this function the code to move the arm to the left is _outp(0X302,0X08). All the other buttons are similiar for each axis.
Thanks,
jfletcher
|
|
|
|
|
Hello,
You can try to subclass the button control and override OnLButtonDown() and OnRButtonDown()...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
change in the AFX_MESSAGE_MAP the message associated to your button from WM_COMMAND to WM_LBUTTONDOWN
TOXCCT >>> GEII power
|
|
|
|
|
Dear .NET Developers,
I need to do a report like Master Detail.For Example two reports are there test and test1.If I click the report test,test1 report should come.Is it possible to do like this.Help me.
radha
|
|
|
|
|
Hi,
I am getting the ERROR_ALREADY_EXISTS error when I call WaitForMultipleObjects(). Any idea why this is happening?
Thanks.
|
|
|
|
|
Hello,
According to MSDN, WaitForMultipleObjects() does not return that value???
Can you post the code that is causing that error?
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hi,
Thanks for responding. Yes, that is right. WaitForMultipleObjects() returns a WAIT_FAILED(-1). When I get this I do a GetLastError() and that is when I get the ERROR_ALREADY_EXISTS(183) error.
Thanks!
|
|
|
|
|
Hi,
I am creating a training tool to demonstrate software crashes. My tool will demonstrate a runtime error, GPF (General Protection Fault) and a BSOD (Blue Screen of Death). So far my utility can create the first two scenarios but not the last, the BSOD. Does anyone have an example of code that will create this situation? I have tried Multi Threading with forced shutdown and accessing the kernel32.dll and I either get a GPF or the system shutsdown, with no BSOD. I can create dummy screen shots of a BSOD but for training purposes I would like to create the real thing so I can use WinDBG to analyze the memory dump file.
-Venny
|
|
|
|
|