Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7650363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:13:59+00:00 2026-05-31T11:13:59+00:00

I have an MFC application. It has a CMap which contains certain data objects,

  • 0

I have an MFC application. It has a CMap which contains certain data objects, the map is declared as CMap<DWORDLONG, DWORDLONG,_ItemsObj*,_ItemsObj*> where _ItemsObj is a structure that contains various data.

The problem I’m facing is that when I try to search for an entry the Lookup method fails unexpectedly on x64 builds (and ONLY on x64 builds).

Here’s the code I’m using

BOOL IsItemExist(DWORDLONG dwid)
{_ItemsObj* pObj=NULL;
if(!m_Itemsmap.Lookup(dwid,pObj))
{return FALSE;}
return TRUE;
}

Now this works perfectly on a 32-bit build of my application. However on an x64 build the Lookup always fails even though the items are present in the map and the key I’m looking for is present in the map.

I think its somewhat related to a build configuration issue, I have checked the linking properties and build configuration for both the x86 and the x64 option for the app project and they use the exact same configuration except for the target machine option (which should be different).

Can someone please help me fix this, I’ve been looking all over the internet for a solution but could not find anything.

Oh and I’m using VS 2010 SP1

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:14:01+00:00Added an answer on May 31, 2026 at 11:14 am

    There are five global helper functions that CMap, CList and CArray uses. They are CompareElements, CopyElements, DumpElements, HashKey and SerializeElements. Your problem is likely with SerializeElements which CMap uses to to store collection element.
    The other thing to try is to declare your CMap as
    CMap < DWORDLONG, DWORDLONG, _ItemsObj,_ItemsObj*>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have C++ application which has UI developed using MFC, does some networking using
I have an MFC application, which i don't want to be closed during the
I have successfully upgraded an MFC application which was compiled with an old version
I have a win32 GUI (MFC) application which I need to port to a
I have a MFC dialog based application in which I use ::system() function to
I'm coding an MFC application in which i have a dialog box with multiple
I have an application which has many services and one UI module. All these
In our application we have an MFC dialog that opens and processes some data
I have an MFC application that has a webcontrol. When clickable links are clicked,
I have an MFC application. It is basically just copying files from one drive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.