0 / 0 / 0
Регистрация: 20.12.2019
Сообщений: 1
1

Оператор ">" невозможно применить к операнду типа "IContainer" и "<NULL>".

20.12.2019, 00:34. Показов 1571. Ответов 2
Метки нет (Все метки)

// Оператор ">" невозможно применить к операнду типа "IContainer" и "<NULL>".
C#
1
            if (disposing && (this.components > null))


Выдаёт ошибку в этой строке,подскажите что неправильно

Добавлено через 1 минуту
Весь файл


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
namespace LasteraClient
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
 
    public class FormAutorization : Form
    {
        private int i = 5;
        private string userlogin;
        private string userpass;
        private IContainer components = null;
        private Button cmdEnter;
        private Button cmdCalcel;
        private Label lblNickName;
        private Label label2;
        private Timer timer;
        private LinkLabel linkLabel1;
 
        public FormAutorization()
        {
            try
            {
                this.InitializeComponent();
                this.timer.Enabled = !string.IsNullOrEmpty(Settings.Default.Login);
                this.lblNickName.Text = Settings.Default.Login;
                this.userlogin = Settings.Default.Login;
                this.userpass = Settings.Default.Password;
            }
            catch
            {
                Application.Exit();
            }
        }
 
        private void cmdCalcel_Click(object sender, EventArgs e)
        {
            if (this.cmdCalcel.Text == "Отмена")
            {
                this.timer.Enabled = false;
                this.cmdCalcel.Text = "Выход";
            }
            else
            {
                Application.Exit();
            }
        }
 
        private void cmdEnter_Click(object sender, EventArgs e)
        {
            this.NextShow();
        }
 
        protected override void Dispose(bool disposing)
        {
#pragma warning disable CS0019 // Оператор ">" невозможно применить к операнду типа "IContainer" и "<NULL>".
#pragma warning disable CS0019 // Оператор ">" невозможно применить к операнду типа "IContainer" и "<NULL>".
            if (disposing && (this.components > null))
#pragma warning restore CS0019 // Оператор ">" невозможно применить к операнду типа "IContainer" и "<NULL>".
#pragma warning restore CS0019 // Оператор ">" невозможно применить к операнду типа "IContainer" и "<NULL>".
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }
 
        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(FormAutorization));
            this.cmdEnter = new Button();
            this.cmdCalcel = new Button();
            this.lblNickName = new Label();
            this.label2 = new Label();
            this.timer = new Timer(this.components);
            this.linkLabel1 = new LinkLabel();
            base.SuspendLayout();
            this.cmdEnter.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xcc);
            this.cmdEnter.Location = new Point(9, 0x4e);
            this.cmdEnter.Name = "cmdEnter";
            this.cmdEnter.Size = new Size(0xc4, 0x18);
            this.cmdEnter.TabIndex = 0;
            this.cmdEnter.Text = "Автовход через 5 сек";
            this.cmdEnter.UseVisualStyleBackColor = true;
            this.cmdEnter.Click += new EventHandler(this.cmdEnter_Click);
            this.cmdCalcel.Location = new Point(0xd5, 0x4e);
            this.cmdCalcel.Name = "cmdCalcel";
            this.cmdCalcel.Size = new Size(0x55, 0x18);
            this.cmdCalcel.TabIndex = 1;
            this.cmdCalcel.Text = "Отмена";
            this.cmdCalcel.UseVisualStyleBackColor = true;
            this.cmdCalcel.Click += new EventHandler(this.cmdCalcel_Click);
            this.lblNickName.AutoSize = true;
            this.lblNickName.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, 0xcc);
            this.lblNickName.Location = new Point(0x72, 13);
            this.lblNickName.Name = "lblNickName";
            this.lblNickName.Size = new Size(0, 15);
            this.lblNickName.TabIndex = 2;
            this.label2.AutoSize = true;
            this.label2.Location = new Point(0x71, 0x2c);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x4c, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "Входит в игру";
            this.timer.Interval = 0x3e8;
            this.timer.Tick += new EventHandler(this.timer_Tick);
            this.linkLabel1.AutoSize = true;
            this.linkLabel1.Location = new Point(0xe3, 15);
            this.linkLabel1.Name = "linkLabel1";
            this.linkLabel1.Size = new Size(50, 13);
            this.linkLabel1.TabIndex = 4;
            this.linkLabel1.TabStop = true;
            this.linkLabel1.Text = "Удалить";
            this.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x133, 0x6d);
            base.Controls.Add(this.linkLabel1);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.lblNickName);
            base.Controls.Add(this.cmdCalcel);
            base.Controls.Add(this.cmdEnter);
            base.Icon = (Icon)manager.GetObject("$this.Icon");
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FormAutorization";
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Автовход в игру";
            base.TopMost = true;
            base.ResumeLayout(false);
            base.PerformLayout();
        }
 
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            base.Hide();
            this.timer.Enabled = false;
            Settings.Default.Reset();
            MessageBox.Show("Персонаж удален", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            Application.Exit();
        }
 
        private void NextShow()
        {
            try
            {
                this.timer.Enabled = false;
                Client client = new Client();
                base.Hide();
                client.Show();
            }
            catch
            {
                Application.Exit();
            }
        }
 
        private void timer_Tick(object sender, EventArgs e)
        {
            if (this.i <= 0)
            {
                this.timer.Enabled = false;
                this.NextShow();
            }
            else
            {
                this.i--;
                this.cmdEnter.Text = string.Format("Автовход через {0} сек", this.i);
            }
        }
    }
}
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
20.12.2019, 00:34
Ответы с готовыми решениями:

"Необработанное исключение в "0x00417c85" в "oui2.exe": 0xC0000005: Нарушение прав доступа при чтении "0x00000000"."
Пишем программу в VS 2010 на С++ DirectX SDK (June 2010). Доходя до одной строчки появляется...

Необработанное исключение в "0x00a78659" в "First.exe": 0xC0000005: Нарушение прав доступа при записи "0x0189f000"
Здравствуйте, вот столкнулся с ошибкой и не могу понять в чем причина, вроде все правильно сделал....

Необработанное исключение в "0x77df15de" в "kursova.exe": 0xC0000005: Нарушение прав доступа при записи "0xcdcdcdd5"
как решить эту проблему? Необработанное исключение в &quot;0x77df15de&quot; в &quot;kursova.exe&quot;: 0xC0000005:...

error C2664: D3DXLoadMeshFromXW: невозможно преобразовать параметр 1 из "LPCSTR" в "LPCWSTR"
Вот код://Включаемые библиотеки #pragma once #include &quot;main.h&quot; #include &quot;L_smesh.h&quot;...

2
6575 / 4560 / 1843
Регистрация: 07.05.2019
Сообщений: 13,726
20.12.2019, 12:48 2
Цитата Сообщение от HanTEriyS Посмотреть сообщение
Выдаёт ошибку в этой строке,подскажите что неправильно
А зачем ты сравниваешь null на больше-меньше? Сделай if (disposing && (this.components != null))
0
1095 / 822 / 257
Регистрация: 30.04.2009
Сообщений: 3,398
21.12.2019, 17:20 3
а components больше null или меньше?
просто интересно.
0
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
21.12.2019, 17:20
Помогаю со студенческими работами здесь

MFC error C2440: инициализация: невозможно преобразовать "LPCTSTR" в "LPCSTR"
Проблема в том что при компиляции в строке с загрузкой иконки видает ошибку LPCSTR cname =...

Ошибка C2440=: невозможно преобразовать "float *" в "int"
Ребят, помогите. Тупо не вижу в чем ошибка( /*21.Знайти MAX та обчислити середнє арифметичне...

Невозможно преобразовать параметр 1 из "char *" в "LPWSTR"
Не могу решить одну проблему после того как перешел с MS VC++ 6 на MS VC++ 2010. Нигде никакой...

Пишет: "Несовместимые типы операндов "char" и "const char*"". Что делать?
#include &quot;stdafx.h&quot; #include &lt;ctime&gt; #include &lt;iostream&gt; #include &lt;conio.h&gt; #include &lt;locale.h&gt;...


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

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2023, CyberForum.ru