Hello all, I am fairly new to c++ programming, and completely new to this forum. I am having a problem. This dll is supposed to display a dialog box with the words the person specefies in Game Maker 7.
Here is my file dllmain.cpp:
Code:
/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>
export const CHAR* Dialog(const CHAR* string1, const CHAR* string2)
{
MessageBox(0,string1,string2,MB_OK);
}
And here is my Game Maker scripts (I will try to explain as good as I can for people who don't use Game Maker 7)
Script dialog_init:
Code:
global.Dialog = external_define("WindowsDialog.dll", "Dialog" ,dll_stdcall ,ty_real, 2, ty_string, ty_string);
global.Dialog is a variable defining the external function "Dialog" from the dll "WindowsDialog.dll".
dll_stdcall is the call type
ty_real is the resource type
2 is the number of arguments (caption and text)
ty_string and ty_string are the strings for caption and text
And here is the script show_dialog:
Code:
external_call(global.Dialog, argument0, argument1);
argument0 is the first parameter the user types when he calls the script for the caoption
so is argument1 for the text
And finally the code used to call it:
Code:
dialog_init();
show_dialog('Caption','Text');
Initializes the dll
Shows the dialog with the caption 'Caption' and the text 'Text'.
Here is where the problem comes in. It works perfectly, and the gives me an error and I have to abort. Can anyone help me?