GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Jan-2009, 04:25
Sindarin's Avatar
Sindarin Sindarin is offline
New Member
 
Join Date: Jan 2009
Posts: 1
Sindarin is on a distinguished road
Exclamation

Simple DLL displaying a Messagebox with custom text


Hello, I am trying to create a DLL for practice which shows up a messagebox with a custom string but it doesn't work,

CPP / C++ / C Code:
#include "dll.h"
#include <windows.h>
#include <string>
using namespace std;

export double get_tab_key(char custommsg)
{
if(GetAsyncKeyState(VK_TAB))
{
MessageBox(0, custommsg, "Tab Message!", MB_OK | MB_ICONERROR);
}
return 1;
}

Now the custommsg is supposed to be a custom string. It seems that Messagebox doesn't like this though.
  #2  
Old 20-Jan-2009, 04:52
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,032
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: Simple DLL displaying a Messagebox with custom text


Quote:
Originally Posted by Sindarin
Hello, I am trying to create a DLL for practice which shows up a messagebox with a custom string but it doesn't work,

CPP / C++ / C Code:
#include "dll.h"
#include <windows.h>
#include <string>
using namespace std;

export double get_tab_key(char custommsg)
{
if(GetAsyncKeyState(VK_TAB))
{
MessageBox(0, custommsg, "Tab Message!", MB_OK | MB_ICONERROR);
}
return 1;
}

Now the custommsg is supposed to be a custom string. It seems that Messagebox doesn't like this though.

You are trying to pass to MessageBox a char - try a char array.

Best regards,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Power Calibration Error In Nero Fix (hopefully) matt3678 Computer Hardware Forum 60 20-Aug-2009 06:04
Problem displaying Icelandic Text in the label of Fl_Box alka08 FLTK Forum 1 22-Jul-2008 09:23
help with displaying text in game! seabreeze C++ Forum 1 11-Jul-2006 03:02
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 11:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 12:28

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:07.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.