Pregunta

ENV vc6.0

'Test_Proc' is already exists in 'TestDlg.h'. and #include "TestDlg.h" is in this file.

'Test_Proc' is used like this:

HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE);
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DIALOG_PRESENTTYPE), hWnd, Test_Proc,NULL);

TestDlg.cpp

#include "TestDlg.h"

BOOL WINAPI Test_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch(uMsg)
    {
        HANDLE_MSG(hWnd, WM_INITDIALOG, Test_OnInitDialog);
        HANDLE_MSG(hWnd, WM_COMMAND, Test_OnCommand);
        HANDLE_MSG(hWnd,WM_CLOSE, Test_OnClose);
    }

    return FALSE;
}

TestDlg.h

#ifndef _LOGIN_H
#define _LOGIN_H

#include <windows.h>

BOOL WINAPI Test_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL Test_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
void Test_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
void Test_OnClose(HWND hwnd);

#endif

error

C:\Program Files (x86)\Microsoft Visual Studio\MyProjects\mm1\SearchMemberDlg.cpp(378) : error C2065: 'Test_Proc' : undeclared identifier

The erros is wired. Anyone has similar experiences? Thank you.

Is there something wrong with vc6.0?

¿Fue útil?

Solución

SearchMemberDlg.cpp must #include "TestDlg.h" and you should change the include guard in TestDlg.h from _LOGIN_H to TESTDLG_H_INCLUDED, otherwise you might have problems if you include TestDlg.h after Login.h.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top