acedGetString problem

acedGetString problem

Anonymous
Not applicable
622 Views
1 Reply
Message 1 of 2

acedGetString problem

Anonymous
Not applicable
I am new at C++ and ObjectARX so this may be a very simple question. I am simply trying to get a string from a user where they may type any number of characters or spaces. Here is the getstring code i am using:
acedGetString(true, "\nPlease type your info..", &spreadloca);

When the user types a string of 4 characters or less life is good, but if they type more I get an error. The error is.. Unhandled Exception 2 (Access Violation Reading 0x001c) at address 646E6372h.
Does anyone know why Im having this problem?
Thanks in advance
Nick
0 Likes
623 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hi Nick,

Make sure your variable spreadloca is a char* with enough space allocated to
it to store the string. Since acedGetString will never return more than 132
characters, try this this:
char spreadloca[133];
acedGetString(true, "\nPlease type your info..", spreadloca);

Hope this helps,

Jon Rizzo
Langan Engineering and Environmental Services, Inc.


"npuza" wrote in message
news:[email protected]...
> I am new at C++ and ObjectARX so this may be a very simple question. I am
simply trying to get a string from a user where they may type any number of
characters or spaces. Here is the getstring code i am using:
> acedGetString(true, "\nPlease type your info..", &spreadloca);
> When the user types a string of 4 characters or less life is good, but if
they type more I get an error. The error is.. Unhandled Exception 2 (Access
Violation Reading 0x001c) at address 646E6372h.
> Does anyone know why Im having this problem?
> Thanks in advance
> Nick
>
>
0 Likes