Форум программистов, компьютерный форум, киберфорум
C++/CLI
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
 
Рейтинг 5.00/20: Рейтинг темы: голосов - 20, средняя оценка - 5.00
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182

Поиск файлов по маске

24.03.2012, 13:12. Показов 4307. Ответов 22
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Пытаюсь сделать поиск файлов в текущей директории, но вылазит 2 ошибки и не могу понять что с ней делать!
Вот код:
C++
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
#pragma once
#include <windows.h>
 
namespace os {
 
    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
 
    /// <summary>
    /// Сводка для Form1
    /// </summary>
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: добавьте код конструктора
            //
        }
 
    protected:
        /// <summary>
        /// Освободить все используемые ресурсы.
        /// </summary>
        ~Form1()
        {
            if (components)
            {
                delete components;
            }
        }
    private: System::Windows::Forms::MenuStrip^  menuStrip1;
    protected: 
    private: System::Windows::Forms::ToolStripMenuItem^  выберитеМаскуToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поРасширениюToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поНазваниюToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поРазмеруToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поДатеСозданияToolStripMenuItem;
    private: System::Windows::Forms::TabControl^  Маски;
    private: System::Windows::Forms::TabPage^  tabPage1;
    private: System::Windows::Forms::Button^  button5;
    private: System::Windows::Forms::CheckBox^  checkBox1;
    private: System::Windows::Forms::Button^  button4;
    private: System::Windows::Forms::RichTextBox^  richTextBox4;
    private: System::Windows::Forms::Label^  label4;
    private: System::Windows::Forms::Button^  button3;
    private: System::Windows::Forms::RichTextBox^  richTextBox3;
    private: System::Windows::Forms::Label^  label3;
    private: System::Windows::Forms::Button^  button2;
    private: System::Windows::Forms::Label^  label2;
    private: System::Windows::Forms::RichTextBox^  richTextBox2;
    private: System::Windows::Forms::Button^  button1;
    private: System::Windows::Forms::Label^  label1;
    private: System::Windows::Forms::RichTextBox^  richTextBox1;
    private: System::Windows::Forms::TabPage^  tabPage2;
    private: System::Windows::Forms::Button^  button6;
    private: System::Windows::Forms::OpenFileDialog^  openFileDialog1;
    private: System::Windows::Forms::RichTextBox^  richTextBox5;
 
    private:
        /// <summary>
        /// Требуется переменная конструктора.
        /// </summary>
        System::ComponentModel::Container ^components;
 
#pragma region Windows Form Designer generated code
        /// <summary>
        /// Обязательный метод для поддержки конструктора - не изменяйте
        /// содержимое данного метода при помощи редактора кода.
        /// </summary>
        void InitializeComponent(void)
        {
            this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
            this->выберитеМаскуToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поРасширениюToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поНазваниюToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поРазмеруToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поДатеСозданияToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->Маски = (gcnew System::Windows::Forms::TabControl());
            this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
            this->button6 = (gcnew System::Windows::Forms::Button());
            this->button5 = (gcnew System::Windows::Forms::Button());
            this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
            this->button4 = (gcnew System::Windows::Forms::Button());
            this->richTextBox4 = (gcnew System::Windows::Forms::RichTextBox());
            this->label4 = (gcnew System::Windows::Forms::Label());
            this->button3 = (gcnew System::Windows::Forms::Button());
            this->richTextBox3 = (gcnew System::Windows::Forms::RichTextBox());
            this->label3 = (gcnew System::Windows::Forms::Label());
            this->button2 = (gcnew System::Windows::Forms::Button());
            this->label2 = (gcnew System::Windows::Forms::Label());
            this->richTextBox2 = (gcnew System::Windows::Forms::RichTextBox());
            this->button1 = (gcnew System::Windows::Forms::Button());
            this->label1 = (gcnew System::Windows::Forms::Label());
            this->richTextBox1 = (gcnew System::Windows::Forms::RichTextBox());
            this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
            this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog());
            this->richTextBox5 = (gcnew System::Windows::Forms::RichTextBox());
            this->menuStrip1->SuspendLayout();
            this->Маски->SuspendLayout();
            this->tabPage1->SuspendLayout();
            this->tabPage2->SuspendLayout();
            this->SuspendLayout();
            // 
            // menuStrip1
            // 
            this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->выберитеМаскуToolStripMenuItem});
            this->menuStrip1->Location = System::Drawing::Point(0, 0);
            this->menuStrip1->Name = L"menuStrip1";
            this->menuStrip1->Size = System::Drawing::Size(686, 24);
            this->menuStrip1->TabIndex = 1;
            this->menuStrip1->Text = L"menuStrip1";
            // 
            // выберитеМаскуToolStripMenuItem
            // 
            this->выберитеМаскуToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {this->поРасширениюToolStripMenuItem, 
                this->поНазваниюToolStripMenuItem, this->поРазмеруToolStripMenuItem, this->поДатеСозданияToolStripMenuItem});
            this->выберитеМаскуToolStripMenuItem->Name = L"выберитеМаскуToolStripMenuItem";
            this->выберитеМаскуToolStripMenuItem->Size = System::Drawing::Size(109, 20);
            this->выберитеМаскуToolStripMenuItem->Text = L"Выберите маску";
            // 
            // поРасширениюToolStripMenuItem
            // 
            this->поРасширениюToolStripMenuItem->Name = L"поРасширениюToolStripMenuItem";
            this->поРасширениюToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поРасширениюToolStripMenuItem->Text = L"по расширению";
            // 
            // поНазваниюToolStripMenuItem
            // 
            this->поНазваниюToolStripMenuItem->Name = L"поНазваниюToolStripMenuItem";
            this->поНазваниюToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поНазваниюToolStripMenuItem->Text = L"по названию";
            // 
            // поРазмеруToolStripMenuItem
            // 
            this->поРазмеруToolStripMenuItem->Name = L"поРазмеруToolStripMenuItem";
            this->поРазмеруToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поРазмеруToolStripMenuItem->Text = L"по размеру";
            // 
            // поДатеСозданияToolStripMenuItem
            // 
            this->поДатеСозданияToolStripMenuItem->Name = L"поДатеСозданияToolStripMenuItem";
            this->поДатеСозданияToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поДатеСозданияToolStripMenuItem->Text = L"по дате создания";
            // 
            // Маски
            // 
            this->Маски->Controls->Add(this->tabPage1);
            this->Маски->Controls->Add(this->tabPage2);
            this->Маски->Location = System::Drawing::Point(0, 27);
            this->Маски->Name = L"Маски";
            this->Маски->SelectedIndex = 0;
            this->Маски->Size = System::Drawing::Size(688, 333);
            this->Маски->TabIndex = 2;
            // 
            // tabPage1
            // 
            this->tabPage1->Controls->Add(this->button6);
            this->tabPage1->Controls->Add(this->button5);
            this->tabPage1->Controls->Add(this->checkBox1);
            this->tabPage1->Controls->Add(this->button4);
            this->tabPage1->Controls->Add(this->richTextBox4);
            this->tabPage1->Controls->Add(this->label4);
            this->tabPage1->Controls->Add(this->button3);
            this->tabPage1->Controls->Add(this->richTextBox3);
            this->tabPage1->Controls->Add(this->label3);
            this->tabPage1->Controls->Add(this->button2);
            this->tabPage1->Controls->Add(this->label2);
            this->tabPage1->Controls->Add(this->richTextBox2);
            this->tabPage1->Controls->Add(this->button1);
            this->tabPage1->Controls->Add(this->label1);
            this->tabPage1->Controls->Add(this->richTextBox1);
            this->tabPage1->Location = System::Drawing::Point(4, 22);
            this->tabPage1->Name = L"tabPage1";
            this->tabPage1->Padding = System::Windows::Forms::Padding(3);
            this->tabPage1->Size = System::Drawing::Size(680, 307);
            this->tabPage1->TabIndex = 0;
            this->tabPage1->Text = L"Маски";
            this->tabPage1->UseVisualStyleBackColor = true;
            // 
            // button6
            // 
            this->button6->Location = System::Drawing::Point(9, 43);
            this->button6->Name = L"button6";
            this->button6->Size = System::Drawing::Size(192, 23);
            this->button6->TabIndex = 16;
            this->button6->Text = L"Выбрать место поиска";
            this->button6->UseVisualStyleBackColor = true;
            // 
            // button5
            // 
            this->button5->Location = System::Drawing::Point(537, 272);
            this->button5->Name = L"button5";
            this->button5->Size = System::Drawing::Size(133, 23);
            this->button5->TabIndex = 14;
            this->button5->Text = L"Начать поиск";
            this->button5->UseVisualStyleBackColor = true;
            this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
            // 
            // checkBox1
            // 
            this->checkBox1->AutoSize = true;
            this->checkBox1->Location = System::Drawing::Point(358, 173);
            this->checkBox1->Name = L"checkBox1";
            this->checkBox1->Size = System::Drawing::Size(144, 17);
            this->checkBox1->TabIndex = 13;
            this->checkBox1->Text = L"Поиск внутри каталога";
            this->checkBox1->UseVisualStyleBackColor = true;
            // 
            // button4
            // 
            this->button4->Location = System::Drawing::Point(595, 137);
            this->button4->Name = L"button4";
            this->button4->Size = System::Drawing::Size(75, 23);
            this->button4->TabIndex = 11;
            this->button4->Text = L"Далее";
            this->button4->UseVisualStyleBackColor = true;
            // 
            // richTextBox4
            // 
            this->richTextBox4->Location = System::Drawing::Point(358, 105);
            this->richTextBox4->Name = L"richTextBox4";
            this->richTextBox4->Size = System::Drawing::Size(313, 26);
            this->richTextBox4->TabIndex = 10;
            this->richTextBox4->Text = L"";
            // 
            // label4
            // 
            this->label4->AutoSize = true;
            this->label4->Location = System::Drawing::Point(355, 86);
            this->label4->Name = L"label4";
            this->label4->Size = System::Drawing::Size(130, 13);
            this->label4->TabIndex = 9;
            this->label4->Text = L"Впишите дату создания:";
            // 
            // button3
            // 
            this->button3->Location = System::Drawing::Point(596, 76);
            this->button3->Name = L"button3";
            this->button3->Size = System::Drawing::Size(75, 23);
            this->button3->TabIndex = 8;
            this->button3->Text = L"Далее";
            this->button3->UseVisualStyleBackColor = true;
            // 
            // richTextBox3
            // 
            this->richTextBox3->Location = System::Drawing::Point(358, 45);
            this->richTextBox3->Name = L"richTextBox3";
            this->richTextBox3->Size = System::Drawing::Size(313, 25);
            this->richTextBox3->TabIndex = 7;
            this->richTextBox3->Text = L"";
            // 
            // label3
            // 
            this->label3->Location = System::Drawing::Point(0, 0);
            this->label3->Name = L"label3";
            this->label3->Size = System::Drawing::Size(100, 23);
            this->label3->TabIndex = 15;
            // 
            // button2
            // 
            this->button2->Location = System::Drawing::Point(244, 173);
            this->button2->Name = L"button2";
            this->button2->Size = System::Drawing::Size(75, 23);
            this->button2->TabIndex = 5;
            this->button2->Text = L"Далее";
            this->button2->UseVisualStyleBackColor = true;
            // 
            // label2
            // 
            this->label2->AutoSize = true;
            this->label2->Location = System::Drawing::Point(6, 122);
            this->label2->Name = L"label2";
            this->label2->Size = System::Drawing::Size(105, 13);
            this->label2->TabIndex = 4;
            this->label2->Text = L"Впишите название:";
            // 
            // richTextBox2
            // 
            this->richTextBox2->Location = System::Drawing::Point(6, 141);
            this->richTextBox2->Name = L"richTextBox2";
            this->richTextBox2->Size = System::Drawing::Size(313, 26);
            this->richTextBox2->TabIndex = 3;
            this->richTextBox2->Text = L"";
            // 
            // button1
            // 
            this->button1->Location = System::Drawing::Point(247, 233);
            this->button1->Name = L"button1";
            this->button1->Size = System::Drawing::Size(75, 23);
            this->button1->TabIndex = 2;
            this->button1->Text = L"Далее";
            this->button1->UseVisualStyleBackColor = true;
            // 
            // label1
            // 
            this->label1->AutoSize = true;
            this->label1->Location = System::Drawing::Point(6, 183);
            this->label1->Name = L"label1";
            this->label1->Size = System::Drawing::Size(119, 13);
            this->label1->TabIndex = 1;
            this->label1->Text = L"Впишите расширение:";
            // 
            // richTextBox1
            // 
            this->richTextBox1->Location = System::Drawing::Point(9, 202);
            this->richTextBox1->Name = L"richTextBox1";
            this->richTextBox1->Size = System::Drawing::Size(313, 25);
            this->richTextBox1->TabIndex = 0;
            this->richTextBox1->Text = L"";
            // 
            // tabPage2
            // 
            this->tabPage2->Controls->Add(this->richTextBox5);
            this->tabPage2->Location = System::Drawing::Point(4, 22);
            this->tabPage2->Name = L"tabPage2";
            this->tabPage2->Padding = System::Windows::Forms::Padding(3);
            this->tabPage2->Size = System::Drawing::Size(680, 307);
            this->tabPage2->TabIndex = 1;
            this->tabPage2->Text = L"Результат поиска";
            this->tabPage2->UseVisualStyleBackColor = true;
            // 
            // openFileDialog1
            // 
            this->openFileDialog1->FileName = L"openFileDialog1";
            // 
            // richTextBox5
            // 
            this->richTextBox5->Location = System::Drawing::Point(58, 93);
            this->richTextBox5->Name = L"richTextBox5";
            this->richTextBox5->Size = System::Drawing::Size(273, 96);
            this->richTextBox5->TabIndex = 0;
            this->richTextBox5->Text = L"";
            this->richTextBox5->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox5_TextChanged);
            // 
            // Form1
            // 
            this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(686, 356);
            this->Controls->Add(this->Маски);
            this->Controls->Add(this->menuStrip1);
            this->MainMenuStrip = this->menuStrip1;
            this->Name = L"Form1";
            this->Text = L"Поиск файлов";
            this->menuStrip1->ResumeLayout(false);
            this->menuStrip1->PerformLayout();
            this->Маски->ResumeLayout(false);
            this->tabPage1->ResumeLayout(false);
            this->tabPage1->PerformLayout();
            this->tabPage2->ResumeLayout(false);
            this->ResumeLayout(false);
            this->PerformLayout();
 
        }
 
private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
             WIN32_FIND_DATA FileData;
HANDLE hSearch;
DWORD dwAttrs;
char szDirPath[] = "c:\\TEXTRO\\";
char szNewPath[MAX_PATH];
char szHome[MAX_PATH];
 
BOOL fFinished = FALSE;
 
 
 
richTextBox5->AppendText(FileData);
hSearch = FindFirstFile("*.txt", &FileData);
if (hSearch == INVALID_HANDLE_VALUE)
{
 richTextBox5->AppendText("No .TXT files found.");
 return;
}
 
         }
private: System::Void richTextBox5_TextChanged(System::Object^  sender, System::EventArgs^  e) {
         }
};
}
Гляньте кто нибудь!
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
24.03.2012, 13:12
Ответы с готовыми решениями:

Поиск строки по маске
Привет всем! Подскажите, пожалуйста, каким образом средствами .NET (C# или VB) из массива строк найти строку, удовлетворяющую...

Поиск файлов по маске
Вот код который ищет директории var s:string; begin for s in TDirectory.GetDirectories('e:\','*z',TSearchOption(1)) do begin ...

Поиск файлов по маске
Имеется имя файла, например : файл.txt Как определить нет ли в папке таких же файлов, только с индексами, наприер: файл (1).txt , файл...

22
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
24.03.2012, 15:07
Сеня 2007, в Forms не работаю могу дать ссылки на уже готовый код
Поиск файла по шаблону
поиск файлов по строкам
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
24.03.2012, 15:53  [ТС]
В консоли это плохо. Мне нужно в виндовс форм ибо переправлять с консольного все равно что заново написать что я и пытаюсь сделать но что то не хочет работать. Помогите пожалуйста!
0
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
24.03.2012, 16:21
Цитата Сообщение от Сеня 2007 Посмотреть сообщение
В консоли это плохо. Мне нужно в виндовс форм ибо переправлять с консольного все равно что заново написать что я и пытаюсь сделать но что то не хочет работать. Помогите пожалуйста!
- просто импортируй мои функции поиска, это не потребует ровным счётом никаких изменений, алгоритм поиска у тебя неверный(на мой взгляд)

Цитата Сообщение от Сеня 2007 Посмотреть сообщение
HANDLE hSearch;
DWORD dwAttrs;
char szDirPath[] = "c:\\TEXTRO\\";
char szNewPath[MAX_PATH];
char szHome[MAX_PATH];
BOOL fFinished = FALSE;
richTextBox5->AppendText(FileData);
hSearch = FindFirstFile("*.txt", &FileData);
if (hSearch == INVALID_HANDLE_VALUE)
{
*richTextBox5->AppendText("No .TXT files found.");
*return;
}
}
private: System::Void richTextBox5_TextChanged(System::Object^ *sender, System::EventArgs^ *e) {
* * * * * * * * *}
};
Цитата Сообщение от Сеня 2007 Посмотреть сообщение
FindFirstFile("*.txt", &FileData);
- ну а если в каталоге вообще нет txt файлов + искать что именно txt-ники надо???
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
24.03.2012, 17:22  [ТС]
Нет. Вообще нужно ввести в textbox заданную маску. Как импортировать то? Там вывод даже тупо другой. У тебя cout а у меня вывод в textbox который требует чтобы у него все string было
0
 Аватар для СтуденT
6 / 6 / 1
Регистрация: 18.12.2011
Сообщений: 126
24.03.2012, 17:51
Параметр который твоя функция возвращает преобразуй в String
System::String^ str = gcnew String(твоя переменная); а потом в текстбокс выводи
textBox1->Text = str;
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
24.03.2012, 18:26  [ТС]
Какая моя переменная? Дело в том что там и нет никакой переменной.
0
 Аватар для СтуденT
6 / 6 / 1
Регистрация: 18.12.2011
Сообщений: 126
24.03.2012, 18:42
маску твою
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
25.03.2012, 23:58  [ТС]
Теперь 2 вот эти ошибки:

Ошибка 1 error C2664: System::String::String(const wchar_t *): невозможно преобразовать параметр 1 из "WIN32_FIND_DATA" в "const wchar_t *" 391 1 os
Ошибка 2 error C2664: FindFirstFileW: невозможно преобразовать параметр 1 из "const char [6]" в "LPCWSTR" 393 1 os
Что дальше сделать?

Добавлено через 1 час 41 минуту
Как вообще в windows form реализовать поиск? По какой функции?

Добавлено через 10 часов 15 минут
Как в виндовс форм подключить функции вин апи?

Добавлено через 12 часов 8 минут
Вот что у меня сейчас:
C++
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
#pragma once
#include <windows.h>
#include <WinBase.h>
 
 
namespace os {
 
        using namespace System;
        using namespace System::ComponentModel;
        using namespace System::Collections;
        using namespace System::Windows::Forms;
        using namespace System::Data;
        using namespace System::Drawing;
        
 
 
        /// <summary>
        /// Сводка для Form1
        /// </summary>
 
        public ref class Form1 : public System::Windows::Forms::Form
        {
        public:
                String ^text1;
                String ^nazvanie;
                String ^rashirenie;
                String ^datas;
                String ^mesto;
        private: System::Windows::Forms::FolderBrowserDialog^  folderBrowserDialog1;
        private: System::Windows::Forms::TextBox^  textBox1;
        public: 
                String ^razmer;
                Form1(void)
                {
                        InitializeComponent();
                        //
                        //TODO: добавьте код конструктора
                        //
                }
 
        protected:
                /// <summary>
                /// Освободить все используемые ресурсы.
                /// </summary>
                ~Form1()
                {
                        if (components)
                        {
                                delete components;
                        }
                }
        private: System::Windows::Forms::MenuStrip^  menuStrip1;
        protected: 
        private: System::Windows::Forms::ToolStripMenuItem^  выберитеМаскуToolStripMenuItem;
        private: System::Windows::Forms::ToolStripMenuItem^  поРасширениюToolStripMenuItem;
        private: System::Windows::Forms::ToolStripMenuItem^  поНазваниюToolStripMenuItem;
        private: System::Windows::Forms::ToolStripMenuItem^  поРазмеруToolStripMenuItem;
        private: System::Windows::Forms::ToolStripMenuItem^  поДатеСозданияToolStripMenuItem;
        private: System::Windows::Forms::TabControl^  Маски;
        private: System::Windows::Forms::TabPage^  tabPage1;
        private: System::Windows::Forms::Button^  button5;
        private: System::Windows::Forms::CheckBox^  checkBox1;
        private: System::Windows::Forms::Button^  button4;
        private: System::Windows::Forms::RichTextBox^  richTextBox4;
        private: System::Windows::Forms::Label^  label4;
        private: System::Windows::Forms::Button^  button3;
        private: System::Windows::Forms::RichTextBox^  richTextBox3;
        private: System::Windows::Forms::Label^  label3;
        private: System::Windows::Forms::Button^  button2;
        private: System::Windows::Forms::Label^  label2;
        private: System::Windows::Forms::RichTextBox^  richTextBox2;
        private: System::Windows::Forms::Button^  button1;
        private: System::Windows::Forms::Label^  label1;
        private: System::Windows::Forms::RichTextBox^  richTextBox1;
        private: System::Windows::Forms::TabPage^  tabPage2;
        private: System::Windows::Forms::Button^  button6;
        private: System::Windows::Forms::OpenFileDialog^  openFileDialog1;
        private: System::Windows::Forms::RichTextBox^  richTextBox5;
        private: System::Windows::Forms::ErrorProvider^  errorProvider1;
        private: System::Windows::Forms::Label^  label5;
        private: System::ComponentModel::IContainer^  components;
 
        private:
                /// <summary>
                /// Требуется переменная конструктора.
                /// </summary>
 
 
#pragma region Windows Form Designer generated code
                /// <summary>
                /// Обязательный метод для поддержки конструктора - не изменяйте
                /// содержимое данного метода при помощи редактора кода.
                /// </summary>
                void InitializeComponent(void)
                {
                        this->components = (gcnew System::ComponentModel::Container());
                        this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
                        this->выберитеМаскуToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
                        this->поРасширениюToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
                        this->поНазваниюToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
                        this->поРазмеруToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
                        this->поДатеСозданияToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
                        this->Маски = (gcnew System::Windows::Forms::TabControl());
                        this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
                        this->textBox1 = (gcnew System::Windows::Forms::TextBox());
                        this->label5 = (gcnew System::Windows::Forms::Label());
                        this->button6 = (gcnew System::Windows::Forms::Button());
                        this->button5 = (gcnew System::Windows::Forms::Button());
                        this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
                        this->button4 = (gcnew System::Windows::Forms::Button());
                        this->richTextBox4 = (gcnew System::Windows::Forms::RichTextBox());
                        this->label4 = (gcnew System::Windows::Forms::Label());
                        this->button3 = (gcnew System::Windows::Forms::Button());
                        this->richTextBox3 = (gcnew System::Windows::Forms::RichTextBox());
                        this->label3 = (gcnew System::Windows::Forms::Label());
                        this->button2 = (gcnew System::Windows::Forms::Button());
                        this->label2 = (gcnew System::Windows::Forms::Label());
                        this->richTextBox2 = (gcnew System::Windows::Forms::RichTextBox());
                        this->button1 = (gcnew System::Windows::Forms::Button());
                        this->label1 = (gcnew System::Windows::Forms::Label());
                        this->richTextBox1 = (gcnew System::Windows::Forms::RichTextBox());
                        this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
                        this->richTextBox5 = (gcnew System::Windows::Forms::RichTextBox());
                        this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog());
                        this->errorProvider1 = (gcnew System::Windows::Forms::ErrorProvider(this->components));
                        this->folderBrowserDialog1 = (gcnew System::Windows::Forms::FolderBrowserDialog());
                        this->menuStrip1->SuspendLayout();
                        this->Маски->SuspendLayout();
                        this->tabPage1->SuspendLayout();
                        this->tabPage2->SuspendLayout();
                        (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->errorProvider1))->BeginInit();
                        this->SuspendLayout();
                        // 
                        // menuStrip1
                        // 
                        this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->выберитеМаскуToolStripMenuItem});
                        this->menuStrip1->Location = System::Drawing::Point(0, 0);
                        this->menuStrip1->Name = L"menuStrip1";
                        this->menuStrip1->Size = System::Drawing::Size(686, 24);
                        this->menuStrip1->TabIndex = 1;
                        this->menuStrip1->Text = L"menuStrip1";
                        // 
                        // выберитеМаскуToolStripMenuItem
                        // 
                        this->выберитеМаскуToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {this->поРасширениюToolStripMenuItem, 
                                this->поНазваниюToolStripMenuItem, this->поРазмеруToolStripMenuItem, this->поДатеСозданияToolStripMenuItem});
                        this->выберитеМаскуToolStripMenuItem->Name = L"выберитеМаскуToolStripMenuItem";
                        this->выберитеМаскуToolStripMenuItem->Size = System::Drawing::Size(109, 20);
                        this->выберитеМаскуToolStripMenuItem->Text = L"Выберите маску";
                        // 
                        // поРасширениюToolStripMenuItem
                        // 
                        this->поРасширениюToolStripMenuItem->Name = L"поРасширениюToolStripMenuItem";
                        this->поРасширениюToolStripMenuItem->Size = System::Drawing::Size(167, 22);
                        this->поРасширениюToolStripMenuItem->Text = L"по расширению";
                        // 
                        // поНазваниюToolStripMenuItem
                        // 
                        this->поНазваниюToolStripMenuItem->Name = L"поНазваниюToolStripMenuItem";
                        this->поНазваниюToolStripMenuItem->Size = System::Drawing::Size(167, 22);
                        this->поНазваниюToolStripMenuItem->Text = L"по названию";
                        // 
                        // поРазмеруToolStripMenuItem
                        // 
                        this->поРазмеруToolStripMenuItem->Name = L"поРазмеруToolStripMenuItem";
                        this->поРазмеруToolStripMenuItem->Size = System::Drawing::Size(167, 22);
                        this->поРазмеруToolStripMenuItem->Text = L"по размеру";
                        // 
                        // поДатеСозданияToolStripMenuItem
                        // 
                        this->поДатеСозданияToolStripMenuItem->Name = L"поДатеСозданияToolStripMenuItem";
                        this->поДатеСозданияToolStripMenuItem->Size = System::Drawing::Size(167, 22);
                        this->поДатеСозданияToolStripMenuItem->Text = L"по дате создания";
                        // 
                        // Маски
                        // 
                        this->Маски->Controls->Add(this->tabPage1);
                        this->Маски->Controls->Add(this->tabPage2);
                        this->Маски->Location = System::Drawing::Point(0, 27);
                        this->Маски->Name = L"Маски";
                        this->Маски->SelectedIndex = 0;
                        this->Маски->Size = System::Drawing::Size(688, 333);
                        this->Маски->TabIndex = 2;
                        // 
                        // tabPage1
                        // 
                        this->tabPage1->Controls->Add(this->textBox1);
                        this->tabPage1->Controls->Add(this->label5);
                        this->tabPage1->Controls->Add(this->button6);
                        this->tabPage1->Controls->Add(this->button5);
                        this->tabPage1->Controls->Add(this->checkBox1);
                        this->tabPage1->Controls->Add(this->button4);
                        this->tabPage1->Controls->Add(this->richTextBox4);
                        this->tabPage1->Controls->Add(this->label4);
                        this->tabPage1->Controls->Add(this->button3);
                        this->tabPage1->Controls->Add(this->richTextBox3);
                        this->tabPage1->Controls->Add(this->label3);
                        this->tabPage1->Controls->Add(this->button2);
                        this->tabPage1->Controls->Add(this->label2);
                        this->tabPage1->Controls->Add(this->richTextBox2);
                        this->tabPage1->Controls->Add(this->button1);
                        this->tabPage1->Controls->Add(this->label1);
                        this->tabPage1->Controls->Add(this->richTextBox1);
                        this->tabPage1->Location = System::Drawing::Point(4, 22);
                        this->tabPage1->Name = L"tabPage1";
                        this->tabPage1->Padding = System::Windows::Forms::Padding(3);
                        this->tabPage1->Size = System::Drawing::Size(680, 307);
                        this->tabPage1->TabIndex = 0;
                        this->tabPage1->Text = L"Маски";
                        this->tabPage1->UseVisualStyleBackColor = true;
                        // 
                        // textBox1
                        // 
                        this->textBox1->Location = System::Drawing::Point(9, 73);
                        this->textBox1->Name = L"textBox1";
                        this->textBox1->Size = System::Drawing::Size(192, 20);
                        this->textBox1->TabIndex = 18;
                        this->textBox1->TextChanged += gcnew System::EventHandler(this, &Form1::textBox1_TextChanged);
                        // 
                        // label5
                        // 
                        this->label5->AutoSize = true;
                        this->label5->Location = System::Drawing::Point(355, 29);
                        this->label5->Name = L"label5";
                        this->label5->Size = System::Drawing::Size(130, 13);
                        this->label5->TabIndex = 17;
                        this->label5->Text = L"Впишите размер файла:";
                        // 
                        // button6
                        // 
                        this->button6->Location = System::Drawing::Point(9, 43);
                        this->button6->Name = L"button6";
                        this->button6->Size = System::Drawing::Size(192, 23);
                        this->button6->TabIndex = 16;
                        this->button6->Text = L"Выбрать место поиска";
                        this->button6->UseVisualStyleBackColor = true;
                        this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
                        // 
                        // button5
                        // 
                        this->button5->Location = System::Drawing::Point(537, 272);
                        this->button5->Name = L"button5";
                        this->button5->Size = System::Drawing::Size(133, 23);
                        this->button5->TabIndex = 14;
                        this->button5->Text = L"Начать поиск";
                        this->button5->UseVisualStyleBackColor = true;
                        this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
                        // 
                        // checkBox1
                        // 
                        this->checkBox1->AutoSize = true;
                        this->checkBox1->Location = System::Drawing::Point(358, 173);
                        this->checkBox1->Name = L"checkBox1";
                        this->checkBox1->Size = System::Drawing::Size(144, 17);
                        this->checkBox1->TabIndex = 13;
                        this->checkBox1->Text = L"Поиск внутри каталога";
                        this->checkBox1->UseVisualStyleBackColor = true;
                        // 
                        // button4
                        // 
                        this->button4->Location = System::Drawing::Point(595, 137);
                        this->button4->Name = L"button4";
                        this->button4->Size = System::Drawing::Size(75, 23);
                        this->button4->TabIndex = 11;
                        this->button4->Text = L"Далее";
                        this->button4->UseVisualStyleBackColor = true;
                        // 
                        // richTextBox4
                        // 
                        this->richTextBox4->Location = System::Drawing::Point(358, 105);
                        this->richTextBox4->Name = L"richTextBox4";
                        this->richTextBox4->Size = System::Drawing::Size(313, 26);
                        this->richTextBox4->TabIndex = 10;
                        this->richTextBox4->Text = L"";
                        this->richTextBox4->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox4_TextChanged);
                        // 
                        // label4
                        // 
                        this->label4->AutoSize = true;
                        this->label4->Location = System::Drawing::Point(355, 86);
                        this->label4->Name = L"label4";
                        this->label4->Size = System::Drawing::Size(130, 13);
                        this->label4->TabIndex = 9;
                        this->label4->Text = L"Впишите дату создания:";
                        // 
                        // button3
                        // 
                        this->button3->Location = System::Drawing::Point(596, 76);
                        this->button3->Name = L"button3";
                        this->button3->Size = System::Drawing::Size(75, 23);
                        this->button3->TabIndex = 8;
                        this->button3->Text = L"Далее";
                        this->button3->UseVisualStyleBackColor = true;
                        // 
                        // richTextBox3
                        // 
                        this->richTextBox3->Location = System::Drawing::Point(358, 45);
                        this->richTextBox3->Name = L"richTextBox3";
                        this->richTextBox3->Size = System::Drawing::Size(313, 25);
                        this->richTextBox3->TabIndex = 7;
                        this->richTextBox3->Text = L"";
                        this->richTextBox3->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox3_TextChanged);
                        // 
                        // label3
                        // 
                        this->label3->Location = System::Drawing::Point(0, 0);
                        this->label3->Name = L"label3";
                        this->label3->Size = System::Drawing::Size(100, 23);
                        this->label3->TabIndex = 15;
                        // 
                        // button2
                        // 
                        this->button2->Location = System::Drawing::Point(244, 173);
                        this->button2->Name = L"button2";
                        this->button2->Size = System::Drawing::Size(75, 23);
                        this->button2->TabIndex = 5;
                        this->button2->Text = L"Далее";
                        this->button2->UseVisualStyleBackColor = true;
//                      this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
                        // 
                        // label2
                        // 
                        this->label2->AutoSize = true;
                        this->label2->Location = System::Drawing::Point(6, 122);
                        this->label2->Name = L"label2";
                        this->label2->Size = System::Drawing::Size(105, 13);
                        this->label2->TabIndex = 4;
                        this->label2->Text = L"Впишите название:";
                        // 
                        // richTextBox2
                        // 
                        this->richTextBox2->Location = System::Drawing::Point(6, 141);
                        this->richTextBox2->Name = L"richTextBox2";
                        this->richTextBox2->Size = System::Drawing::Size(313, 26);
                        this->richTextBox2->TabIndex = 3;
                        this->richTextBox2->Text = L"";
                        this->richTextBox2->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox2_TextChanged);
                        // 
                        // button1
                        // 
                        this->button1->Location = System::Drawing::Point(247, 233);
                        this->button1->Name = L"button1";
                        this->button1->Size = System::Drawing::Size(75, 23);
                        this->button1->TabIndex = 2;
                        this->button1->Text = L"Далее";
                        this->button1->UseVisualStyleBackColor = true;
                        // 
                        // label1
                        // 
                        this->label1->AutoSize = true;
                        this->label1->Location = System::Drawing::Point(6, 183);
                        this->label1->Name = L"label1";
                        this->label1->Size = System::Drawing::Size(119, 13);
                        this->label1->TabIndex = 1;
                        this->label1->Text = L"Впишите расширение:";
                        // 
                        // richTextBox1
                        // 
                        this->richTextBox1->Location = System::Drawing::Point(9, 202);
                        this->richTextBox1->Name = L"richTextBox1";
                        this->richTextBox1->Size = System::Drawing::Size(313, 25);
                        this->richTextBox1->TabIndex = 0;
                        this->richTextBox1->Text = L"";
                        this->richTextBox1->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox1_TextChanged);
                        // 
                        // tabPage2
                        // 
                        this->tabPage2->Controls->Add(this->richTextBox5);
                        this->tabPage2->Location = System::Drawing::Point(4, 22);
                        this->tabPage2->Name = L"tabPage2";
                        this->tabPage2->Padding = System::Windows::Forms::Padding(3);
                        this->tabPage2->Size = System::Drawing::Size(680, 307);
                        this->tabPage2->TabIndex = 1;
                        this->tabPage2->Text = L"Результат поиска";
                        this->tabPage2->UseVisualStyleBackColor = true;
                        // 
                        // richTextBox5
                        // 
                        this->richTextBox5->Location = System::Drawing::Point(3, 6);
                        this->richTextBox5->Name = L"richTextBox5";
                        this->richTextBox5->Size = System::Drawing::Size(414, 298);
                        this->richTextBox5->TabIndex = 0;
                        this->richTextBox5->Text = L"";
                        this->richTextBox5->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox5_TextChanged);
                        // 
                        // openFileDialog1
                        // 
                        this->openFileDialog1->FileName = L"openFileDialog1";
                        // 
                        // errorProvider1
                        // 
                        this->errorProvider1->ContainerControl = this;
                        // 
                        // folderBrowserDialog1
                        // 
                        this->folderBrowserDialog1->HelpRequest += gcnew System::EventHandler(this, &Form1::folderBrowserDialog1_HelpRequest);
                        // 
                        // Form1
                        // 
                        this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
                        this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
                        this->ClientSize = System::Drawing::Size(686, 356);
                        this->Controls->Add(this->Маски);
                        this->Controls->Add(this->menuStrip1);
                        this->MainMenuStrip = this->menuStrip1;
                        this->Name = L"Form1";
                        this->Text = L"Поиск файлов";
                        this->menuStrip1->ResumeLayout(false);
                        this->menuStrip1->PerformLayout();
                        this->Маски->ResumeLayout(false);
                        this->tabPage1->ResumeLayout(false);
                        this->tabPage1->PerformLayout();
                        this->tabPage2->ResumeLayout(false);
                        (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->errorProvider1))->EndInit();
                        this->ResumeLayout(false);
                        this->PerformLayout();
 
                }
 
private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
 
 
 
                 }
private: System::Void richTextBox5_TextChanged(System::Object^  sender, System::EventArgs^  e) {
                        
                        
                        text1 = richTextBox5->Text;
                        //richTextBox5->Text=z.ToString();
                        String^ err = gcnew String(GetLastError ());
                        String^ fname = gcnew String(cFileName);
                        int z;
                        WIN32_FIND_DATA FindFileData;
  HANDLE hFind;
 
  richTextBox5->AppendText(nazvanie);
 
  hFind = FindFirstFileEx(nazvanie, FindExInfoStandard, &FindFileData,
                 FindExSearchNameMatch, NULL, 0 );
 
  if (hFind == INVALID_HANDLE_VALUE) 
  {
    richTextBox5->AppendText (err);
   } 
    else 
    {
    richTextBox5->AppendText (FindFileData.cFileName);
    FindClose(hFind);
    }
                        /*      char *temp = new char[text1.length()];
                        for(int i = 0; i < text1.length(); i++)
        {
                temp[i] = text1[i];
        }*/
        
//      z  = (int) text1;
 
                if(z>75){
                                 richTextBox5->AppendText("Возраст большой!");
                }
                 }
                                        
        private: System::Void richTextBox3_TextChanged(System::Object^  sender, System::EventArgs^  e) {
                        razmer= richTextBox3->Text;
                 }
private: System::Void richTextBox2_TextChanged(System::Object^  sender, System::EventArgs^  e) {
                         nazvanie = richTextBox2->Text;
                 }
private: System::Void richTextBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
                         rashirenie = richTextBox1->Text;
                 }
private: System::Void richTextBox4_TextChanged(System::Object^  sender, System::EventArgs^  e) {
                         datas = richTextBox4->Text;
                }
 
private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
                         folderBrowserDialog1->ShowDialog();
             textBox1->Text = folderBrowserDialog1->SelectedPath;
                         mesto = folderBrowserDialog1->SelectedPath;
         }
private: System::Void folderBrowserDialog1_HelpRequest(System::Object^  sender, System::EventArgs^  e) {
                 }
private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
                 }
 
};
}
Первая ошибка строка 430

Ошибка 1 error C2664: System::String::String(const wchar_t *): невозможно преобразовать параметр 1 из "int" в "const wchar_t *" c:\users\александр\documents\visual studio 2010\projects\os\Form1.h 430 1 os

Вторая ошибка строка 431

Ошибка 2 error C2065: cFileName: необъявленный идентификатор c:\users\александр\documents\visual studio 2010\projects\os\Form1.h 431 1 os
Третья ошибка строка 439

Ошибка 3 error C2664: FindFirstFileExW: невозможно преобразовать параметр 1 из "System::String ^" в "LPCWSTR" c:\users\александр\documents\visual studio 2010\projects\os\Form1.h 439 1 os
4 ошибка строка 447

Ошибка 4 error C2664: System::Windows::Forms::TextBoxBase::App endText: невозможно преобразовать параметр 1 из "WCHAR [260]" в "System::String ^" c:\users\александр\documents\visual studio 2010\projects\os\Form1.h 447 1 os
Помогите решить эти ошибки пожалуйста!
0
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
26.03.2012, 12:30
Цитата Сообщение от Сеня 2007 Посмотреть сообщение
FindFirstFileExW
- зачем тебе W прототип???Попробуй использовать либо FindFirstFileEx либо FindFirstFileExA, тоже касается и остальных функций
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
26.03.2012, 12:32  [ТС]
Короче все вродь сделал. Теперь появился вопрос почему в переменную mesto не передается место?
C++
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
#pragma once
#include <windows.h>
#include <WinBase.h>
 
 
namespace os {
 
    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
    
 
 
    /// <summary>
    /// Сводка для Form1
    /// </summary>
 
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        String ^text1;
        String ^nazvanie;
        String ^rashirenie;
        String ^datas;
        String ^mesto;
    private: System::Windows::Forms::FolderBrowserDialog^  folderBrowserDialog1;
    private: System::Windows::Forms::TextBox^  textBox1;
    public: 
        String ^razmer;
        String ^z;
        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: добавьте код конструктора
            //
        }
 
    protected:
        /// <summary>
        /// Освободить все используемые ресурсы.
        /// </summary>
        ~Form1()
        {
            if (components)
            {
                delete components;
            }
        }
    private: System::Windows::Forms::MenuStrip^  menuStrip1;
    protected: 
    private: System::Windows::Forms::ToolStripMenuItem^  выберитеМаскуToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поРасширениюToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поНазваниюToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поРазмеруToolStripMenuItem;
    private: System::Windows::Forms::ToolStripMenuItem^  поДатеСозданияToolStripMenuItem;
    private: System::Windows::Forms::TabControl^  Маски;
    private: System::Windows::Forms::TabPage^  tabPage1;
    private: System::Windows::Forms::Button^  button5;
    private: System::Windows::Forms::CheckBox^  checkBox1;
    private: System::Windows::Forms::Button^  button4;
    private: System::Windows::Forms::RichTextBox^  richTextBox4;
    private: System::Windows::Forms::Label^  label4;
    private: System::Windows::Forms::Button^  button3;
    private: System::Windows::Forms::RichTextBox^  richTextBox3;
    private: System::Windows::Forms::Label^  label3;
    private: System::Windows::Forms::Button^  button2;
    private: System::Windows::Forms::Label^  label2;
    private: System::Windows::Forms::RichTextBox^  richTextBox2;
    private: System::Windows::Forms::Button^  button1;
    private: System::Windows::Forms::Label^  label1;
    private: System::Windows::Forms::RichTextBox^  richTextBox1;
    private: System::Windows::Forms::TabPage^  tabPage2;
    private: System::Windows::Forms::Button^  button6;
    private: System::Windows::Forms::OpenFileDialog^  openFileDialog1;
    private: System::Windows::Forms::RichTextBox^  richTextBox5;
    private: System::Windows::Forms::ErrorProvider^  errorProvider1;
    private: System::Windows::Forms::Label^  label5;
    private: System::ComponentModel::IContainer^  components;
 
    private:
        /// <summary>
        /// Требуется переменная конструктора.
        /// </summary>
 
 
#pragma region Windows Form Designer generated code
        /// <summary>
        /// Обязательный метод для поддержки конструктора - не изменяйте
        /// содержимое данного метода при помощи редактора кода.
        /// </summary>
        void InitializeComponent(void)
        {
            this->components = (gcnew System::ComponentModel::Container());
            this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
            this->выберитеМаскуToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поРасширениюToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поНазваниюToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поРазмеруToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->поДатеСозданияToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
            this->Маски = (gcnew System::Windows::Forms::TabControl());
            this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
            this->textBox1 = (gcnew System::Windows::Forms::TextBox());
            this->label5 = (gcnew System::Windows::Forms::Label());
            this->button6 = (gcnew System::Windows::Forms::Button());
            this->button5 = (gcnew System::Windows::Forms::Button());
            this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
            this->button4 = (gcnew System::Windows::Forms::Button());
            this->richTextBox4 = (gcnew System::Windows::Forms::RichTextBox());
            this->label4 = (gcnew System::Windows::Forms::Label());
            this->button3 = (gcnew System::Windows::Forms::Button());
            this->richTextBox3 = (gcnew System::Windows::Forms::RichTextBox());
            this->label3 = (gcnew System::Windows::Forms::Label());
            this->button2 = (gcnew System::Windows::Forms::Button());
            this->label2 = (gcnew System::Windows::Forms::Label());
            this->richTextBox2 = (gcnew System::Windows::Forms::RichTextBox());
            this->button1 = (gcnew System::Windows::Forms::Button());
            this->label1 = (gcnew System::Windows::Forms::Label());
            this->richTextBox1 = (gcnew System::Windows::Forms::RichTextBox());
            this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
            this->richTextBox5 = (gcnew System::Windows::Forms::RichTextBox());
            this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog());
            this->errorProvider1 = (gcnew System::Windows::Forms::ErrorProvider(this->components));
            this->folderBrowserDialog1 = (gcnew System::Windows::Forms::FolderBrowserDialog());
            this->menuStrip1->SuspendLayout();
            this->Маски->SuspendLayout();
            this->tabPage1->SuspendLayout();
            this->tabPage2->SuspendLayout();
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->errorProvider1))->BeginInit();
            this->SuspendLayout();
            // 
            // menuStrip1
            // 
            this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->выберитеМаскуToolStripMenuItem});
            this->menuStrip1->Location = System::Drawing::Point(0, 0);
            this->menuStrip1->Name = L"menuStrip1";
            this->menuStrip1->Size = System::Drawing::Size(686, 24);
            this->menuStrip1->TabIndex = 1;
            this->menuStrip1->Text = L"menuStrip1";
            // 
            // выберитеМаскуToolStripMenuItem
            // 
            this->выберитеМаскуToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {this->поРасширениюToolStripMenuItem, 
                this->поНазваниюToolStripMenuItem, this->поРазмеруToolStripMenuItem, this->поДатеСозданияToolStripMenuItem});
            this->выберитеМаскуToolStripMenuItem->Name = L"выберитеМаскуToolStripMenuItem";
            this->выберитеМаскуToolStripMenuItem->Size = System::Drawing::Size(109, 20);
            this->выберитеМаскуToolStripMenuItem->Text = L"Выберите маску";
            // 
            // поРасширениюToolStripMenuItem
            // 
            this->поРасширениюToolStripMenuItem->Name = L"поРасширениюToolStripMenuItem";
            this->поРасширениюToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поРасширениюToolStripMenuItem->Text = L"по расширению";
            // 
            // поНазваниюToolStripMenuItem
            // 
            this->поНазваниюToolStripMenuItem->Name = L"поНазваниюToolStripMenuItem";
            this->поНазваниюToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поНазваниюToolStripMenuItem->Text = L"по названию";
            // 
            // поРазмеруToolStripMenuItem
            // 
            this->поРазмеруToolStripMenuItem->Name = L"поРазмеруToolStripMenuItem";
            this->поРазмеруToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поРазмеруToolStripMenuItem->Text = L"по размеру";
            // 
            // поДатеСозданияToolStripMenuItem
            // 
            this->поДатеСозданияToolStripMenuItem->Name = L"поДатеСозданияToolStripMenuItem";
            this->поДатеСозданияToolStripMenuItem->Size = System::Drawing::Size(167, 22);
            this->поДатеСозданияToolStripMenuItem->Text = L"по дате создания";
            // 
            // Маски
            // 
            this->Маски->Controls->Add(this->tabPage1);
            this->Маски->Controls->Add(this->tabPage2);
            this->Маски->Location = System::Drawing::Point(0, 27);
            this->Маски->Name = L"Маски";
            this->Маски->SelectedIndex = 0;
            this->Маски->Size = System::Drawing::Size(688, 333);
            this->Маски->TabIndex = 2;
            // 
            // tabPage1
            // 
            this->tabPage1->Controls->Add(this->textBox1);
            this->tabPage1->Controls->Add(this->label5);
            this->tabPage1->Controls->Add(this->button6);
            this->tabPage1->Controls->Add(this->button5);
            this->tabPage1->Controls->Add(this->checkBox1);
            this->tabPage1->Controls->Add(this->button4);
            this->tabPage1->Controls->Add(this->richTextBox4);
            this->tabPage1->Controls->Add(this->label4);
            this->tabPage1->Controls->Add(this->button3);
            this->tabPage1->Controls->Add(this->richTextBox3);
            this->tabPage1->Controls->Add(this->label3);
            this->tabPage1->Controls->Add(this->button2);
            this->tabPage1->Controls->Add(this->label2);
            this->tabPage1->Controls->Add(this->richTextBox2);
            this->tabPage1->Controls->Add(this->button1);
            this->tabPage1->Controls->Add(this->label1);
            this->tabPage1->Controls->Add(this->richTextBox1);
            this->tabPage1->Location = System::Drawing::Point(4, 22);
            this->tabPage1->Name = L"tabPage1";
            this->tabPage1->Padding = System::Windows::Forms::Padding(3);
            this->tabPage1->Size = System::Drawing::Size(680, 307);
            this->tabPage1->TabIndex = 0;
            this->tabPage1->Text = L"Маски";
            this->tabPage1->UseVisualStyleBackColor = true;
            // 
            // textBox1
            // 
            this->textBox1->Location = System::Drawing::Point(9, 73);
            this->textBox1->Name = L"textBox1";
            this->textBox1->Size = System::Drawing::Size(192, 20);
            this->textBox1->TabIndex = 18;
            this->textBox1->TextChanged += gcnew System::EventHandler(this, &Form1::textBox1_TextChanged);
            // 
            // label5
            // 
            this->label5->AutoSize = true;
            this->label5->Location = System::Drawing::Point(355, 29);
            this->label5->Name = L"label5";
            this->label5->Size = System::Drawing::Size(130, 13);
            this->label5->TabIndex = 17;
            this->label5->Text = L"Впишите размер файла:";
            // 
            // button6
            // 
            this->button6->Location = System::Drawing::Point(9, 43);
            this->button6->Name = L"button6";
            this->button6->Size = System::Drawing::Size(192, 23);
            this->button6->TabIndex = 16;
            this->button6->Text = L"Выбрать место поиска";
            this->button6->UseVisualStyleBackColor = true;
            this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
            // 
            // button5
            // 
            this->button5->Location = System::Drawing::Point(537, 272);
            this->button5->Name = L"button5";
            this->button5->Size = System::Drawing::Size(133, 23);
            this->button5->TabIndex = 14;
            this->button5->Text = L"Начать поиск";
            this->button5->UseVisualStyleBackColor = true;
            this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
            // 
            // checkBox1
            // 
            this->checkBox1->AutoSize = true;
            this->checkBox1->Location = System::Drawing::Point(358, 173);
            this->checkBox1->Name = L"checkBox1";
            this->checkBox1->Size = System::Drawing::Size(144, 17);
            this->checkBox1->TabIndex = 13;
            this->checkBox1->Text = L"Поиск внутри каталога";
            this->checkBox1->UseVisualStyleBackColor = true;
            // 
            // button4
            // 
            this->button4->Location = System::Drawing::Point(595, 137);
            this->button4->Name = L"button4";
            this->button4->Size = System::Drawing::Size(75, 23);
            this->button4->TabIndex = 11;
            this->button4->Text = L"Далее";
            this->button4->UseVisualStyleBackColor = true;
            // 
            // richTextBox4
            // 
            this->richTextBox4->Location = System::Drawing::Point(358, 105);
            this->richTextBox4->Name = L"richTextBox4";
            this->richTextBox4->Size = System::Drawing::Size(313, 26);
            this->richTextBox4->TabIndex = 10;
            this->richTextBox4->Text = L"";
            this->richTextBox4->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox4_TextChanged);
            // 
            // label4
            // 
            this->label4->AutoSize = true;
            this->label4->Location = System::Drawing::Point(355, 86);
            this->label4->Name = L"label4";
            this->label4->Size = System::Drawing::Size(130, 13);
            this->label4->TabIndex = 9;
            this->label4->Text = L"Впишите дату создания:";
            // 
            // button3
            // 
            this->button3->Location = System::Drawing::Point(596, 76);
            this->button3->Name = L"button3";
            this->button3->Size = System::Drawing::Size(75, 23);
            this->button3->TabIndex = 8;
            this->button3->Text = L"Далее";
            this->button3->UseVisualStyleBackColor = true;
            // 
            // richTextBox3
            // 
            this->richTextBox3->Location = System::Drawing::Point(358, 45);
            this->richTextBox3->Name = L"richTextBox3";
            this->richTextBox3->Size = System::Drawing::Size(313, 25);
            this->richTextBox3->TabIndex = 7;
            this->richTextBox3->Text = L"";
            this->richTextBox3->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox3_TextChanged);
            // 
            // label3
            // 
            this->label3->Location = System::Drawing::Point(0, 0);
            this->label3->Name = L"label3";
            this->label3->Size = System::Drawing::Size(100, 23);
            this->label3->TabIndex = 15;
            // 
            // button2
            // 
            this->button2->Location = System::Drawing::Point(244, 173);
            this->button2->Name = L"button2";
            this->button2->Size = System::Drawing::Size(75, 23);
            this->button2->TabIndex = 5;
            this->button2->Text = L"Далее";
            this->button2->UseVisualStyleBackColor = true;
//          this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
            // 
            // label2
            // 
            this->label2->AutoSize = true;
            this->label2->Location = System::Drawing::Point(6, 122);
            this->label2->Name = L"label2";
            this->label2->Size = System::Drawing::Size(105, 13);
            this->label2->TabIndex = 4;
            this->label2->Text = L"Впишите название:";
            // 
            // richTextBox2
            // 
            this->richTextBox2->Location = System::Drawing::Point(6, 141);
            this->richTextBox2->Name = L"richTextBox2";
            this->richTextBox2->Size = System::Drawing::Size(313, 26);
            this->richTextBox2->TabIndex = 3;
            this->richTextBox2->Text = L"";
            this->richTextBox2->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox2_TextChanged);
            // 
            // button1
            // 
            this->button1->Location = System::Drawing::Point(247, 233);
            this->button1->Name = L"button1";
            this->button1->Size = System::Drawing::Size(75, 23);
            this->button1->TabIndex = 2;
            this->button1->Text = L"Далее";
            this->button1->UseVisualStyleBackColor = true;
            // 
            // label1
            // 
            this->label1->AutoSize = true;
            this->label1->Location = System::Drawing::Point(6, 183);
            this->label1->Name = L"label1";
            this->label1->Size = System::Drawing::Size(119, 13);
            this->label1->TabIndex = 1;
            this->label1->Text = L"Впишите расширение:";
            // 
            // richTextBox1
            // 
            this->richTextBox1->Location = System::Drawing::Point(9, 202);
            this->richTextBox1->Name = L"richTextBox1";
            this->richTextBox1->Size = System::Drawing::Size(313, 25);
            this->richTextBox1->TabIndex = 0;
            this->richTextBox1->Text = L"";
            this->richTextBox1->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox1_TextChanged);
            // 
            // tabPage2
            // 
            this->tabPage2->Controls->Add(this->richTextBox5);
            this->tabPage2->Location = System::Drawing::Point(4, 22);
            this->tabPage2->Name = L"tabPage2";
            this->tabPage2->Padding = System::Windows::Forms::Padding(3);
            this->tabPage2->Size = System::Drawing::Size(680, 307);
            this->tabPage2->TabIndex = 1;
            this->tabPage2->Text = L"Результат поиска";
            this->tabPage2->UseVisualStyleBackColor = true;
            // 
            // richTextBox5
            // 
            this->richTextBox5->Location = System::Drawing::Point(3, 6);
            this->richTextBox5->Name = L"richTextBox5";
            this->richTextBox5->Size = System::Drawing::Size(414, 298);
            this->richTextBox5->TabIndex = 0;
            this->richTextBox5->Text = L"";
            this->richTextBox5->TextChanged += gcnew System::EventHandler(this, &Form1::richTextBox5_TextChanged);
            // 
            // openFileDialog1
            // 
            this->openFileDialog1->FileName = L"openFileDialog1";
            // 
            // errorProvider1
            // 
            this->errorProvider1->ContainerControl = this;
            // 
            // folderBrowserDialog1
            // 
            this->folderBrowserDialog1->HelpRequest += gcnew System::EventHandler(this, &Form1::folderBrowserDialog1_HelpRequest);
            // 
            // Form1
            // 
            this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(686, 356);
            this->Controls->Add(this->Маски);
            this->Controls->Add(this->menuStrip1);
            this->MainMenuStrip = this->menuStrip1;
            this->Name = L"Form1";
            this->Text = L"Поиск файлов";
            this->menuStrip1->ResumeLayout(false);
            this->menuStrip1->PerformLayout();
            this->Маски->ResumeLayout(false);
            this->tabPage1->ResumeLayout(false);
            this->tabPage1->PerformLayout();
            this->tabPage2->ResumeLayout(false);
            (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->errorProvider1))->EndInit();
            this->ResumeLayout(false);
            this->PerformLayout();
 
        }
 
private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
 
 
 
         }
private: System::Void richTextBox5_TextChanged(System::Object^  sender, System::EventArgs^  e) {
            
            
            text1 = richTextBox5->Text;
            //richTextBox5->Text=z.ToString();
            
            
            WIN32_FIND_DATA FindFileData;
    HANDLE hFind;
    LPCWSTR mesto = mesto;
    hFind = FindFirstFileEx(mesto, FindExInfoStandard, &FindFileData,
             FindExSearchNameMatch, NULL, 0);
    char c[100];
    size_t res = wcstombs(c, FindFileData.cFileName, 100);
    z = gcnew String (c);
    
    
    //z = Convert.ToString(c);
        if (hFind == INVALID_HANDLE_VALUE)
        {
                richTextBox5->AppendText("ERRORE");
        }
        while(FindNextFile(hFind, &FindFileData))
        {
               richTextBox5->AppendText(z);
        }
    
 
    
            /*  char *temp = new char[text1.length()];
            for(int i = 0; i < text1.length(); i++)
    {
        temp[i] = text1[i];
    }*/
    
//  z  = (int) text1;
 
        /*if(z>75){
                 richTextBox5->AppendText("Возраст большой!");
        }*/
         }
                    
    private: System::Void richTextBox3_TextChanged(System::Object^  sender, System::EventArgs^  e) {
            razmer= richTextBox3->Text;
         }
private: System::Void richTextBox2_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             nazvanie = richTextBox2->Text;
         }
private: System::Void richTextBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             rashirenie = richTextBox1->Text;
         }
private: System::Void richTextBox4_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             datas = richTextBox4->Text;
        }
 
private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
             folderBrowserDialog1->ShowDialog();
             textBox1->Text = folderBrowserDialog1->SelectedPath;
             mesto = textBox1->Text;
         }
private: System::Void folderBrowserDialog1_HelpRequest(System::Object^  sender, System::EventArgs^  e) {
         }
private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
         }
 
};
}
0
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
26.03.2012, 12:43
Цитата Сообщение от Сеня 2007 Посмотреть сообщение
LPCWSTR mesto = mesto;
- ну это же Wide STR а у тебя уже char-ы стали
Цитата Сообщение от Сеня 2007 Посмотреть сообщение
FindFirstFileEx
.

Сеня 2007, реально переставь кодировку своего проекта с Unicode на MultyByte Character Set и не изобретай себе проблем, по ссылке как это сделать
Из файла в ListBox (MFC)
(ещё раз скажу что у 9-й 10-й студий по умолчанию идёт кодировка проекта юникод, а для работы с чарами надо MultyByte Character Set). А вообще погляди как это может выглядеть в MFC
Миниатюры
Поиск файлов по маске  
Вложения
Тип файла: rar fexpl.exe.rar (22.6 Кб, 14 просмотров)
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
26.03.2012, 12:53  [ТС]
Все б ничего MFC но нам нужно сделать дизайн еще! При смене кодировки вылазиют ошибки опять о не стыковки типов. Смысл ее менять если я уже все привел к одному типу. Проблема в том что не передается значение почему то? Не подскажите почему?
0
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
26.03.2012, 13:37
Цитата Сообщение от Сеня 2007 Посмотреть сообщение
но нам нужно сделать дизайн еще!
всмысле ещё?

Цитата Сообщение от Сеня 2007 Посмотреть сообщение
Проблема в том что не передается значение почему то?
- потому что твои контролы при юникоде вводят значения путей как TCHAR а искать пытаешся используя char поэтому я и говорил о смене кодировки, а на счёт этого

Цитата Сообщение от Сеня 2007 Посмотреть сообщение
ошибки опять о не стыковки типов
- подозреваю повылезали баги на wprintf wstrcpy и т.д. - позаменяй всё на привычные глазу функции, и всё заработает
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
26.03.2012, 13:53  [ТС]
Менял все равно ошибки. Только вместо LPCWSTR нужно поставить LPCSTR. Только все равно переменная mesto ничего не принимает.
0
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
26.03.2012, 14:28
Цитата Сообщение от Сеня 2007 Посмотреть сообщение
Только все равно переменная mesto ничего не принимает.
ну так не делай вот этого

Цитата Сообщение от Сеня 2007 Посмотреть сообщение
LPCWSTR mesto = mesto;//убери эту строку
* * hFind = FindFirstFileEx(mesto
//и передавай напрямую своё mesto
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
26.03.2012, 15:07  [ТС]
Ничего она не принимает, она почему то не хочет принимать значение вот здесь mesto = folderBrowserDialog1->SelectedPath; Не пойму в чем проблема. От кодировки ничего не меняется все перекодировал уже раза 3
0
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
26.03.2012, 15:26
Сеня 2007, ну значит не собираешь данные из контролов в MFC за это отвечает UpdateData(true); думаю что то подобное должно быть и в Forms(я в них не пишу так что могу твою задачу решить в API или MFC)
0
2 / 2 / 1
Регистрация: 03.10.2010
Сообщений: 182
26.03.2012, 18:58  [ТС]
Я понял в чем проблема. Я далее ее переназначаю из string^ в lpstr поэтому она ничего не принимает. Вопрос: как перекодировать string^ в lpstr?
0
Автор FAQ
 Аватар для -=ЮрА=-
6614 / 4256 / 401
Регистрация: 08.08.2009
Сообщений: 10,325
Записей в блоге: 24
27.03.2012, 09:27
Сеня 2007,я конечно не знаток Forms, поетому буду писать основываясь на свою интуицию для std::string существует метод c_str() :
C++
1
2
string text = "Bla bla bla";
LPCTSTR s = text.c_str();
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
27.03.2012, 09:27
Помогаю со студенческими работами здесь

Поиск файлов по маске
Нужно найти файлы по маске. Маска и каталог передаётся через параметры. Файлы ищутся также в подкаталогах. import java.io.*; import...

Поиск файлов по маске
Всем доброго времени суток, подскажите, как осуществить поиск файлов по маске в связке c++ и Linux?

Поиск файлов по маске
Помогите, пожалуйста. Надо найти файлы по заданной маске во всех поддиректориях заданной директории.

Поиск файлов по маске
Как реализовать поиск файлов по маске &quot;*.txt&quot;? Файлы могут быть в любой папке диска C: или даже D:

Поиск файлов по маске
Надо найти файлы по маске типа: 123456. txt, 1243567.txt, 56745.txt , 1123119.txt и т.д. Пробовал применять такую маску: .txt не...


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

Или воспользуйтесь поиском по форуму:
20
Ответ Создать тему
Новые блоги и статьи
Thinkpad X220 Tablet — это лучший бюджетный ноутбук для учёбы, точка.
Programma_Boinc 23.12.2025
Thinkpad X220 Tablet — это лучший бюджетный ноутбук для учёбы, точка. Рецензия / Мнение/ Перевод https:/ / **********/ gallery/ thinkpad-x220-tablet-porn-gzoEAjs . . .
PhpStorm 2025.3: WSL Terminal всегда стартует в ~
and_y87 14.12.2025
PhpStorm 2025. 3: WSL Terminal всегда стартует в ~ (home), игнорируя директорию проекта Симптом: После обновления до PhpStorm 2025. 3 встроенный терминал WSL открывается в домашней директории. . .
Как объединить две одинаковые БД Access с разными данными
VikBal 11.12.2025
Помогите пожалуйста !! Как объединить 2 одинаковые БД Access с разными данными.
Новый ноутбук
volvo 07.12.2025
Всем привет. По скидке в "черную пятницу" взял себе новый ноутбук Lenovo ThinkBook 16 G7 на Амазоне: Ryzen 5 7533HS 64 Gb DDR5 1Tb NVMe 16" Full HD Display Win11 Pro
Музыка, написанная Искусственным Интеллектом
volvo 04.12.2025
Всем привет. Некоторое время назад меня заинтересовало, что уже умеет ИИ в плане написания музыки для песен, и, собственно, исполнения этих самых песен. Стихов у нас много, уже вышли 4 книги, еще 3. . .
От async/await к виртуальным потокам в Python
IndentationError 23.11.2025
Армин Ронахер поставил под сомнение async/ await. Создатель Flask заявляет: цветные функции - провал, виртуальные потоки - решение. Не threading-динозавры, а новое поколение лёгких потоков. Откат?. . .
Поиск "дружественных имён" СОМ портов
Argus19 22.11.2025
Поиск "дружественных имён" СОМ портов На странице: https:/ / norseev. ru/ 2018/ 01/ 04/ comportlist_windows/ нашёл схожую тему. Там приведён код на С++, который показывает только имена СОМ портов, типа,. . .
Сколько Государство потратило денег на меня, обеспечивая инсулином.
Programma_Boinc 20.11.2025
Сколько Государство потратило денег на меня, обеспечивая инсулином. Вот решила сделать интересный приблизительный подсчет, сколько государство потратило на меня денег на покупку инсулинов. . . .
Ломающие изменения в C#.NStar Alpha
Etyuhibosecyu 20.11.2025
Уже можно не только тестировать, но и пользоваться C#. NStar - писать оконные приложения, содержащие надписи, кнопки, текстовые поля и даже изображения, например, моя игра "Три в ряд" написана на этом. . .
Мысли в слух
kumehtar 18.11.2025
Кстати, совсем недавно имел разговор на тему медитаций с людьми. И обнаружил, что они вообще не понимают что такое медитация и зачем она нужна. Самые базовые вещи. Для них это - когда просто люди. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2025, CyberForum.ru