Ошибка c6385 c

Sunshine_1

0 / 0 / 0

Регистрация: 16.09.2020

Сообщений: 3

1

16.09.2020, 08:27. Показов 10182. Ответов 12

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

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
int main() 
{
    int n, j, i, k,m;
    cout.precision(4);
    cout.setf(ios::fixed);
    cout << "\nEnter the no. of equations\n";
    cin >> n;
    m = n + 1;
    double** p = new double*[n];
    for ( int count = 0; count < n; count++)
    {
        p[count] = new double[m];  // x[n]
 
    }
    double** x = new double*[n];
    for (int count = 0; count < n; count++)
    {
        x[count] = new double[n];
    }
    cout << "\nEnter the elements:\n";
    for (i = 0; i < n; i++) {
        for (j = 0; j <= n; j++) {
            cin >> p[i][j];
        }
            
    }
        
    for (i = 0; i < n; i++){
        for (k = i + 1; k < n; k++) {
            if (abs(p[i][i]) < abs(p[k][i]))
                for (j = 0; j <= n; j++)
                {
                    double temp = p[i][j];
                    p[i][j] = p[k][j];
                    p[k][j] = temp;
                } 
        }
    }
    cout << "\nThe matrix after Pivotisation is:\n";
    for (i = 0; i < n; i++)
    {
        for (j = 0; j <= n; j++) {
            cout << p[i][j] << setw(16);
            cout << "\n";
        }
    }
    for (i = 0; i < n - 1; i++) {          
        for (k = i + 1; k < n; k++)
        {
            double t = p[k][i] / p[i][i];
            for (j = 0; j <= n; j++)
                p[k][j] = p[k][j] - t * p[i][j];    
        }
    }
    cout << "\n\nThe matrix after gauss-elimination is as follows:\n";
    for (i = 0; i < n; i++)            //print the new matrix
    {
        for (j = 0; j <= n; j++)
            cout << p[i][j] << setw(16);
        cout << "\n";
    }
    for (i = n - 1; i >= 0; i--)                
    {                        
        *x[i] = p[i][n];                
        for (j = i + 1; j < n; j++){
            if (j!= i) {
                x[i] = x[i] - int(( p[i][j] * (*x[j])));
                *x[i] *= (1 / p[i][i]);
            }               
                
        }
                             
    }
    cout << "\nThe values of the variables are as follows:\n";
    for (i = 0; i < n; i++) {
        cout << x[i] << endl;
    }
    delete[] p;
    delete[] x;
    return 0;

Код для решения СЛАУ методом Гаусса. Вроде как компилируется однако не дает финальные значения, относя все ошибки к изначальной матрице.
Она задана динамически и вроде как должно хватать памяти однако компилятор все равно жалуется.
В чем может быть вопрос?
Проблемный кусок кода

C++
1
2
3
4
5
6
7
cout << "\nEnter the elements:\n";
    for (i = 0; i < n; i++) {
        for (j = 0; j <= n; j++) {
            cin >> p[i][j];
        }
            
    }



0



704 / 410 / 203

Регистрация: 19.12.2016

Сообщений: 1,648

16.09.2020, 08:30

2

Цитата
Сообщение от Sunshine_1
Посмотреть сообщение

j <= n

Попробуйте удалить «=»



0



0 / 0 / 0

Регистрация: 16.09.2020

Сообщений: 3

16.09.2020, 08:42

 [ТС]

3

Тогда он не дает записать все переменные

Добавлено через 4 минуты
Скажем на примере 2 ЛАУ
Должно быть 6 переменных однако он обрывает после 4



0



ram876

704 / 410 / 203

Регистрация: 19.12.2016

Сообщений: 1,648

16.09.2020, 08:48

4

Я написал от балды простую программы и у меня все переменные проходит

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
#include <iostream>
 
using namespace std;
 
int main()
{
    int n = 5;
    int arr[n][n];
    for (int i = 0; i < n; i++) 
    {
        for (int j = 0; j < n; j++) 
        {
            arr[i][j] = 1;
        }
            
    }
    for (int i = 0; i < n; i++) 
    {
        for (int j = 0; j < n; j++) 
        {
            cout << arr[i][j];
        }
        cout << endl;
            
    }
 
    return 0;
}



0



0 / 0 / 0

Регистрация: 16.09.2020

Сообщений: 3

16.09.2020, 08:59

 [ТС]

5

Массив у вас статичный, n=5
Плюс у вас значение присваевается , а в моем случае значение вводятся пользователем



0



ram876

704 / 410 / 203

Регистрация: 19.12.2016

Сообщений: 1,648

16.09.2020, 09:27

6

Присвоение пользователем или перед компиляцией не имеет значение и не вижу проблем от динамического выделения
Вот:

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
#include <iostream>
 
using namespace std;
 
int main()
{
    int n, m;
    cout << "Enter n and m\n";
    cin >> n >> m;
    int **arr = new int*[n];
    for ( int i = 0; i < n; i++) 
    {
        arr[i] = new int[m]; 
    }
    cout << "Enter numbers\n";
    for (int i = 0; i < n; i++) 
    {
        for (int j = 0; j < m; j++) 
        {
            cin >> arr[i][j];
        }
            
    }
    for (int i = 0; i < n; i++) 
    {
        for (int j = 0; j < m; j++) 
        {
            cout << arr[i][j];
        }
        cout << endl;
            
    }
 
    return 0;
}



0



mathway

17 / 10 / 6

Регистрация: 15.09.2020

Сообщений: 39

16.09.2020, 09:46

7

Что значит вроде как компилируется? Можно узнать сообщение компилятора о результате компиляции?

Помимо всего прочего, в конце функции

C++
1
main()

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



0



TheCalligrapher

Вездепух

Эксперт CЭксперт С++

11087 / 6054 / 1651

Регистрация: 18.10.2014

Сообщений: 15,183

16.09.2020, 09:56

8

Цитата
Сообщение от Sunshine_1
Посмотреть сообщение

Вроде как компилируется однако не дает финальные значения, относя все ошибки к изначальной матрице.
Она задана динамически и вроде как должно хватать памяти однако компилятор все равно жалуется.

Ничего не понял. «Вроде как компилируется» и «компилятор все равно жалуется» — это взаимоисключающие утверждения. Что это значит???

Цитата
Сообщение от Sunshine_1
Посмотреть сообщение

Проблемный кусок кода

C++
1
2
3
4
5
6
7
cout << "\nEnter the elements:\n";
    for (i = 0; i < n; i++) {
        for (j = 0; j <= n; j++) {
            cin >> p[i][j];
        }
            
    }

Почему вы решили, что это «проблемный кусок кода»? Я что-то не вижу тут никаких проблем.



0



704 / 410 / 203

Регистрация: 19.12.2016

Сообщений: 1,648

16.09.2020, 10:00

9

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

никаких проблем

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

j <= n

Разве тут не выход за пределы?



0



Вездепух

Эксперт CЭксперт С++

11087 / 6054 / 1651

Регистрация: 18.10.2014

Сообщений: 15,183

16.09.2020, 10:02

10

Цитата
Сообщение от ram876
Посмотреть сообщение

Разве тут не выход за пределы?

С чего бы это вдруг? Память выделена для прямоугольного массива размера [n][m], где m = n + 1. То есть по второму индексу можно итерировать до j < m или до j <= n (что то же самое).



1



704 / 410 / 203

Регистрация: 19.12.2016

Сообщений: 1,648

16.09.2020, 10:05

11

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

m = n + 1

не заметил, спасибо.



0



17 / 10 / 6

Регистрация: 15.09.2020

Сообщений: 39

16.09.2020, 10:37

12

Пожалуйста, предоставьте сообщение о компиляции этого исходника. Также укажите сам компилятор и его версию. И да, с чего вы решили, что проблема именно в прикреплённом вами куске кода?



0



0 / 0 / 0

Регистрация: 17.09.2020

Сообщений: 1

17.09.2020, 05:54

13

Извиняюсь, почта была утеряна

Компилирует- в том смысле что проходит сборка и он выдает адекватные числа в матрице значений однако ответ выдает неверный
Выдает ошибку- в том смысле что по итогу ответ вообще не тот и в исходнике кода до компиляции он показывает на этот момент как «возможная ошибка», что не мешает ему провести сборку

Добавлено через 6 минут
На это указывает компилятор
Есть далее похожий кусок кода который показывается точно так же

Я пишу на VS 2019 (предположу что последней версии ибо устанавливал недавно).
Ошибка C6385 » «Чтение недопустимых данных из p[i] Доступный обьем для чтения равен «m*8» байт однако считать можно только «16» байт»



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

17.09.2020, 05:54

Помогаю со студенческими работами здесь

Выводит ошибку на строке StudentA student = new Student («Динар», «19», «Е09-31»);В чем причина?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

Ругается на строку Student student = new Student («Динар», «19», «Е09-31»); В чём причина?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

Построить функцию которая возвращает текст «not defined»(«Не определено») при недопустимых значениях х
Ребят вот вопрос возник с такой задачкой..
Для того чтобы вычислить значение выражения(его скрин я…

Написать программу проверки правильности написания сочетаний «жи», «ши», «ча», «ща», «чу», «щу». Исправить ошибки
дан текст.написать программу проверки правильности написания сочетаний &quot;жи&quot;, &quot;ши&quot;, &quot;ча&quot;, &quot;ща&quot;,…

Причина ошибки «Unable to write data to the transport connection»
private void Write(string Message)
{
//используется для перекодирования даных…

Setlocale(LC_CTYPE,»Russian») -причина ошибки printf ?
Работаю на билдере давно. Но до такого маразма не доходил.
Оператор setlocale(LC_CTYPE,&quot;Russian&quot;) …

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

Или воспользуйтесь поиском по форуму:

13

I seem to get an erroneous warning message from Visual Studio 2019 (16.5 Preview but also in 16.4 and earlier) Code Analysis tool. Is this a bug, or am I really just missing something?

The warning generated (exactly) is:

warning C6385: Reading invalid data from ‘prodlist’: the readable size is ‘(size_t)*32+8′ bytes, but ’64’ bytes may be read.

Here’s the code which generates the warning (as minimal as possible)

#include <cstdint>
#include <string>
#include <iostream>

struct Product {
    std::string price_profile;
};

int getNumRows() {
    return 5;
}

Product *getProductsFromDB( int &numelements ) {
    numelements = 0;

    const int num_rows = getNumRows();
    if ( num_rows == 0 ) {
        numelements = 0;
        return nullptr;
    }

    Product *prodlist = new Product[num_rows];
    for ( int i = 0; i < num_rows; ++i ) {
        prodlist[i].price_profile = "test"; // Warning on this line
    }
    numelements = num_rows;

    return prodlist;
}

int main() {
    int num_rows;
    Product *prodlist = getProductsFromDB( num_rows );
    for ( int i = 0; i < num_rows; ++i ) {
        std::cout << prodlist[i].price_profile;
    }

    getchar();
}

If I change the price_profile to an int (and its corresponding value), or if I change num_rows to a constant (like 5) then the warning goes away.

asked Jan 8, 2020 at 16:04

ChrisMM's user avatar

ChrisMMChrisMM

8,44814 gold badges29 silver badges49 bronze badges

3

It seems in Visual Studio 2019 Microsoft is enforcing SAL analysis rules on C and C++ code by default, even though there are still plenty of false positives like your case here.

One thing you can do for now is disable the warning giving a false positive:

#pragma warning(push)
#pragma warning(disable:6385)
Product *getProductsFromDB( int &numelements ) {
 ...
}
#pragma warning(pop)

answered Jan 8, 2020 at 16:26

Govind Parmar's user avatar

Govind ParmarGovind Parmar

20.7k7 gold badges53 silver badges85 bronze badges

3

This question is most likely common and has been asked before. So, after spending a mind-numbing 30 minutes trying to find the solution to what I believe is a false negative, I’m resulting to posting my issue here.

I’m relatively new to C++ Coding and figured I’d create a simple random item generator. Unfortunately, when grasping a random index in my arrays, I am given a c6385 error. This error usually pertains to an invalid or overloaded buffer from the research I’ve found. I believe this means that the index I’m trying to access is too large thanks to rand().

I will continue looking for a solution but would like some others’ opinions of the situation. I may be overlooking a small detail or am failing to grasp a concept. All help is greatly appreciated. If I come across a solution, I will lock/remove this to overpopulate the forums.

Here is my code:
ItemGeneration.h

#pragma once
#include <random>
#include <iostream>
using namespace std;

class ItemGeneration
{
public:
    /*
        Creating the cosntant variables for the items main effects.
        For instance, if you were to roll the main attribute of "Item1",
        this code would dictate what possible attributes that could be chosen.

        In addition to the main attributes, the code for the avaliable sub-attributes is also created below.

        Also creating the const array that hold the rarity of items.
        For instance, an item that rolls a higher weighted value will have a lower rating.
        More rare or 'uncommon' the value, the higher rating the item will recieve.
        Item rarity dictates the value of the attributes assigned to ie, i.e the higher the
        rarity the higher the attributes multiplier in addition to the number of sub-attributes.
    */

    const char* Item1[4]
        = { "Attack %", "Health %", "Defense %", "Elemental Damage %" };

    const char* Item2[4]
        = { "Mana Regeneration", "Cooldown Reduction", "Healing Efficacy", "Elemental Resonance" };

    const char* Item3[4]
        = { "Raw Attack", "Raw Health", "Raw Defense", "Raw Elemental Damage" };

    const char* Item4[4]
        = { "Elemental Resonance", "Critical Chance", "Critical Multiplier", "Mana Regeneration" };

    const char* Item5[4]
        = { "Elemental Damage %", "Critial Chance", "Critical Multiplier", "Cooldown Reduction" };

    const char* SubAttributeList[10]
        = { "Raw Attack", "Raw Health", "Raw Defense", "Raw Elemental Damage", "Elemental Damage %",
            "Elemental Resonance", "Mana Regeneration", "Cooldown Reduction", "Critical Chance", "Critical Multiplier" };

    const char* RarityChart[6]
        = { "Common", "Uncommon", "Rare", "Unique", "Legendary", "Mythical" };

    const int InventoryLimit = 256;
    int InventorySize = 0;

    int ItemCreate(int x, int y) {

        int randNum = rand() % 4 + 1;

        if (InventorySize < InventoryLimit) {
            switch (x) {
            case 1:
                cout << "You have generated an Item1! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item1[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 2:
                cout << "You have generated an Item2! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item2[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 3:
                cout << "You have generated an Item3! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item3[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 4:
                cout << "You have generated an Item4! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item4[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 5:
                cout << "You have generated an Item5! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item5[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            default:
                cout << "They item you tried to generate doesn't seem to exist.\nPlease enter a number between 1 and 5 to generate a random item." << endl;

            }
        }
        else {
            cout << "Sorry, your inventory is too full\nPlease clear some space before attempting to create another item." << endl;
        }
    }
};

Source.cpp

#include <iostream>
#include "ItemGeneration.h"
using namespace std;

int main() {
    int x, y;

    cout << "Welcome to the random item generator!" <<
        "\nPlease enter a number between 1 and 5, " <<
        "\nfollowed by a number between 1 and 10 to select its rarity, " <<
        "\nto receive your own randomly generated item.\n" << endl;

    cin >> x;
    cin >> y;

    ItemGeneration item;
    item.ItemCreate(x, y);
    return;
}

** Update with errors **

I should have been more concise. However, I do not believe there to be an actual buffer error, a false negative.
As for the error messages.

My main function is returning a c2561 error, but I believe that to be a side effect of the item generation, not functioning. MEaning it simply is returning the value as the function isn’t operating.
Here is my terminal readout when attempting to build the solution:

Build started...
1>------ Build started: Project: RandomItemGenerator, Configuration: Debug x64 ------
1>ItemGeneration.cpp
1>Source.cpp
1>C:\Users\Alex\source\repos\RandomItemGenerator\RandomItemGenerator\Source.cpp(18,2): error C2561: 'main': function must return a value
1>C:\Users\Alex\source\repos\RandomItemGenerator\RandomItemGenerator\Source.cpp(5): message : see declaration of 'main'
1>Generating Code...
1>Done building project "RandomItemGenerator.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The quick solution error description:

(const char [17]) "Main Attribute: "
C6385: Reding Invalid Data from 'this->item5'.

This question is most likely common and has been asked before. So, after spending a mind-numbing 30 minutes trying to find the solution to what I believe is a false negative, I’m resulting to posting my issue here.

I’m relatively new to C++ Coding and figured I’d create a simple random item generator. Unfortunately, when grasping a random index in my arrays, I am given a c6385 error. This error usually pertains to an invalid or overloaded buffer from the research I’ve found. I believe this means that the index I’m trying to access is too large thanks to rand().

I will continue looking for a solution but would like some others’ opinions of the situation. I may be overlooking a small detail or am failing to grasp a concept. All help is greatly appreciated. If I come across a solution, I will lock/remove this to overpopulate the forums.

Here is my code:
ItemGeneration.h

#pragma once
#include <random>
#include <iostream>
using namespace std;

class ItemGeneration
{
public:
    /*
        Creating the cosntant variables for the items main effects.
        For instance, if you were to roll the main attribute of "Item1",
        this code would dictate what possible attributes that could be chosen.

        In addition to the main attributes, the code for the avaliable sub-attributes is also created below.

        Also creating the const array that hold the rarity of items.
        For instance, an item that rolls a higher weighted value will have a lower rating.
        More rare or 'uncommon' the value, the higher rating the item will recieve.
        Item rarity dictates the value of the attributes assigned to ie, i.e the higher the
        rarity the higher the attributes multiplier in addition to the number of sub-attributes.
    */

    const char* Item1[4]
        = { "Attack %", "Health %", "Defense %", "Elemental Damage %" };

    const char* Item2[4]
        = { "Mana Regeneration", "Cooldown Reduction", "Healing Efficacy", "Elemental Resonance" };

    const char* Item3[4]
        = { "Raw Attack", "Raw Health", "Raw Defense", "Raw Elemental Damage" };

    const char* Item4[4]
        = { "Elemental Resonance", "Critical Chance", "Critical Multiplier", "Mana Regeneration" };

    const char* Item5[4]
        = { "Elemental Damage %", "Critial Chance", "Critical Multiplier", "Cooldown Reduction" };

    const char* SubAttributeList[10]
        = { "Raw Attack", "Raw Health", "Raw Defense", "Raw Elemental Damage", "Elemental Damage %",
            "Elemental Resonance", "Mana Regeneration", "Cooldown Reduction", "Critical Chance", "Critical Multiplier" };

    const char* RarityChart[6]
        = { "Common", "Uncommon", "Rare", "Unique", "Legendary", "Mythical" };

    const int InventoryLimit = 256;
    int InventorySize = 0;

    int ItemCreate(int x, int y) {

        int randNum = rand() % 4 + 1;

        if (InventorySize < InventoryLimit) {
            switch (x) {
            case 1:
                cout << "You have generated an Item1! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item1[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 2:
                cout << "You have generated an Item2! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item2[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 3:
                cout << "You have generated an Item3! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item3[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 4:
                cout << "You have generated an Item4! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item4[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            case 5:
                cout << "You have generated an Item5! Here are the resulting attributes:" << endl;
                cout << "Main Attribute: " << Item5[randNum] << endl;
                cout << "Sub-Atrributes: " << endl;
                break;

            default:
                cout << "They item you tried to generate doesn't seem to exist.\nPlease enter a number between 1 and 5 to generate a random item." << endl;

            }
        }
        else {
            cout << "Sorry, your inventory is too full\nPlease clear some space before attempting to create another item." << endl;
        }
    }
};

Source.cpp

#include <iostream>
#include "ItemGeneration.h"
using namespace std;

int main() {
    int x, y;

    cout << "Welcome to the random item generator!" <<
        "\nPlease enter a number between 1 and 5, " <<
        "\nfollowed by a number between 1 and 10 to select its rarity, " <<
        "\nto receive your own randomly generated item.\n" << endl;

    cin >> x;
    cin >> y;

    ItemGeneration item;
    item.ItemCreate(x, y);
    return;
}

** Update with errors **

I should have been more concise. However, I do not believe there to be an actual buffer error, a false negative.
As for the error messages.

My main function is returning a c2561 error, but I believe that to be a side effect of the item generation, not functioning. MEaning it simply is returning the value as the function isn’t operating.
Here is my terminal readout when attempting to build the solution:

Build started...
1>------ Build started: Project: RandomItemGenerator, Configuration: Debug x64 ------
1>ItemGeneration.cpp
1>Source.cpp
1>C:\Users\Alex\source\repos\RandomItemGenerator\RandomItemGenerator\Source.cpp(18,2): error C2561: 'main': function must return a value
1>C:\Users\Alex\source\repos\RandomItemGenerator\RandomItemGenerator\Source.cpp(5): message : see declaration of 'main'
1>Generating Code...
1>Done building project "RandomItemGenerator.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The quick solution error description:

(const char [17]) "Main Attribute: "
C6385: Reding Invalid Data from 'this->item5'.

>Solution :

int main() {
   // stuff
   return;  // <- always an error
}

Here’s your problem. You promised that main would return an int, and then you reneged on that promise with just a plain return. main is a little special in that it should return an int, so, failing all else, make it return 0.

int main() {
   // stuff
   return 0; 
}

You did it again in ItemGeneration::ItemCreate

int ItemCreate(int x, int y) 
{
   // stuff
   return;    // nope
}

But in this case, there isn’t really anything to return. Your main routine ignores the return value anyway. So you should declare it to return void instead:

void ItemCreate(int x, int y) 
{
   // stuff
   return;    // OK now (not actually needed, however)
}

I am getting the warning message:

Warning C6385:
Reading invalid data from ‘»WARNING»‘:  the readable size is ’16’ bytes, but ’32’ bytes may be read.

I have been careful to initialize all my parameters upfront as DWORD parameters so that they are 32 bit.  The code is:

DWORDdwRes = 0;

DWORDdwActiveSessionId = WTSGetActiveConsoleSessionId();

DWORDdwTitleLength = 8 * 4; 

DWORDdwMessageLength = 95 * 4; 

DWORDdwTimeoutZero = 0; 

DWORDdwTimeOut45 = 45;

BOOLbSendMessage =
TRUE;

bSendMessage = WTSSendMessage(WTS_CURRENT_SERVER_HANDLE,
dwActiveSessionId,

  (LPWSTR)L»WARNING»,
dwTitleLength, (LPWSTR)ptstrMessage,
dwMessageLength,

  MB_ICONERROR|
MB_TOPMOST|
MB_SETFOREGROUND|
MB_TASKMODAL|
MB_ABORTRETRYIGNORE,

  dwTimeoutZero, &dwRes,
TRUE
);

Any ideas as to what may be causing the warning would be gratefully received.  Many thanks.


Carol Brickley

Понравилась статья? Поделить с друзьями:
  • Ошибка c7002 kyocera
  • Ошибка cc id 126 bmw
  • Ошибка c7000 kyocera 3040
  • Ошибка cbs log win 7
  • Ошибка c7000 kyocera 250ci