Hi I am using STL map in VC++6.0 application.
type of project is MFC DLL.
My code looks like:--
typedef std::map <unsigned long,LPVOID, BOOL> MyMap;
In class definition file i am using this map as:--
MyMap m_mapPHLRecorde r ;
MyMap::iterator m_Iterator;
In one function of implementation file the code is :--
m_Iterator = m_mapPHLRecorde r.find(nRecorde rID);
if (m_Iterator != m_mapPHLRecorde r.end())
{
return (*m_Iterator).s econd ;
}
else
{
// Error Reporting
// Message Line 1: Unable to find Protocol Handler Library.
// Message Line 2: Invalid Recorder Serial Number.
return NULL;
}
If I am not calling the STL map's functions then no errors are coming.
Can anybody please help. 6 2178
kushalsoftpro wrote: Hi I am using STL map in VC++6.0 application. type of project is MFC DLL.
My code looks like:--
typedef std::map <unsigned long,LPVOID, BOOL> MyMap;
What's the BOOL for? The third argument of 'std::map' template is
supposed to be a _functor_. In class definition file i am using this map as:--
MyMap m_mapPHLRecorde r ; MyMap::iterator m_Iterator;
In one function of implementation file the code is :--
m_Iterator = m_mapPHLRecorde r.find(nRecorde rID); if (m_Iterator != m_mapPHLRecorde r.end()) { return (*m_Iterator).s econd ; } else { // Error Reporting // Message Line 1: Unable to find Protocol Handler Library. // Message Line 2: Invalid Recorder Serial Number. return NULL; }
If I am not calling the STL map's functions then no errors are coming.
Can anybody please help.
You can help yourself if you read the reference for the Standard library,
the section about the 'map' template.
V
"Victor Bazarov" <v.********@com Acast.net> wrote in message
news:vj******** ********@newsre ad1.dllstx09.us .to.verio.net.. . kushalsoftpro wrote: Hi I am using STL map in VC++6.0 application. type of project is MFC DLL.
My code looks like:--
typedef std::map <unsigned long,LPVOID, BOOL> MyMap;
What's the BOOL for? The third argument of 'std::map' template is supposed to be a _functor_.
There no reason apparent from the posted code why the OP couldn't simply
remove BOOL.
typedef std::map <unsigned long,LPVOID> MyMap;
john
John Harrison wrote: "Victor Bazarov" <v.********@com Acast.net> wrote in message news:vj******** ********@newsre ad1.dllstx09.us .to.verio.net.. .
kushalsoftp ro wrote:
Hi I am using STL map in VC++6.0 application. type of project is MFC DLL.
My code looks like:--
typedef std::map <unsigned long,LPVOID, BOOL> MyMap;
What's the BOOL for? The third argument of 'std::map' template is supposed to be a _functor_.
There no reason apparent from the posted code why the OP couldn't simply remove BOOL.
typedef std::map <unsigned long,LPVOID> MyMap;
Right. But it is also possible that the OP thought it ought to be the
return value type of the comparator. Perhaps a special kind of the
sorting functor is needed... Anyway, our guesses are only as good as
the information available to us. Let's hope "softpro" gets that.
V
Thanx John, Victor,
It worked.
Actually I havn't used STL much in past.
My intension was to put a third element in the map. For that only I put
BOOL as third parameter. Anyways, I have some other ways for managing this
third parameter.
Thanx again..
Thanx John, Victor,
It worked.
Actually I havn't used STL much in past.
My intension was to put a third element in the map. For that only I put
BOOL as third parameter. Anyways, I have some other ways for managing this
third parameter.
Thanx again..
"kushalsoft pro" <ku************ ***@gmail.com> wrote in message
news:2f******** *************** *******@localho st.talkaboutpro gramming.com... Thanx John, Victor,
It worked.
Actually I havn't used STL much in past.
My intension was to put a third element in the map. For that only I put BOOL as third parameter. Anyways, I have some other ways for managing this third parameter.
The first parameter to a map is the key that you use to look up the value.
The second parameter to a map is the value.
The third (optional) parameter to a map is the key comparison object.
The fourth (optional) parameter to a map is the allocator object.
If you want to put an LPVOID and a BOOL into a map you do it like this
struct MyData
{
LPVOID v;
BOOL b;
};
typedef std::map <unsigned long,MyData> MyMap;
Of course this means that every entry in the map has an LPVOID and a BOOL,
not that some have an LPVOID and some have a BOOL. If that was your
intention, well there are ways of doing that too.
john This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Medi Montaseri |
last post by:
Hope this is a right forum, else route me...
I'm using map STL in Microsoft Visual C++ 6.0 and am getting
warning C4786 which seems to have to do with truncating symbols
as VC++ is building a browser file (unix folks think ctags file).
Is there anyway to tell this compiler to increase your symbol entry
buffer size from 255 to 1000 (or something).
The warning message looks like this
|
by: Bryan Pietrzak |
last post by:
I'm new to using the STL and templates and while I've had no problem
at all using vector, I'm having a problem using map.
I just want to do something like:
class CMyData
{
// class stuff here
};
|
by: Charlie |
last post by:
I have the first part of the project done but I'm having difficulty
deciding how to add an evaluate function to this program.
The program asks the user to enter a function in infix notation and
then it prints out the function in postfix notation. I need to add an
evaluate function that evaluates the postfix notation obtained by the
program. I was hoping that someone could please give me some advice as
to how to add the evaluate function...
|
by: Abhi |
last post by:
Hi all,
I am using .net for C++ and I would like to write some variable values
to some files.
I will be using that file in many member functions of the class. So I
declared the file variable names in class.
And I declared that to a file name in one member function.
|
by: Rick427 |
last post by:
I am new to .NET and was wondering if there is a function like the evaluate function in Cold Fusion that lets you use the value of something as a variable name instead of using a select case statement. For example:
Dim Line as String = "Action=Go"
Dim URLParts() As String = Line.Split("=")
Select Case URLParts(0).ToLower
Case "action"
us.CapabilityUrls.setAction(URLParts(1))
instead I want to be able to say something like...
| |
by: sck10 |
last post by:
Hello,
I am calling a function using vb and want to convert it to c#. When moving
from vb 1.1 to vb 2.0, I can use the following: text='<%#
AddBlankRowMenu(Eval("strMenuType")) %>' to call the function. I no longer
need to use "DataBinder.Eval(Container,"DataItem." in front of the DataItem.
However, when I tried to use the new syntax in c#, I got an error. However,
the older syntax works.
Am I missing something, or does c# require...
|
by: patilanjana |
last post by:
Hi,
I am getting above mentioned errors. Checked msdn, read the comments but I fail to implement it. Please help.
Error is regarding using the new and delete operators. Although I do write both, the compiler is not matching them and I guess there is a memory leak.
Program hangs after main returns, thats weired to me.
Thanks for all the help. Really appreciate it.
|
by: =?Utf-8?B?VmljdG9yIExhaQ==?= |
last post by:
Hi,
I wrote an simple application using VS2005 C#. I am trying to call some
functions in my other dll file. This dll is written in EVC for running on
Windows CE 5.0.
This dll file has the following function exported:
void init_GPIO();
void set_GPIO_Value(int value);
void set_GPIO_Direction(int direction);
UInt16 get_GPIO_Value();
|
by: teenIce |
last post by:
Hi guys,
How do I access flash function using javascript?Does anyone have any reference or code?
Thanks...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |