Форум программистов, компьютерный форум, киберфорум
Delphi
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.56/43: Рейтинг темы: голосов - 43, средняя оценка - 4.56
0 / 0 / 1
Регистрация: 03.11.2011
Сообщений: 42
1

project1.dpr большое кол-во ошибок помогите

04.11.2011, 07:38. Показов 8127. Ответов 10
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
program Project1.dpr;
 
uses shellapi;
  Forms,
  Unit1 in 'Unit1.pas' {Form1};
 
{$R *.res}
 
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
 
  end.
вот мой код добавил только в uses shellapi;
потому что у меня вылезало

[Error] Unit1.pas(28): Undeclared identifier: 'ShellExecute'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

а сейчас вылезает:

[Error] Project1.dpr(4): Declaration expected but identifier 'Forms' found
[Warning] Project1.dpr(7): File not found: 'Project1.dpr.res'
[Error] Project1.dpr(10): Undeclared identifier: 'Application'
[Error] Project1.dpr(10): Missing operator or semicolon
[Error] Project1.dpr(11): Missing operator or semicolon
[Error] Project1.dpr(11): Undeclared identifier: 'TForm1'
[Error] Project1.dpr(12): Missing operator or semicolon
Что мне делать может код не правильно написан?
Помогите разобраться...

Добавлено через 1 час 36 минут
вроде разобрался теперь нет ошибок,но действий не каких не происходит?
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(form1.handle,'open','wow_circle.exe',nil,nil,sw_show);
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
 
end;
 
end.
Не запускается игра я кликаю по кнопке не чего не происходит.

Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
program Project1;
 
uses
  Forms,
  Unit1 in 'C:\program files\borland\delphi7\project1\Unit1.pas' {Form1};
 
{$R *.res}
 
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
указал путь к unit1.pas и убрал shellapi,но нечего не происходит программа открывается жму на кнопку,но не открывается игра,если ставлю shellapi,то происходит многое кол-во ошибок вроде этих
use shellapi;
[Error] Project1.dpr(4): Declaration expected but identifier 'Forms' found
[Error] Project1.dpr(10): Undeclared identifier: 'Application'
[Error] Project1.dpr(10): Missing operator or semicolon
[Error] Project1.dpr(11): Missing operator or semicolon
[Error] Project1.dpr(11): Undeclared identifier: 'TForm1'
[Error] Project1.dpr(12): Missing operator or semicolon

Добавлено через 7 минут
сейчас попробывал добавить shellapi в другую ячейку все ошибки исчезли...но нечего не происходит по прежнему!
Delphi
1
2
3
uses shellapi, Classes, Controls, StdCtrls;
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
Classes, Controls, StdCtrls; вот что добавил мне сам делфи
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
04.11.2011, 07:38
Ответы с готовыми решениями:

Ошибка: [dcc32 Error] Project1.dpr(467): E2010 Incompatible types: 'PD3DRect' and '_D3DRECT'
Всем привет! Есть такой код вывода прицела на экран: int x = ( GetSystemMetrics( 0 ) / 2); int...

Ошибка "[Fatal Error] Project1.dpr(14): File not found: 'RpCon.dcu'". Что делать?
Выдает такую ошибку " Project1.dpr(14): File not found: 'RpCon.dcu'"что делать ?подскажите...

[dcc32 Fatal Error] Project1.dpr(15): F1026 File not found
У меня делфи выдает ошибку: Project1.dpr(15): F1026 File not found:...

[Fatal Error] Project1.dpr(5): File not found: 'Forms.dcu'
Ребята, нужна помощь , буду заранее благодарен . Вот , собственно , сама проблема

10
Заблокирован
04.11.2011, 11:36 2
Delphi
1
2
3
uses shellapi, Classes, Controls, StdCtrls; //Вот тут нужна "," 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
Должно быть так:
Delphi
1
2
3
uses shellapi, Classes, Controls, StdCtrls,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
1
0 / 0 / 1
Регистрация: 03.11.2011
Сообщений: 42
04.11.2011, 12:15  [ТС] 3
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
unit Unit1;
 
interface
 
uses shellapi, Classes, Controls, StdCtrls,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(form1.handle,'open','wow_circle.exe',nil,nil,sw_show);
end;
 
end.
поправил,но стали вылезать другие ошибки..



[Error] Unit1.pas(6): Identifier redeclared: 'Classes'
[Error] Unit1.pas(6): Identifier redeclared: 'Controls'
[Error] Unit1.pas(7): Identifier redeclared: 'StdCtrls'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
а когда жму run вот эта строка загарается красным.
Delphi
1
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Добавлено через 6 минут
Все понел удалил повторные прописи Classes, Controls, StdCtrls,
теперь не выдаёт ошибку,но жму на кнопку не запускается игра
кнопка вот
Delphi
1
ShellExecute(form1.handle,'open','wow_circle.exe',nil,nil,sw_show);
0
Заблокирован
04.11.2011, 12:16 4
Замените
Delphi
1
2
3
uses shellapi, Classes, Controls, StdCtrls,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
на
Delphi
1
2
3
uses shellapi, 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
Компилятор же пишет, что повторное объявление идентификатора "Classes" и остальных. Два раза подключены модули, вот и вся беда.
1
0 / 0 / 1
Регистрация: 03.11.2011
Сообщений: 42
04.11.2011, 12:22  [ТС] 5
Цитата Сообщение от AndyZorg Посмотреть сообщение
Замените
Delphi
1
2
3
uses shellapi, Classes, Controls, StdCtrls,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
на
Delphi
1
2
3
uses shellapi, 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
Компилятор же пишет, что повторное объявление идентификатора "Classes" и остальных. Два раза подключены модули, вот и вся беда.
Спасибо не могли бы помочь в кнопке не запускается?
прописал вроде норм.
Delphi
1
ShellExecute(form1.handle,'open','wow_circle.exe',nil,nil,sw_show);
Пытался указать полный пусть к exe но выдаёт вирус dr.web троян.
0
Заблокирован
04.11.2011, 12:33 6
Вероятно wow_circle.exe заражен трояном. Прогоните машину антивирем. Код правильный, видимо DrWeb не дает запуститься.
0
0 / 0 / 1
Регистрация: 03.11.2011
Сообщений: 42
04.11.2011, 12:47  [ТС] 7
Спасибо,но у меня есть вопрос вот смотрите я указал путь D:\что-то\кто-то.exe,но у других играков же будет по другому как мне сделать чтобы он сам искал этот путь,а то у все по разному размещен этот exe
можете сказать свой скайп так будет проще мне объяснить проблему(
0
Заблокирован
04.11.2011, 12:51 8
Все вопросы на форуме обсуждаются публично. См. правила. Вам надо сделать у себя возможность указать пользователю путь к программе, которую вы хотите запустить. Сделать это можно множеством способов:
1. При помощи диалога TOpenDialog
2. Ручками через ini файл, где пользователь укажет сам путь к файлу
3. Поиском на всех дисках во всех каталогах нужного Вам файла.
Самый простой и понятный - №1.
0
0 / 0 / 1
Регистрация: 03.11.2011
Сообщений: 42
04.11.2011, 12:59  [ТС] 9
А где первый пункт находится и как он прописывается?

Добавлено через 3 минуты
Можете пока не выходить вы 1 человек который поможет=)
0
Заблокирован
04.11.2011, 13:28 10
Прикрепите сюда свой проект - в расширенном режиме ответа можно приложить файлы к ответу. Поправлю Ваш проект
0
0 / 0 / 1
Регистрация: 03.11.2011
Сообщений: 42
04.11.2011, 13:41  [ТС] 11
Delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
unit Unit1;
 
interface
 
uses shellapi, Classes, Controls, StdCtrls,
  Windows, Messages, SysUtils, Variants, Graphics, Forms,
  Dialogs, jpeg, ExtCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Image1: TImage;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Image2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(form1.handle,'open','wow.exe',nil,nil,sw_show);
end;
 
procedure TForm1.Button2Click(Sender: TObject);
begin
if Form1.CloseQuery then Form1.Close;
end;
 
procedure TForm1.Button3Click(Sender: TObject);
begin
ShellExecute (Form1.Handle, nil, 'http://wowcircle.com', nil, nil, SW_RESTORE);
end;
 
procedure TForm1.Button4Click(Sender: TObject);
begin
ShellExecute (Form1.Handle, nil, 'http://virgin.wowcircle.com/', nil, nil, SW_RESTORE);
end;
 
procedure TForm1.Button5Click(Sender: TObject);
begin
ShellExecute (Form1.Handle, nil, 'http://cp2.wowcircle.com/', nil, nil, SW_RESTORE);
end;
 
procedure TForm1.Button6Click(Sender: TObject);
begin
ShellExecute (Form1.Handle, nil, 'http://cp.wowcircle.com/', nil, nil, SW_RESTORE);
end;
 
procedure TForm1.Image2Click(Sender: TObject);
begin
 
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
 
end;
 
end.

project1.dpr большое кол-во ошибок помогите


И как сделать так чтобы накласть на кнопку картинку я ее сделал через button shop 3,но она не поверх кнопки я незнаю как подцепить ее к кнопке
0
04.11.2011, 13:41
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
04.11.2011, 13:41
Помогаю со студенческими работами здесь

При запуске ошибка [dcc32 Error] Project1.dpr(12): E2003 Undeclared identifier: 'Form1'
Доброго времени суток! :) Пытаюсь написать электронный учебник с тестом. Пока только с тестом...

Ошибка: [Error] Project1.dpr(11): Constant object cannot be passed as var parameter Operator not applicable to this operand type
Помогите пожалуйста, в чем ошибка? помогите решить unit Unit1; interface uses Windows,...

Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 007B90DA in module 'Project1.exe'...
При нажатии кнопки "Добавить запись" должна показываться вторая форма, вместо этого ошибка ...

Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 0045DC8E in module 'Project1.exe'. Write of ad'
Всем доброго времени суток, у меня возникла вот такая проблема, после компиляции проекта, при...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
11
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru