|
|
|
MFC+OLE+LOCALE
|
|||
|---|---|---|---|
|
#18+
Добрый день, добрый ALL! Проблема. Переполз на VS2005. Первый проект - клиент к БД (MSSQL), через OLE Все чудно и работает на славу. Но... Пользую наследника от CDynamicParameterAccessor Через GetValue чудесным образом получаю содержимое поля по нужной строке. На основании GetColumnType провожу нужные преобразования ( в данном случае к строке) и вывожу результат. Первая значимая поблема, с которой столкнулся - Русская раскладка (вылазять кракозяблики на месте русских букв) Вопрос: Где, задаётся раскладка в которой следует получать строки? MSDN что-то пишет о bool GetValue( DBORDINAL nColumn, ctype* pData ) const throw( ); ctype, что поможет указать Акцессору в какой раскладке я хочу получить данные. Но, хоть убей, я не смог воспользоваться ctype компилятор кричит, что это не класс, описание отсутствует, хотя строка #include <locale> в наличии. Ещё имею сообщить, что проект компилируется с поддержкой Unicode. Повторюсь. Будьте добры - подскажите, где я должен рыть по вопросу Russ кодировки? Спасибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.06.2007, 16:16 |
|
||
|
MFC+OLE+LOCALE
|
|||
|---|---|---|---|
|
#18+
vanomanНо, хоть убей, я не смог воспользоваться ctype компилятор кричит, что это не класс, описание отсутствуетпочитать про него тоже не смог? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.06.2007, 17:16 |
|
||
|
MFC+OLE+LOCALE
|
|||
|---|---|---|---|
|
#18+
CDynamicAccessor::GetValueSee Also Retrieves the data for a specified column. void* GetValue( DBORDINAL nColumn ) const throw( ); void* GetValue( const CHAR* pColumnName ) const throw( ); void* GetValue( const WCHAR* pColumnName ) const throw( ); template < class ctype > bool GetValue( DBORDINAL nColumn, ctype* pData ) const throw( ); template < class ctype > bool GetValue( const CHAR* pColumnName, ctype* pData ) const throw( ); template < class ctype > bool GetValue( const WCHAR* pColumnName, ctype* pData ) const throw( ); Parameters ctype [in] A templated parameter that handles any data type except string types (CHAR*, WCHAR*), which require special handling. GetValue uses the appropriate data type based on what you specify here. nColumn [in] The column number. Column numbers start with 1. A value of 0 refers to the bookmark column, if any. pColumnName [in] The column name. pData [out] The pointer to the contents of the specified column. Return Value If you want to pass string data, use the nontemplated versions of GetValue. The nontemplated versions of this method return void*, which points to the part of the buffer that contains the specified column data. Returns NULL if the column is not found. For all other data types, it is simpler to use the templated versions of GetValue. The templated versions return true on success or false on failure. Remarks Use the nontemplated versions to return columns that contain strings and the templated versions for columns that contain other data types. In debug mode, you will get an assertion if the size of pData is unequal to the size of the column to which it points. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.06.2007, 17:27 |
|
||
|
MFC+OLE+LOCALE
|
|||
|---|---|---|---|
|
#18+
maXmo vanomanНо, хоть убей, я не смог воспользоваться ctype компилятор кричит, что это не класс, описание отсутствуетпочитать про него тоже не смог? Да нет прочёл... A class that provides a facet that is used to classify characters, convert from upper and lower cases, and convert between the native character set and that set used by the locale. template <class CharType> class ctype : public ctype_base Parameter CharType The type used within a program to encode characters. Вроде должен помогать в указанном вопросе? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.06.2007, 17:29 |
|
||
|
MFC+OLE+LOCALE
|
|||
|---|---|---|---|
|
#18+
класс-то шаблонный. У тебя данные в какой кодировке? Есть ctype_byname. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.06.2007, 17:54 |
|
||
|
MFC+OLE+LOCALE
|
|||
|---|---|---|---|
|
#18+
maXmoкласс-то шаблонный. У тебя данные в какой кодировке? Есть ctype_byname. Оп-с... завтра доложу. Пошел читать HELP Спасибо за мысль! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.06.2007, 18:03 |
|
||
|
MFC+OLE+LOCALE
|
|||
|---|---|---|---|
|
#18+
Мой мозг крушится!!! Вырезка MSDN ctype_byname Class бла-бла-бла Requirements Header: <locale> ctype Class бла-бла-бла Requirements Header: <locale> В файле присутствуют обявления #include "locale.h"или #include <locale> Но всегда, на строку ctype_byname ct; Получаю: Error 1 error C2065: 'ctype_byname' : undeclared identifier ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.06.2007, 17:12 |
|
||
|
|

start [/forum/topic.php?fid=57&msg=34596969&tid=2028669]: |
0ms |
get settings: |
10ms |
get forum list: |
20ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
180ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
58ms |
get tp. blocked users: |
1ms |
| others: | 240ms |
| total: | 529ms |

| 0 / 0 |
