Hello All!

I would like to create a message box from one of my "C" applications. I have looked at
prior posts and received a snippet such as this one:

#include windows.h

MessageBox(hwnd, "You have bla bla", buffer, MB_OK);char buffer[100];

Well, the problem is that during the build of my application the "windows.h" is not found, several compliation errors, etc...

Can anyone direct me to where I can find out how to use the MessageBox function, if that is
the correct function name, it was an "undefined symbol" as well.

Thanks!

Hello All!

I would like to create a message box from one of my "C" applications. I have looked at
prior posts and received a snippet such as this one:

#include windows.h

MessageBox(hwnd, "You have bla bla", buffer, MB_OK);char buffer[100];

Well, the problem is that during the build of my application the "windows.h" is not found, several compliation errors, etc...

Can anyone direct me to where I can find out how to use the MessageBox function, if that is
the correct function name, it was an "undefined symbol" as well.

Thanks!

MessageBox(NULL, "Title", "Message", MB_OK);

if you use buffers don't forget to init them.

A little snippet can be found http://www.daniweb.com/code/snippet719.html here.
For getting deeper in the bowels of MS Windows check this http://www.winprog.org/tutorial/start.html one

Hello again:

We are on an AIX 4.3 Machine using UNIX. I tried

#include <windows.h>

from the onset and the compliation failed miserably.

Also, MessageBox seems not to exist. I recieved an "undefined symbol" and in the error log there is reference to a function called "msgbox". So, I am thinking this might be the function used on my machine.

Is anyone familiar with this? Thanks!

Edited 3 Years Ago by happygeek: fixed formatting

Try this ti types

MessageBoxA
MessageBoxW

Only put a letter after a function.

Edited 3 Years Ago by happygeek: fixed formatting

Not sure what you are trying to say. I can not find the windows.h header file or a messagebox function. Is this a part of the standard library, or where can I find out how to use "msgbox"..?

Edited 3 Years Ago by happygeek: fixed formatting

What compiler do you using?

I am on an AIX Box using 4.3.

Windows.h is include at Visual Studio and Borland Windows Products. You can't install WinAPI in UNIX for example. Better bye Visual or Borland or Bloodshed C++

We just made the discovery! Looked in /usr/include and the header windows.h was not included. Something else that we just figured out, C/UNIX does not support standard function calls which are "mixed-case", ie. MessageBox(). Thanks anyway!

We are on an AIX 4.3 Machine using UNIX.

Let me finish the misery over here.
You are in a UNIX operating system.
The MessageBox function is part of the MS Windows environment API. It won't work to draw GUI for UNIX.
You could look at curses library, motif or gtk in order to create some form of GUI for it.

This article has been dead for over six months. Start a new discussion instead.