Re: Problem with old code, works under VC++ 6 but not VC 2005.
- From: "Tom Widmer [VC++ MVP]" <tom_usenet@xxxxxxxxxxx>
- Date: Thu, 02 Nov 2006 11:07:34 +0000
T G wrote:
I have an old project for a DLL we use for Excel. When I build the project as Release in Visual C++ 6 it works fine. But when I build the project in Visual Studio 2005 it will not work. The problem I have is in the following code (I have reduced the code to only include the interesting part):
#define rgFuncsRows 2
static LPSTR rgFuncs[rgFuncsRows][7] =
{ // Procedure type_text function_text argument_text macro_type category shortcut_text
{" TEST1", " RR", " TEST1", " Arg", " 1", " ABC", " "},
{" TEST2", " RR", " TEST2", " Arg", " 1", " ABC", " "},
};
In addition to the other comments, you can fix your code by changing the above to:
#define rgFuncsRows 2
#define MAX_STR_LEN 10
static char rgFuncs[rgFuncsRows][7][MAX_STR_LEN + 1] =
{ // Procedure type_text function_text argument_text macro_type category shortcut_text
{" TEST1", " RR", " TEST1", " Arg",
" 1", " ABC", " "},
{" TEST2", " RR", " TEST2", " Arg",
" 1", " ABC", " "},
};
where MAX_STR_LEN is greater than or equal to the length of the longest string literal in the list of initializers.
Tom
.
- Prev by Date: WTSOpenServer Windows 2000 Professional issue
- Next by Date: Re: SMP - dual/triple/?? processor programming
- Previous by thread: Re: Problem with old code, works under VC++ 6 but not VC 2005.
- Next by thread: Re: overriding global operator new/delete
- Index(es):
Relevant Pages
|