Print Page | Close Window

CXTPCalendarCustomProperties

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=10262
Printed Date: 23 June 2024 at 4:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPCalendarCustomProperties
Posted By: Algae
Subject: CXTPCalendarCustomProperties
Date 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.





Replies:
Posted By: Algae
Date 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.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net