fausto
FOI SuperMod
Hello!
My goal is to create a dialog box similar to Atantis one (you can open it hitting CTRL SPACE) but i'm facing serious troubles in this mission..
I give a look to Atlantis sample and i found what seemed to be right to create a dialog box. I found it in Atlantis.ccp, Atlantis.rc and resource.h.
This is the resulting code:
padqacont.ccp:
resource.h:
padqacont.rc:
Now, when I hit CTRL SPACE nothing happens.. I'm fighting for two days but that dialog box refuses to open.. Can someone help me finding the way to do that?
I can tell you I'm using a VISUAL C++ 2010 EXPRESS EDITION compiler.. maybe it can't compile .rc files? It seems strange to me.. the Antares capusle i coded some months ago had an .rc file included for bitmap files list and it worked perfectly..
I need to solve this mistery.. :compbash:
My goal is to create a dialog box similar to Atantis one (you can open it hitting CTRL SPACE) but i'm facing serious troubles in this mission..
I give a look to Atlantis sample and i found what seemed to be right to create a dialog box. I found it in Atlantis.ccp, Atlantis.rc and resource.h.
This is the resulting code:
padqacont.ccp:
Code:
#include "DlgCtrl.h"
#include "resource.h"
ypedef struct {
HINSTANCE hDLL;
HINSTANCE hModule;
//SURFHANDLE tkbk_label;
//HFONT font[1];
}GDIParams;
GDIParams g_Param;
BOOL CALLBACK DlgProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
oapiCloseDialog (hWnd);
return TRUE;}
break;
}
return oapiDefDialogProc (hWnd, uMsg, wParam, lParam);
}
int padqacont::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
{
if (!down) return 0; // only process keydown events
if (KEYMOD_CONTROL (kstate)) {
switch (key) {
case OAPI_KEY_SPACE: // deploy/retract antenna
oapiOpenDialogEx(g_Param.hDLL, IDD_CTRL, DlgProc,DLG_CAPTIONCLOSE, this);
//failure_code=0;
return 1;
}
}
return 0;
}
resource.h:
Code:
#define IDC_STATIC 100
#define IDD_CTRL 101
padqacont.rc:
Code:
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.K.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_CTRL DIALOGEX 0, 0, 115, 30
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Control"
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "Control",IDC_STATIC,4,51,50,28
END
#endif // English (U.K.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
Now, when I hit CTRL SPACE nothing happens.. I'm fighting for two days but that dialog box refuses to open.. Can someone help me finding the way to do that?
I can tell you I'm using a VISUAL C++ 2010 EXPRESS EDITION compiler.. maybe it can't compile .rc files? It seems strange to me.. the Antares capusle i coded some months ago had an .rc file included for bitmap files list and it worked perfectly..
I need to solve this mistery.. :compbash: