Plugin MessageBox?

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Wed Mar 11, 2009 9:53 pm

Sorry. I am new with this plugin making business, so I thought I would ask for a little help. :)

I am trying to learn this stuff step by step, and I wanted to know how I would get a message box to popup with some information when the plugin is dropped into the interface of Construct.

Does anyone know how I would do this? Thanks in advance!

stephen1980
B
2
G
3
Posts: 24
Reputation: 898

Post » Wed Mar 11, 2009 10:12 pm

Do you mean when an object is added?
Normally, the user can change settings over in the properties bar.
That would be the usual place for notifications as well.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Mar 11, 2009 10:32 pm

It's the OnPut function in edittime.cpp, though I agree that it's not really an ideal way to give information.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Wed Mar 11, 2009 10:37 pm

[quote="Rich":2ma1fufh]It's the OnPut function in edittime.cpp, though I agree that it's not really an ideal way to give information.[/quote:2ma1fufh]

Sorry if I confused you. This messagebox is not going to be in the released version of the plugin. This is just so that I can get more familiar with the Plugin SDK, and my friend wants a specific plugin that does this.

By the way, this may sound dumb, but what would the code look like for the Message Box Popup? I keep getting errors.

Thanks for all of the help, guys!

stephen1980
B
2
G
3
Posts: 24
Reputation: 898

Post » Wed Mar 11, 2009 10:44 pm

B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Wed Mar 11, 2009 10:49 pm

[quote="Rich":29rq7lxj]http://msdn.microsoft.com/en-us/library/ms645505(VS.85).aspx[/quote:29rq7lxj]

Page is not found.

stephen1980
B
2
G
3
Posts: 24
Reputation: 898

Post » Wed Mar 11, 2009 10:53 pm

You need to copy the whole link. Or click here.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Mar 11, 2009 11:42 pm

Thanks.

I still keep getting one error. Can you tell me what is wrong with my code?

[code:d979winx]int DisplayMessageBox()
{
int msgboxID = MessageBox(
NULL,
L"3D Mesh is already loaded.\nDo you want to replace it?",
L"Confirm Load As",
MB_ICONEXCLAMATION | MB_YESNO
);

if (msgboxID == IDYES)
{
// Lots of Code
}

return msgboxID;
}[/code:d979winx]

I get the following error: Error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'const wchar_t [54]' to 'LPCSTR' c:\Program Files\Scirra\SDK\3DMesh\Edittime.cpp 80 Template SDK

Am I missing something?

Thanks.
stephen1980
B
2
G
3
Posts: 24
Reputation: 898

Post » Thu Mar 12, 2009 3:23 am

Don't use unicode strings (get rid of the L). Try some basic C++ tutorials before asking some questions about the SDK. Knowing the language well is a prerequisite.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Thu Mar 12, 2009 9:48 pm

Thanks. I found the problem.

stephen1980
B
2
G
3
Posts: 24
Reputation: 898

Next

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests