Patrice,
I have an issue:
This code produces the vc_hellosdk image with Visual Studio 2015 Community.
#include <windows.h>
#pragma comment(lib,"User32.lib")
#pragma comment(lib,"gdi32.lib")
#define cSizeOfDefaultString 2048
#define IDC_OK 1001
#define IDC_CANCEL 1002
#define IDC_TEXT 1003
static HWND hText;
static HWND hOk;
static HWND hCancel;
int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int);
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR CmdLine, int CmdShow)
{
WNDCLASSEX wcx = {0};
MSG uMsg = {0};
HWND hWin = {0};
DWORD dwStyle = {0};
DWORD dwStyleEx = {0};
HFONT hFont = {0};
hFont = ( HFONT) GetStockObject( DEFAULT_GUI_FONT);
char szClassName[] = "MyClassName";
wcx.cbSize = sizeof( wcx);
wcx.style = CS_HREDRAW | CS_VREDRAW;
wcx.lpfnWndProc = WndProc;
wcx.cbClsExtra = 0;
wcx.cbWndExtra = 0;
wcx.hInstance = hInst;
wcx.hIcon = LoadIcon( NULL, IDI_APPLICATION);
wcx.hCursor = LoadCursor( NULL, IDC_ARROW);
wcx.hbrBackground = ( HBRUSH)( COLOR_BTNFACE + 1);
wcx.lpszMenuName = 0;
wcx.lpszClassName = szClassName;
wcx.hIconSm = LoadIcon( NULL, IDI_APPLICATION);
RegisterClassEx( &wcx);
dwStyle = WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION;
dwStyleEx = WS_EX_DLGMODALFRAME | WS_EX_CONTROLPARENT | WS_EX_WINDOWEDGE;
hWin = CreateWindowEx( dwStyleEx, szClassName, "What is your name? ", dwStyle, ( GetSystemMetrics( SM_CXSCREEN) - 246) / 2, ( GetSystemMetrics( SM_CYSCREEN) - 110) / 2, 246, 110, 0, (HMENU) 0, hInst, NULL);
hText = CreateWindowEx( WS_EX_CLIENTEDGE, "Edit", "", WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL, 21, 20, 201, 19, hWin, (HMENU) IDC_TEXT, hInst, NULL);
SendMessage(hText, (UINT)WM_SETFONT, (WPARAM)hFont, (LPARAM)0);
hOk = CreateWindowEx( 0, "Button", "OK", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 51, 52, 60, 23, hWin, (HMENU) IDC_OK, hInst, NULL);
SendMessage(hOk, (UINT)WM_SETFONT, (WPARAM)hFont, (LPARAM)0);
hCancel = CreateWindowEx( 0, "Button", "Cancel", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 126, 52, 60, 23, hWin, (HMENU) IDC_CANCEL, hInst, NULL);
SendMessage(hCancel, (UINT)WM_SETFONT, (WPARAM)hFont, (LPARAM)1);
SetFocus(hText);
ShowWindow(hWin, SW_SHOW);
while(GetMessage( &uMsg, NULL, 0, 0))
{
if(IsDialogMessage(hWin, &uMsg))
{
continue;
}
TranslateMessage( &uMsg);
DispatchMessage( &uMsg);
}
return uMsg.wParam;
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_COMMAND:
if((HWND)lParam == hCancel )
{
SendMessage(hWnd, (UINT)WM_CLOSE, (WPARAM)0, (LPARAM)0);
}
}
return DefWindowProc(hWnd, Msg, wParam, lParam);
}
The original code was the PowerBASIC HelloDDT example.
The PbWin9 HelloDDT and the PBWin10 HelloDDT along with all my other c/c++ compilers produce the gcc_hellosdk.jpg image.
James