0

デバイス メッセージが内部で宣言されているクラス スキャナーを使用しています。これは、scanner.h ファイル コードです。

#pragma once
class CScanner
{
public:
    CScanner(void);


    class CDeviceMessage;

    ~CScanner(void);
};

このポインターにエラーがあるメソッドのデバイス メッセージ クラスで問題が発生しました。CDeviceMessage.h が許可されていない不完全なクラス型へのポインタを示しています。

CDeviceMessage.h ファイル コードはここにあります。完全なコードは含まれていませんが、関数の定義と宣言が含まれているので、理解できるかもしれません。

#pragma once
#include "Scanner.h"


class CScanner::CDeviceMessage
{

bool MatchesOtherMessage(CScanner::CDeviceMessage * other);

};

エラーが発生するCDeviceMessage.cpp関数は次のとおりです。

bool CScanner::CDeviceMessage::MatchesOtherMessage(CDeviceMessage *other)
{

    if (other != NULL)
            {
                if ((this->imgMessage != NULL) && (other->imgMessage != NULL))/// here it gives on this pointer error that pointer to incomplete class type is not allowed
                {
                    int timeDiff = this->imgMessage->OnlineMilliseconds
                            - this->imgMessage->OnlineMilliseconds;
                    if ((timeDiff > -20) && (timeDiff < 40))
                    {
                        return true;
                    }
                }
            }
            return false;
}
4

1 に答える 1