Patch #3356 2012-11-03 11:04

mrexodia

Fix: DLL Template + win32gui dialog template for manifests
Download
3356-Fix_DLL_Templa.patch (6.0 KB)
Category
Plugin::Refinement
Status
Accepted
Close date
2012-11-07 10:08
Assigned to
mortenmacfly
Index: src/plugins/scriptedwizard/resources/dll/files/main.cpp
===================================================================
--- src/plugins/scriptedwizard/resources/dll/files/main.cpp    (revision 8500)
+++ src/plugins/scriptedwizard/resources/dll/files/main.cpp    (working copy)
@@ -6,7 +6,7 @@
     MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION);
 }
 
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+extern "C" DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
     switch (fdwReason)
     {
Index: src/plugins/scriptedwizard/resources/win32gui/files/dialog/main.cpp
===================================================================
--- src/plugins/scriptedwizard/resources/win32gui/files/dialog/main.cpp    (revision 8500)
+++ src/plugins/scriptedwizard/resources/win32gui/files/dialog/main.cpp    (working copy)
@@ -1,49 +1,40 @@
-#define WIN32_LEAN_AND_MEAN
-
 #include <windows.h>
-
+#include <commctrl.h>
+#include <stdio.h>
 #include "resource.h"
 
 HINSTANCE hInst;
 
-BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+BOOL CALLBACK DlgMain(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
     switch(uMsg)
     {
-        case WM_INITDIALOG:
-            /*
-             * TODO: Add code to initialize the dialog.
-             */
-            return TRUE;
+    case WM_INITDIALOG:
+    {
+    }
+    return TRUE;
 
-        case WM_CLOSE:
-            EndDialog(hwndDlg, 0);
-            return TRUE;
+    case WM_CLOSE:
+    {
+        EndDialog(hwndDlg, 0);
+    }
+    return TRUE;
 
-        case WM_COMMAND:
-            switch(LOWORD(wParam))
-            {
-                /*
-                 * TODO: Add more control ID's, when needed.
-                 */
-                case IDC_BTN_QUIT:
-                    EndDialog(hwndDlg, 0);
-                    return TRUE;
-
-                case IDC_BTN_TEST:
-                    MessageBox(hwndDlg, "You clicked \"Test\" button!", "Information", MB_ICONINFORMATION);
-                    return TRUE;
-            }
+    case WM_COMMAND:
+    {
+        switch(LOWORD(wParam))
+        {
+        }
     }
-
+    return TRUE;
+    }
     return FALSE;
 }
 
 
 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
 {
-    hInst = hInstance;
-
-    // The user interface is a modal dialog box
-    return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)DialogProc);
-}
+    hInst=hInstance;
+    InitCommonControls();
+    return DialogBox(hInst, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)DlgMain);
+}
\ No newline at end of file
Index: src/plugins/scriptedwizard/resources/win32gui/files/dialog/manifest.xml
===================================================================
--- src/plugins/scriptedwizard/resources/win32gui/files/dialog/manifest.xml    (revision 0)
+++ src/plugins/scriptedwizard/resources/win32gui/files/dialog/manifest.xml    (working copy)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
+    </dependentAssembly>
+  </dependency>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel
+          level="asInvoker"
+          uiAccess="false"/>
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+</assembly>
\ No newline at end of file
Index: src/plugins/scriptedwizard/resources/win32gui/files/dialog/resource.h
===================================================================
--- src/plugins/scriptedwizard/resources/win32gui/files/dialog/resource.h    (revision 8500)
+++ src/plugins/scriptedwizard/resources/win32gui/files/dialog/resource.h    (working copy)
@@ -1,8 +1,5 @@
-#include <windows.h>
+#ifndef IDC_STATIC
+#define IDC_STATIC (-1)
+#endif
 
-// ID of Main Dialog
-#define DLG_MAIN 101
-
-// ID of Button Controls
-#define IDC_BTN_TEST 1001
-#define IDC_BTN_QUIT 1002
+#define DLG_MAIN                                100
Index: src/plugins/scriptedwizard/resources/win32gui/files/dialog/resource.rc
===================================================================
--- src/plugins/scriptedwizard/resources/win32gui/files/dialog/resource.rc    (revision 8500)
+++ src/plugins/scriptedwizard/resources/win32gui/files/dialog/resource.rc    (working copy)
@@ -1,14 +1,30 @@
+// Generated by ResEdit 1.5.10
+// Copyright (C) 2006-2012
+// http://www.resedit.net
+
+#include <windows.h>
+#include <commctrl.h>
+#include <richedit.h>
 #include "resource.h"
 
-DLG_MAIN DIALOGEX 6, 5, 194, 106
 
-CAPTION "Code::Blocks Template Dialog App"
 
-FONT 8, "Tahoma"
 
-STYLE 0x10CE0804
+/
download for full patch...
mrexodia 2012-11-03 11:09

Forgot to patch wizard.script for adding the needed import libraries