View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004513 | JEDI VCL | 00 JVCL Components | public | 2008-10-09 05:14 | 2008-10-09 09:20 |
Reporter | A7M | Assigned To | AHUser | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | 3.36 | |||
Summary | 0004513: TJvCreateProcess and console application causes EAccessViolation in CB2009 | ||||
Description | I use TJvCreateProcess and tried to read the output of the console application into TMemo. However, EAccessViolation occurs and application crashes. | ||||
Additional Information | 1. Create new C++Builder Project. 2. Put to form TMemo and TButton and JvCreateProcess. 3. Describe these event procedures. 4. Build and run application. ---------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { JvCreateProcess1->ConsoleOptions = JvCreateProcess1->ConsoleOptions << coRedirect; JvCreateProcess1->CommandLine = "cmd.exe /c dir C:\\windows\\system32"; JvCreateProcess1->Run(); } void __fastcall TForm1::JvCreateProcess1Read(TObject *Sender, const AnsiString S, const bool StartsOnNewLine) { if (StartsOnNewLine) { Memo2->Lines->Add(S); } else { int Last = Memo2->Lines->Count - 1; if (Last < 0) { Memo2->Lines->Add(S); } else { AnsiString ss = Memo2->Lines->Strings[Last]; ss += S; Memo2->Lines->Strings[Last] = ss; } } } ---------------------------------------- | ||||
Tags | No tags attached. | ||||
|
Please post the zipped sources of a sample application showing this. |
2008-10-09 06:15
|
JvCreateProcess1.7z (18,669 bytes) |
|
This error is caused in Windows Vista x86 and Windows Vista x64. |
|
The problem is that "CommandLine" is a constant string and CreateProcessW writes to the lpszCommandLine parameter what causes an access violation. CreateProcessA doesn't do that. I've fixed this by using "Copy()" if the string is a constant string. |
Date Modified | Username | Field | Change |
---|---|---|---|
2008-10-09 05:14 | A7M | New Issue | |
2008-10-09 05:32 | obones | Note Added: 0014793 | |
2008-10-09 05:32 | obones | Status | new => feedback |
2008-10-09 06:15 | A7M | File Added: JvCreateProcess1.7z | |
2008-10-09 06:17 | A7M | Note Added: 0014795 | |
2008-10-09 09:19 | AHUser | Status | feedback => resolved |
2008-10-09 09:19 | AHUser | Fixed in Version | => Daily / SVN |
2008-10-09 09:19 | AHUser | Resolution | open => fixed |
2008-10-09 09:19 | AHUser | Assigned To | => AHUser |
2008-10-09 09:19 | AHUser | Note Added: 0014797 |