Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - CXTPCalendarCustomProperties
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPCalendarCustomProperties

 Post Reply Post Reply
Author
Message
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Topic: CXTPCalendarCustomProperties
    Posted: 16 April 2008 at 3:57pm
Hello,

With version 10.42 I have tried using the CXTPCalendarCustomProperties portion of the Calendar system. It seems to have a problem or I'm not using it properly.

I am able to successfully SetProperty and GetProperty from the data record during one program execution. The problem is that the property "name" is not reloaded to m_mapProperties when you start the program again. The records contain the data and keys but you cannot reach them because the "key" is no longer in the map. Thus:

in XTPCalendarCustomProperties.cpp:

BOOL CXTPCalendarCustomProperties::GetProperty(LPCTSTR pcszName, COleVariant& rVarValue) const
{
    return m_mapProperties.Lookup(PrepareName(pcszName), rVarValue);
}

fails every time since the name is not loaded to m_mapProperties. It is not added to the map again until you do a SetProperty();

Is there a mechanism to set and load custom property keys to m_mapProperties that I'm overlooking?

Thank you in advance for any help you can provide.


Back to Top
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2008 at 5:29pm
Solved:

I isolated the problem to the CustomPropertiesXMLData data field in my mssql database where I try to retrieve the properties in ptrEvent->GetCustomProperties();

CustomPropertiesXMLData was set as nText data type. Whenever it tried to load that to _bstr_t it failed. I changed the field definition type to nvarchar(255) and now it reads the data fine and loads up the key map properly.

I really don't know why _bstr_t cannot "read" nText but that was the cause of the problem.

If anyone knows why please let me know as I am most curious as to the reason it fails. I probably just don't know enough about _bstr_t limitations.

Hope this info comes in handy to anyone else who's experienced this problem.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.140 seconds.