
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI All,
I have *.arx, which i am loading into Autocad using appload *.arx file.
I intend to draw a line by using SendCmdToAcad
read(string cmd )
{
wchar_t wptr[50] = {0};
cmd += "\n";
char2wchar(cmd.c_str(), wptr);
SendCmdToAcad(wptr);
}
static void SendCmdToAcad(ACHAR *cmd)
{
COPYDATASTRUCT cmdMsg;
cmdMsg.dwData = (DWORD)1;
cmdMsg.cbData = (DWORD)(_tcslen(cmd) + 1) * sizeof(ACHAR);
cmdMsg.lpData = cmd;
HWND hwnd = adsw_acadMainWnd();
SendMessage(hwnd, WM_COPYDATA, NULL, (LPARAM)&cmdMsg);
}
The sequence is
command: _line -> SendMessage() works fine sends to autocad and SendMessage() returns from call
Specify first point: 10,20,0
Specify next point or [Undo]: : After sending 1st point sendmessage blocks here , does not return from the call, until i explicitly hit "ENTER" key on Autocad window.
How do i solve the problem programmatically of hitting "enter" key after point.
In my read() -> above If i do
cmd += "\n\n";
then it escapes reading the second point as well
Specify next point or [Undo]:
Please let me know, any pointers would be greatly appreciated. I need to get this done.
Thank you.
Observed Behaviour
10,20,30\0 : reads point on same line as in (10,20,30|123,300,10)
no | in real life just indicative of end of 1 point
10,20,30\n : blocks
10,20,30\n\n : skips the next point reading
10,20,30(1char)\n: if (1char) any character is added it goes fine, but point becomes invalid
Solved! Go to Solution.