Forum: C++ Oct 1st, 2009 |
| Replies: 7 Views: 325 Hi,
your question is bit unclear... what are you storing in the multimap logically. What I've understood is that you want to get the multiple values against the same key
multimap<int, string> ... |
Forum: C++ Sep 30th, 2009 |
| Replies: 2 Views: 148 search Longest Common Subsequence algorithm. and modify that algorithm to meet your need. |
Forum: C++ Sep 3rd, 2009 |
| Replies: 5 Views: 343 when I was learning this topic. I followed the very good series of articles on code project, check the below link
Hope above helps. |
Forum: C++ Aug 19th, 2009 |
| Replies: 10 Views: 418 Thank you mcco for providing me the definition of RECT structure
kindly provide me the values (numbers), It seems that your expression evaluates to zero thats why I've asked to provide me the... |
Forum: C++ Aug 19th, 2009 |
| Replies: 10 Views: 418 What are the values of RECT members? |
Forum: C++ Aug 12th, 2009 |
| Replies: 9 Views: 528 hmmmmmmmmmm, I've come up with some solution to you problem hope this might help you.
class ICommand {
public:
virtual ~ICommand() = 0 { }
virtual void ExecuteCallBack(int iCommandId) = 0;... |
Forum: C++ Aug 12th, 2009 |
| Replies: 3 Views: 1,007 bool, true, false are already keyword in C++. you don't need to define enum for it. |
Forum: C++ Aug 12th, 2009 |
| Replies: 7 Views: 279 Hi FirstPerson,
I've tweaked your code to meet your needs, I think you are trying to acheive something like this.
class Tetris {
public:
bool DrawLine(unsigned int iColId) {
cout <<... |
Forum: C++ Aug 11th, 2009 |
| Replies: 5 Views: 328 I've few questions,
FrameVisitor::FrameVisitor()
{
Frame();
frames = get_frames(myfile);
}
you have passed 'myfile' as a parameter in fstream where it is defined? |
Forum: C++ Aug 11th, 2009 |
| Replies: 9 Views: 528 I don't think Command Design pattern best matches your need,
what you can do is simply create a Class that holds the map of Objects of type administrator, HR, Staff and value part contains the... |
Forum: C++ Aug 11th, 2009 |
| Replies: 2 Views: 239 it depends on the compiler rather than C++, you should see the compiler reference manual. |
Forum: C++ Aug 11th, 2009 |
| Replies: 7 Views: 279 I think you are trying to acheive the below one.
template<class T>
class Foo {
typedef void (T::*MFPtr)(int id);
MFPtr funcPtr;
public:
void SetDrawFunction(MFPtr memFunctionPtr) { ... |
Forum: C++ Aug 10th, 2009 |
| Replies: 9 Views: 528 sorry PETER_APIIT but your design has several flaws, describe you requirement a bit, then I will tweak your design to meet your needs. |
Forum: C++ Aug 10th, 2009 |
| Replies: 3 Views: 366 Read the following Link Carefully and check for MACRO & GUID that needs to be defined in case of XP, I am assuming that you are good in understanding msdn doc. If you still find it difficult to... |
Forum: C++ Aug 10th, 2009 |
| Replies: 5 Views: 480 Hi,
why you've called LoadBitmap(...) in WM_CREATE message? I am sure your problem will be resolved if you change WM_CREATE to WM_INITDIALOG.
further you should learn and understand the difference... |
Forum: C++ Aug 10th, 2009 |
| Replies: 4 Views: 398 peek basically reads the next available character without moving the file pointer.
for example if text file contains the following text
and if you execute the following psuedo Code
int... |
Forum: C++ Aug 10th, 2009 |
| Replies: 12 Views: 1,263 yes Its seems fine with a cursory look.
Good luck (Y). |
Forum: C++ Aug 10th, 2009 |
| Replies: 12 Views: 1,263 try the below one
//HANDLE hPort = CreateFile("COM1", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
HANDLE hPort = CreateFile(TEXT("COM1"), GENERIC_READ|GENERIC_WRITE, 0, NULL,... |
Forum: C++ Aug 7th, 2009 |
| Replies: 7 Views: 349 @firstPerson the default Constructor & Destructor are not always trivial at the Compiler level, to users it might be...
Hi lotrsimp12345,
This usually irritates the programmer that why the... |
Forum: C++ Aug 3rd, 2009 |
| Replies: 3 Views: 281 Serialization & Deserialization technique would help you in acheiving this. or rather use the Boost which will provide you serialization & deserialization by not doing lot of work.
check the below... |
Forum: C++ Aug 3rd, 2009 |
| Replies: 4 Views: 234 I think you are mixing the pointer to Function with Pointer to member Function, I am giving you a little example on How to solve your problem.
class Foo {
public:
bool operator()(const int a)... |
Forum: C++ Aug 2nd, 2009 |
| Replies: 2 Views: 583 i) create an event and check that event in the child thread
ii) signal the event from main thread when you want to exit
iii) call UnhookWindowEx() and release resouces in the child thread.
... |
Forum: C++ Jul 28th, 2009 |
| Replies: 1 Views: 203 if you are using pthread then you can use the following API.
int pthread_attr_setschedparam(pthread_attr_t *tattr, const struct sched_param *param);
consult google for such questions :). it... |
Forum: C++ Jul 28th, 2009 |
| Replies: 2 Views: 151 take a look to the following link.
http://www.codeproject.com/KB/ISAPI/isapiredirector.aspx?fid=18786&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2967743 |
Forum: C++ Jul 27th, 2009 |
| Replies: 1 Views: 271 I am sure that your BSTreeNode calss must be template class and you should provide the template argument to this as well.
like
BSTreeNode<DataType, KeyType>* BSTree<DataType, KeyType>::findMin... |
Forum: C++ Jul 26th, 2009 |
| Replies: 7 Views: 327 First of all for all native Applications written in C/C++ no Framework is required, well as you are using MFC in your project I think you must know the basics of Dll & CRT. In VS2008 create a Win32... |
Forum: C++ Jul 26th, 2009 |
| Replies: 2 Views: 428 I assume that you understand why Microsoft Compiler gives this warning... so explaining the solution...
if you use precompiled headers add the following lines in the stdafx.h and rebuild the... |
Forum: C++ Jul 23rd, 2009 |
| Replies: 11 Views: 395 tom Gun
As per the OOP paradigm strickly speaking in OOP, whenever you need the default behavior in Generic Type & want to specialize the behavior in derived you use the polymorphic behavior. Or... |
Forum: C++ Jul 23rd, 2009 |
| Replies: 7 Views: 622 Read about OWNER DRAW Window's Style and Windows Subclassing and also Non Client Paint Message.
Following Link would help but pre-requisit are the above two concepts.
... |
Forum: C++ Jul 23rd, 2009 |
| Replies: 7 Views: 234 basically whenever process is shutdown windows releases all the memory allocated by it, the problem regarding memory leak appears whenever the application kept on running and own the unreferenced... |
Forum: C++ Jul 23rd, 2009 |
| Replies: 7 Views: 234 Why don't you keep the connection level stuff at the application/module level rather than within the function, so when the game started the delay is bearable.
follow anciant dragon's advice and... |
Forum: C++ Jul 22nd, 2009 |
| Replies: 12 Views: 536 search for the WinINet. for Http. |
Forum: C++ Jul 20th, 2009 |
| Replies: 11 Views: 395 I don't understand your objective behing calling derive funciton in base at all, I understand C++ is multi paradigm language, but I can't see any logical reasoning behind this, could you please... |
Forum: C++ Jul 20th, 2009 |
| Replies: 4 Views: 222 try adding the following code in the very beginning.
#include <string>
using std::string;
this is the solution I can suggest without looking at the .zip file :) |
Forum: C++ Jul 6th, 2009 |
| Replies: 4 Views: 281 I can see problem here.
for(int i=0; i<int_totalNumChildren; i++) {
genTree->int_transactionID = tranID[i];
// in main
int tID = 100;
gTree->addChildren(&tID, numOfChildren); |
Forum: C++ Jul 6th, 2009 |
| Replies: 4 Views: 422 by the way following is also a legal syntax.
(obj.*m['a'])();
:). |
Forum: C++ Jul 6th, 2009 |
| Replies: 4 Views: 422 try the following.
the syntax seems difficult but look it carefully.
(f.*((*it).second))();
(f.*(it->second))();
the easier way is to create the typedef and assign the return value of... |
Forum: C++ Jul 5th, 2009 |
| Replies: 2 Views: 335 i can see the problem here..
return *max_element(cc.begin(),cc.end());
it shouldn't be like that, what if no values are being inserted in the vector. and your test [icode] moves[i] ==... |
Forum: C++ Jul 5th, 2009 |
| Replies: 3 Views: 1,170 try to figure out the algorithm used behind string.find(...), and compare it with standard string searching algorithm likes.
the above algorithms have different complexity based on the size of the... |
Forum: C++ Jan 14th, 2009 |
| Replies: 5 Views: 370 Why you search for the Random Value? is it your requirement?
int a=1 + int (10 * rand() / ( RAND_MAX + 1 ) );
this would result in a random number, theoratically every time you are creating a... |