Does Dictionary object available in MS VC 2008 ?

Posted on 2010-11-27
Medium Priority
Last Modified: 2012-05-10
Hi experts!

I’m experience programmer in VB6 and C#, but totally new to MS VC 2008. I should use in C 2008 Win32 unmanaged code in OCX project object like Dictionary in C# , e.g. I need to make a collection of Long numbers (but to be string is also possible) and to be able to literate through collection, also to add and remove mebers of this collection at any time. What object I should use ?

I want to use only standard run-time libraries for C 2008.
Question by:dvplayltd
  • 4
  • 3
  • 2
  • +2

Accepted Solution

Subrat (C++ windows/Linux) earned 2000 total points
ID: 34222723
There is no such thing in standrd C. In C++ you can use STL.(std::map, std::multimap.. etc)

Expert Comment

ID: 34222727
There is standard c library in c#  
There is no standard runtime library (DLL) available like you said in c# or vb6
May be some other open source library can be found if you google                                   You can use structure to make collection and add whatever members you wanted to add.                             Example                structure
    int longNum;
char string[255];
If you wanted to add a structure dynamically then use linked lists  

Expert Comment

ID: 34222753
Oh I mistyped the first line
I mean there is no standard c library like dictionary handling library in c#
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

LVL 33

Expert Comment

ID: 34223114
You can use the standard c library to implement your own dictionary. Hope one of these links helps you enough to morph the ideas here into your own needs.

LVL 12

Expert Comment

ID: 34228388
"I want to use only standard run-time libraries for C 2008."

I am a little confused with your statement above, however it appears that you want to use Visual Studio 2008 which comes with a C++ compiler. So assuming that you intend writing a C++ program I suggest you try using STL as one of the experts has suggested.

"I need to make a collection of Long numbers (but to be string is also possible)"

If there are no strict ordering requirements for your dictionary I would suggest you use the unordered_map which is the TR1 implementation of a hash_table.

Unordered maps are used for their higher efficiency.

Also I would suggest that you move to Visual Studio 2010 rather than use Visual Studio 2008

Author Comment

ID: 34228960
To Subrat2009

>>In C++ you can use STL.

Ok ... Look OK. But my question is connected with deploy my app on customer computer. Does I need to install additional file except MS VC run-time files ? I use MS VC++ 2008 . And I do not know, does this library free ?
LVL 12

Expert Comment

ID: 34234755
yes it comes packaged with Visual Studio 2008.


And fyi Visual Studio 2008 is the name of the complete product suite, the VC++ compiler is one of the tools present in this suite. When you perform the installation of Visual Studio 2008 you will need to select which tools you need. Select the C++ compiler and it should take care of installing the required STL libraries and header files.

But like I said in my previous post, Microsoft has improved its implementation of the STL in Visual Studio 2010 which is what they recommend. So you could still use Visual Studio 2008 but if you have a chance to move to Visual Studio 2010 then I would suggest you do this. There will be no difference in the syntax of the code that you have to write for Visual Studio 2010 if thats what you are worried about.
LVL 12

Expert Comment

ID: 34234767
here's another useful link in case you would like to do some additional reading


Author Comment

ID: 34236942
To trinitrotoluene

I know that STL is installed with VS 2008 and 2010, but I'll not install VS 2008 on customer computer when I deploy my app, right?
Question is simple - I made a OCX file and want to tell to user - to use it need to install ONLY runtime files for C++ 2008, not to install and additional librabry which make do conflict with already installed version and so on ...

I have more than 5 project in Vs 2008 in C#, MS VC and DO NOT WANT TO BORROW with possible problems with VS 2010. More - first SP1 for 2010 is not ready, I have learn my lesson in past with first version ... :-)


Author Closing Comment

ID: 34251389
LVL 12

Expert Comment

ID: 34253354
Its obvious that you have to package the re-distributable with your application when you make a drop to your customer just in case he has a different runtime environment.

As for the STL packaging, this goes beyond what is known to the general public. Version 10 of the C++ compiler implements TR1 recommendations to a better degree than previous versions of the compiler if you understand what I mean, so the implementation of STL is far superior to what you will see with VS 2008

That was the reason I suggested that you use VS 2010 if you plan on using an unordered map.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

580 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