User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 392,329 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,778 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:

Maps in VC++ 6.0

Join Date: Jul 2005
Posts: 244
Reputation: Drowzee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Drowzee Drowzee is offline Offline
Posting Whiz in Training

Re: Maps in VC++ 6.0

  #3  
Sep 19th, 2005
All right. I'm not very good with pseudo code, but there's no need to cloak and dagger this stuff.

In the header, as part of my MFC app's document class:

	typedef pair <const CString, CString> cCStr2CStr;
	map <CString, CString> MACaddrMAP;
	map <CString, CString>:: key_type key1;
	map <CString, CString>::_Tref mapped1;
	//map <CString, CString>:: value_type value1;
	map <CString, CString>:: iterator mapIter;
I'm not entirely sure I'll even need all of the above.


In the constructor for the document class:
CGUISnoopDoc::CGUISnoopDoc():mapped1(MACaddrMAP.begin()->second)
{
	MACaddrMAP.insert (cCStr2CStr("FF:FF:FF:FF:FF","Ethernet Broadcast") );
}

and I get this error from putting this stuff in:
c:\program files\microsoft visual studio\vc98\include\xtree(151) : warning C4786: '?$reverse_bidirectional_iterator@Viterator@?$_Tree@VCString@@U?$pair@$$
CBVCString@@V1@@std@@U_Kfn@?$map@VCString@@V1@U?$less
@VCString@@@std@@V?$allocator@VCString@@@3
@@3@U?$less@VCString@@@3@V?$allocator@VCString@@@3@@
std@@U?$pair@$$CBVCString@@V1@@3@AAU43@PAU43@H' :
identifier was truncated to '255' characters in the browser information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<class CString,struct std::pair<class CString const ,class CString>,
struct std::map<class CString,class CString,struct std::less<class CString>,
class std::allocator<class CString> >::_Kfn,struct std::less<class CString>,
class std::allocator<class CString> >' being compiled
c:\mfctutorials\guisnoop\guisnoopdoc.h(72) : see reference to class template instantiation
'std::map<class CString,class CString,struct std::less<class CString>,class std::allocator<class CString> >' being compiled


I just want a map class that pairs off a CString as both key and value. This map will be initially populated by the program, setting the key and value to the same CString.
The user will then be able to edit the value and have the program remap all occurances of that value to the new definition, while preserving the original CString in the key.
This is going to be used to make a whole bunch of MAC addresses more distinct when viewed in a column, and I figure that this is the best way to do it so that the program can be expanded to save the user-defined values for reload later.

I never really did pseudocode, I'm afraid, If this isn't good enough, I'll go learn a pseudocode method as fast as I can...
Reply With Quote  
All times are GMT -4. The time now is 11:14 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC