Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-27-2007, 12:08 PM
Alhazred Alhazred is offline
Newbie
 
Join Date: Jul 2007
Posts: 23
Rep Power: 6
Alhazred is on a distinguished road
Default [C - Windows] Create a DOS gui

I would give a better look to the software I'm writing, I want to be able to select an option by highlight it with arrow keys instead of write the correspondent number, something like what you can see in the pic below


Where could I find documentation to do such a thing?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-28-2007, 02:46 AM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,654
Last Blog:
CherryPy(thon)
Rep Power: 29
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

You could choose to use the library, curses, which also is available for Windows. You could also do it, only using functions from the Win32 API. Take a look at this source, it will help you getting started.
__________________
05-03-2007 - 11-13-2008
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-28-2007, 04:59 AM
Alhazred Alhazred is offline
Newbie
 
Join Date: Jul 2007
Posts: 23
Rep Power: 6
Alhazred is on a distinguished road
Default

Tanks, that's what I need
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-28-2007, 08:40 AM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 507
Last Blog:
Just over the next hil...
Rep Power: 10
G_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura about
Default

I'd recommend curses solely for portability. Most systems have an implementation of it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-29-2007, 12:59 PM
Alhazred Alhazred is offline
Newbie
 
Join Date: Jul 2007
Posts: 23
Rep Power: 6
Alhazred is on a distinguished road
Default

My software has a didactic aim and the code suggested by v0id matches what I need. I have understood how to obtain the graphic effect I want and I can do it.
I have only one problem now, inside that code you can read
Code:
menu_item const pb_list_menu[] =
{
  {"Ole",   NULL, func_231},
  {"Peter", NULL, func_232},
  {"Poul",  NULL, func_233},
  {"Back",  NULL, NULL},
  {NULL,    NULL, NULL}
};
is it possible to call a function with its parameters inside that structure?
Something like this
Code:
menu_item const main_menu[] =
{
  {"Write a new email", NULL, WriteMail(hServer, hClient)},
  {"Read received emails", NULL, ReadMail(hServer, hClient, 2)},
  {"Read sent emails", NULL, ReadMail(hServer, hClient, 3)},
  {"Delete email",NULL, DeleteMail(hServer)},
  {"Exit", NULL, LogOut(hServer)},
  {NULL, NULL, NULL}
};
What should I change to do that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 10-30-2007, 10:17 AM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,654
Last Blog:
CherryPy(thon)
Rep Power: 29
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

Code:
typedef struct menu_item
{
  const char *title;
  struct menu_item const *submenu;
  void(*function)(void);
}menu_item;
You can't do what you're trying to, because the functions do not match the function pointer in the menu_item-structure. The function pointer only mathes funtions with an empty parameter-list, and a return-value of nothing too.
You need to modify the function pointer (void (*function(void)) if you want to use other functions. You shall not care about the parameters to the functions, in the array, only the name of the function.
__________________
05-03-2007 - 11-13-2008
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a XML file at the server side? shannelleng ASP, ASP.NET and Coldfusion 8 08-12-2007 04:27 AM
create e-book compiler pcdctr General Programming 8 05-23-2007 07:26 AM
Create pluggin with Java nilshv Java Help 0 04-08-2007 10:27 AM
Create a ripple effect ahsan16 Photoshop Tutorials 6 01-11-2007 11:55 AM
Cool Article for Visual Studio 2005 - Create non-square forms Jordan Software Development Tools 2 05-01-2006 07:36 AM


All times are GMT -5. The time now is 03:06 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads