Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.08.28;
Скачать: CL | DM;

Вниз

ExecuteIORedirect   Найти похожие ветки 

 
Rocket ©   (2005-01-03 23:11) [0]

Настало время, когда наконец действительно надо использовать, а терпение на исходе. Помогите, плиз. Так работающего примера и не встретил.


 
ECM ©   (2005-01-04 11:14) [1]

А куда, если не секрет, ты Exeute редиректить собираешься?
:)


 
Rocket ©   (2005-01-04 19:37) [2]

Как куда? В свою программу. GUI тут для одной консольной программки решил сбацать, но так, чтобы сама консоль не появлялась :)

Не пойму я эти пайпы :) Покажите пример!?


 
Rocket ©   (2005-01-05 08:25) [3]

Нашёл такую интересную штуку: http://rocket.web1000.com/DosCommand.zip

Проблема в том, что она для VCL. Портануть бы...


 
Rocket ©   (2005-01-05 09:14) [4]

Немного информация про вышеуказанное для тех, кто не хочет качать всё подряд:
 - вес zip"а - 8 кб;
 - некоторые свойства можно редактировать в IDE;
 - почти повсеместно используется, естественно, WinAPI (так что портить почти нечего).

Можете хотя бы дать мануал по портированию :)


 
Rocket ©   (2005-01-05 17:39) [5]

А вещь-то хорошая, работает! Кому чем не нравится? Мне - тем, что её нет в KOL"n"MCK...

Вот только похоже, что теперь, чтобы тебя здесь хоть кто-то услышал, надо писать исключительно на английском :)


 
Rocket ©   (2005-01-05 19:01) [6]

:))))))))))))))))

OK.
Hello. My name is Evgeny. I am eighteen years old. I live and work in Russia, Orenburg city. I like to use KOL when writing my programs because the resulting exe-files are very small and fast.

Some time ago I wanted to write a graphical user interface for command-line-based program <xxx> (put any command-line-based program instead of <xxx>). The thing is that I saw many GUIs that launch such apps without console window showing up. Instead they show all the progress and statistics info right on the GUI form. That looks great. I named this thread "ExecuteIORedirect" (I"d rename it, but you can"t rename your own thread on this forum) beacause I wanted to redirect console output to my form (and this function supposed to do this exactly). But I didn"t understand how to use it.

So I"ve continue my research and found this interesting component - DosCommand (look for the download link above). It"s very simple to use and it does just what I want. But the one thing makes it useless to me: it"s for VCL.

I know that it"s simple to convert this little component to KOL (and MCK) because it uses mostly WinAPI code. But I just didn"t see any manuals for converting, or examples of the same component in VCL and KOL+MCK, so I don"t know where and what should I change.

All I wanted to ask you, Dear Delphi and KOL Masters, is to convert this thing or give me a guide on how this is done.

Thank you, Best Regards.
Rocket

:))))))))))))))))

Надеюсь, модераторы простят прикол.


 
Rocket ©   (2005-01-06 12:10) [7]

Нашёл док по созданию компонент на bonanzas.rinet.ru... Вот там как раз такой случай описан - Writing non-visual "components" и Writing a mirror for non-visual component. Пытаюсь, пока неудачно... Помогите уже, а? :)


 
ECM ©   (2005-01-06 13:25) [8]

>Помогите уже...
Нет, так не правильно ... ты хочешь чтобы за тебя все делали?
Пока это кому-нибудь действительно не понадобится - никто
портировать не будет.
Попытайся конкретно сформулировать, что ты делал и, что у тебя не получается... Тогда может, кто-нибудь и подскажет... :)
Правильно сформулированный вопрос - половина ответа...


 
Rocket ©   (2005-01-06 13:41) [9]

ECM, спасибо хоть за какой-то ответ.

Я не требовал, чтобы всё делали за меня, а просил помочь...


> Пока это кому-нибудь действительно не понадобится

Мне действительно понадобилось :)


> Попытайся конкретно сформулировать, что ты делал и, что
> у тебя не получается...

:) Невохможно сформулировать конкретно, как бы я ни пытался... Я ж говорю про то, как мне сделать самому, если ни примеров, ни инструкций нет? Пытаюсь методом тыка, заменил (как-то :) ) классы на объекты, конструкторы Create функциями NewXXX, указатели на объекты добавил. Даже один раз всё скомпилилось, когда я пол-кода закомментировал :) Уже голова пухнет :)

(Под примерами подразумевается один и тот же невизуальный компонент с зеркалом, написанный под VCL и под KOL - тогда можно будет с чего-то брать пример).


 
ECM ©   (2005-01-06 14:12) [10]

>Уже голова пухнет :)
А никто и не говорил, что будет легко ...:)
Что тут можно посоветовать - хорошо разберись c VCL-вариантом - как там что работает.
И начинай писать свой вариант (по кусочкам - разбей задачу на более мелкие подзадачи), но уже на КОЛ...
Примеры как и чего делается на КОЛ в 90% случаев расположены в KOL.PAS :)


 
Rocket ©   (2005-01-09 11:28) [11]

http://rocket.thefreebizhost.com/KOLDosCommand.zip (5K)

Было не легко. Но и не работает :(

Может кто-нибудь хотя бы посмотреть, что я сделал не так? Исправить? Пожалуйста? :)


 
thaddy   (2005-01-09 12:34) [12]

Another solution may be this:
http://members.chello.nl/t.koning8/consoledemo.zip

It is pure KOL and has some adnatages over the KOL functions (Line by line event);


 
Rocket ©   (2005-01-09 12:48) [13]

Wow! Thanks! It works! :)


 
Rocket ©   (2005-01-09 13:14) [14]

But it works in different way :(

1) it gives output only after terminating the process;
2) output is not always there.

DosCommand does not have these issues. Maybe we should try to merge them?


 
thaddy   (2005-01-09 13:37) [15]

Only the demo works in a different way...
Use the OnNewLine event and everything works as you would want it..
The code is a bit old but I remember that it works that way.
I will have a look at doscommand


 
thaddy   (2005-01-09 13:46) [16]

Only this change:

Edit.Add(List.Items[List.Count-1]+#13#10);


 
Rocket ©   (2005-01-09 14:15) [17]

Nope. It"s still no output. Try, for example, lame.exe in the process of something. It won"t give me no output at all. Though "--help" works but AFTER exiting with code 0.


 
Rocket ©   (2005-01-09 15:54) [18]

What do you mean "Only the demo works in a different way..."?
Demo uses OnNewLine too...

"I will have a look at doscommand"
Please...


 
thaddy   (2005-01-09 16:46) [19]

UNTESTED but should work 99%:
http://members.chello.nl/t.koning8/koldoscommand.pas


 
Rocket ©   (2005-01-09 17:57) [20]

Any example of usage would be very appreciated as I"m having problems using it.

What PThread should I pass as sender to DosCommand.Execute?
What (and how) should I assign to DosCommand.OnNewLine?


 
thaddy   (2005-01-09 18:50) [21]

It is exactly the same as the original except for the thread parameter! I just translated it Q&D
You can cast it to DosCommand Fthread if you put that in the public section or add a property Thread that reads FThread.


 
Rocket ©   (2005-01-09 19:59) [22]

I did the same as in VCL and I got no output... :(


 
Rocket ©   (2005-01-09 20:00) [23]

And...

//You can cast it to DosCommand Fthread if you put that in the public section or add a property Thread that reads FThread.

...why is that?


 
thaddy   (2005-01-10 20:27) [24]

I promised Evgeny I will test it, and fix it. Can take a couple of days....
Haven"t got much time.
But I know the translation must be very close since everything is 99% the same. Maybe some help?


 
thaddy   (2005-01-20 11:19) [25]

As promised I have emailed Rocket two alpha"s 001 and 0.03 of the doscommand.pas translation for KOL that work but still have small issues. The last one is available as a private download or email attachment.
I"ll give you the link if you email me at: kol[@]chello.nl if you may want to help resolve the last issues.
The weirdest bug is that it only works with {$OPTIMIZE OFF} ???
And it has some memory leaks inherited from the original code.



Страницы: 1 вся ветка

Текущий архив: 2005.08.28;
Скачать: CL | DM;

Наверх




Память: 0.53 MB
Время: 0.033 c
3-1121338260
Леонид
2005-07-14 14:51
2005.08.28
Узнать и передать значение если запись с пометкой на удаление...


14-1122964668
dmitry99
2005-08-02 10:37
2005.08.28
День Десантника.


14-1122969123
Суслик
2005-08-02 11:52
2005.08.28
Няня


3-1121810728
NickMan
2005-07-20 02:05
2005.08.28
ADOTable и DBGrid


1-1123656701
Juice
2005-08-10 10:51
2005.08.28
TValueListEditor с жестким выпадающий список