Click here to Skip to main content
15,889,116 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionCreating Classes in VS 2013 Pin
Bram van Kampen9-Aug-14 15:22
Bram van Kampen9-Aug-14 15:22 
AnswerRe: Creating Classes in VS 2013 Pin
Richard Andrew x649-Aug-14 17:50
professionalRichard Andrew x649-Aug-14 17:50 
Questionerror - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Swap95-Aug-14 21:40
Swap95-Aug-14 21:40 
AnswerRe: error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Richard MacCutchan5-Aug-14 22:34
mveRichard MacCutchan5-Aug-14 22:34 
AnswerRe: error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' Pin
Subrat 470826612-Sep-14 15:15
Subrat 470826612-Sep-14 15:15 
Questionhow to let menu auto show next item when mouse on the bottom arrow of menu Pin
fengforky9-Jul-14 22:53
fengforky9-Jul-14 22:53 
AnswerRe: how to let menu auto show next item when mouse on the bottom arrow of menu Pin
Richard MacCutchan9-Jul-14 23:34
mveRichard MacCutchan9-Jul-14 23:34 
QuestionWCHAR, wstring, initializing and accessing them (RESOLVED) Pin
bkelly131-Jul-14 10:13
bkelly131-Jul-14 10: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:
CSS
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
VB
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

CSS
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 5:38
mveRichard MacCutchan2-Jul-14 5:38 
Generalnarrowing the focus a bit Pin
bkelly132-Jul-14 9:59
bkelly132-Jul-14 9:59 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan2-Jul-14 13:32
mveRichard MacCutchan2-Jul-14 13:32 
GeneralRe: narrowing the focus a bit Pin
bkelly132-Jul-14 17:00
bkelly132-Jul-14 17:00 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan3-Jul-14 4:17
mveRichard MacCutchan3-Jul-14 4:17 
GeneralRe: narrowing the focus a bit Pin
bkelly133-Jul-14 17:24
bkelly133-Jul-14 17:24 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 0:36
mveRichard MacCutchan4-Jul-14 0:36 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 1:13
bkelly134-Jul-14 1:13 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 1:45
mveRichard MacCutchan4-Jul-14 1:45 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 3:08
mveRichard MacCutchan4-Jul-14 3:08 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 5:02
bkelly134-Jul-14 5:02 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 5:40
mveRichard MacCutchan4-Jul-14 5:40 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 7:07
bkelly134-Jul-14 7:07 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 7:21
mveRichard MacCutchan4-Jul-14 7:21 
GeneralRe: narrowing the focus a bit Pin
bkelly134-Jul-14 8:20
bkelly134-Jul-14 8:20 
GeneralRe: narrowing the focus a bit Pin
Richard MacCutchan4-Jul-14 20:10
mveRichard MacCutchan4-Jul-14 20:10 
Generalreasons Pin
bkelly135-Jul-14 7:22
bkelly135-Jul-14 7: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.