Click here to Skip to main content
14,392,303 members

ATL / WTL / STL

 
QuestionCreating Classes in VS 2013 Pin
Bram van Kampen9-Aug-14 16:22
MemberBram van Kampen9-Aug-14 16:22 
AnswerRe: Creating Classes in VS 2013 Pin
Richard Andrew x649-Aug-14 18:50
professionalRichard Andrew x649-Aug-14 18:50 
Questionerror - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Swap95-Aug-14 22:40
MemberSwap95-Aug-14 22:40 
AnswerRe: error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Richard MacCutchan5-Aug-14 23:34
mveRichard MacCutchan5-Aug-14 23:34 
AnswerRe: error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Subrat 470826612-Sep-14 16:15
MemberSubrat 470826612-Sep-14 16:15 
Questionhow to let menu auto show next item when mouse on the bottom arrow of menu Pin
fengforky9-Jul-14 23:53
Memberfengforky9-Jul-14 23:53 
AnswerRe: how to let menu auto show next item when mouse on the bottom arrow of menu Pin
Richard MacCutchan10-Jul-14 0:34
mveRichard MacCutchan10-Jul-14 0:34 
QuestionWCHAR, wstring, initializing and accessing them (RESOLVED) Pin
bkelly131-Jul-14 11:13
Memberbkelly131-Jul-14 11:13 
Visual Studio 2008, C++
Class C_AR2_Messages process telemetry messages. The configuration is quite complex so class C_Configuration_Manager reads a configuration file and loads the data into the structures/variable of C_AR2_Messages.
Please note that my work is on a classified computer and I cannot cut and paste from there to here. I probably put in a few typos. Please note them, but take that into consideration.

The message class contains:
The messages class contains
Class C_AR2_Messages
{ …
WCHAR m_common_parameter_names _NAMES[ COMMON_ARRAY_SIZE  ][  MAX_PARAMETER_NAME_LENGTH ];

All the below fail compile but to me, they match the examples I have found in my searches.  Two of them claim that the open brace is a syntax error.
WCHAR m_test[ ] [ ] = { {L"one"}, { L"two" }, { L"three" } };
WCHAR m_test_2[ 3 ] [8 ] = { {L"one"}, { L"two" }, { L"three" } };
Wstring m_test_3[ ]          = { L"one", L"two", L"three" };


Meanwhile back in class C_Configuration_Manager.h, there is a method used to hand that class the pointer giving it access. It looks like:

Class C_Configuration_Manager
{ …	
VOID  Set_Common_Names_Pointer( WCHAR  *new_pointer[COMMON_ARRAY_SIZE  ][ MAX_PARAMETER_NAME_LENGTH ] );
// and the local pointer
WCHAR mp_common_parameter_names[COMMON_ARRAY_SIZE  ][ MAX_PARAMETER_NAME_LENGTH ];


and C_Configuration_Manager.cpp contains:
VOID  Set_Common_Names_Pointer( WCHAR  *new_pointer[COMMON_ARRAY_SIZE  ][ MAX_PARAMETER_NAME_LENGTH ] )
{ mp_common_parameter_names = new_pointer; }

The compiler says:
Quote:
Error C2440: ‘=’ cannot convert from WCHAR *[] [34] to ‘WCHAR *[18][34]


To my knowledge, both are declared as [18][34]

So having failed on two fronts, I open a third front in this war by editing C_AR2_Messages with
Class C_AR2_Messages
{ …
Friend class C_Configuration_Manager;


Then back in C_Configuration_Manager.cpp added this to access those member variables in C_AR2_Messages

Wstring test1 = common_parameter_names[ 0 ] [ 0 ];
Wstring test1 = C_Configuration_Manager ::common_parameter_names[ 0 ] [ 0 ];


So I have failed on all three attempts to gain access to that data in the configuration class. Will someone provide the knowledge I need to accomplish this task?
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com



modified 7-Jul-14 19:57pm.

AnswerRe: WCHAR, wstring, initializing and accessing them Pin
Richard MacCutchan2-Jul-14 6:38
mveRichard MacCutchan2-Jul-14 6:38 
Generalnarrowing the focus a bit Pin
bkelly132-Jul-14 10:59
Memberbkelly132-Jul-14 10:59 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan2-Jul-14 14:32
mveRichard MacCutchan2-Jul-14 14:32 
GeneralRe: narrowing the focus a bit Pin
bkelly132-Jul-14 18:00
Memberbkelly132-Jul-14 18:00 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan3-Jul-14 5:17
mveRichard MacCutchan3-Jul-14 5:17 
GeneralRe: narrowing the focus a bit Pin
bkelly133-Jul-14 18:24
Memberbkelly133-Jul-14 18:24 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 1:36
mveRichard MacCutchan4-Jul-14 1:36 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 2:13
Memberbkelly134-Jul-14 2:13 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 2:45
mveRichard MacCutchan4-Jul-14 2:45 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 4:08
mveRichard MacCutchan4-Jul-14 4:08 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 6:02
Memberbkelly134-Jul-14 6:02 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 6:40
mveRichard MacCutchan4-Jul-14 6:40 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 8:07
Memberbkelly134-Jul-14 8:07 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 8:21
mveRichard MacCutchan4-Jul-14 8:21 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 9:20
Memberbkelly134-Jul-14 9:20 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 21:10
mveRichard MacCutchan4-Jul-14 21:10 
Generalreasons Pin
bkelly135-Jul-14 8:22
Memberbkelly135-Jul-14 8:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.