English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 08 July 2015, 13:48   #1
Sparticle
Registered User
 
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
problem launching my program using an icon

My program wont launch when I create an associated .info file.
The icon type is a tool but still wont run.

Do I need to add some special code for it to run from WB with an icon, or is there some option in the compiler I need to use?

I'm using Hisoft c/c++ compiler.

Thanks.
Sparticle is offline  
Old 08 July 2015, 21:31   #2
Lonewolf10
AMOS Extensions Developer
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 40
Posts: 1,920
I assume the appropriate flags are set (Read, Write, Execute and Deletable - you really only need the Exexcute flag to be set, but it's good to have all 4) in the info file?
Lonewolf10 is offline  
Old 08 July 2015, 22:08   #3
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,846
Quote:
Originally Posted by Sparticle View Post
My program wont launch when I create an associated .info file.
The icon type is a tool but still wont run.

Do I need to add some special code for it to run from WB with an icon, or is there some option in the compiler I need to use?

I'm using Hisoft c/c++ compiler.

Thanks.
You probably have to define a seperate entry point for running from Workbench.

I don't know Hisoft, but Dice C for example calls main() only from CLI and wbmain() from Workbench.

To remain compatible with other compilers I usually do something like this:
Code:
void wbmain (struct WBStartup *wbmsg)
{
main (0,(char **)wbmsg);
}
Everything else is done in main(), depending on whether argc is 0 (Workbench) or > 0 (CLI).
thomas is offline  
Old 10 July 2015, 14:53   #4
Sparticle
Registered User
 
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
Quote:
Originally Posted by Lonewolf10 View Post
I assume the appropriate flags are set (Read, Write, Execute and Deletable - you really only need the Exexcute flag to be set, but it's good to have all 4) in the info file?


The Flags were set. It turned out to be not including the "wbstartup.h" header file in my project.

Thanks
Sparticle is offline  
Old 10 July 2015, 15:05   #5
Sparticle
Registered User
 
Join Date: May 2009
Location: Leicester/U.K
Posts: 36
Quote:
Originally Posted by thomas View Post
You probably have to define a seperate entry point for running from Workbench.

I don't know Hisoft, but Dice C for example calls main() only from CLI and wbmain() from Workbench.

To remain compatible with other compilers I usually do something like this:
Code:
void wbmain (struct WBStartup *wbmsg)
{
main (0,(char **)wbmsg);
}
Everything else is done in main(), depending on whether argc is 0 (Workbench) or > 0 (CLI).
It was because I didn't include the "wbstartup.h" header

Hisoft Doesn't seem to have seperate entry points. Ive looked at some of the examples provided in Hisoft but couldn't find anything.

Thanks.
Sparticle is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
What's involved getting my game launching from WB icon? jimmy2x2x Coders. Asm / Hardware 5 18 December 2014 13:18
mouse icon pointer problem cd32 toolkit amigapd support.Other 8 07 February 2011 09:00
Icon Update program - what do you use? Bloodwych support.Apps 9 22 September 2007 22:54
SoccerKid AGA Whdload Icon Problem Anubis project.WHDLoad 0 16 March 2006 15:10
Icon's problem GoKu project.WHDLoad 2 07 September 2005 10:50

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

Forum Jump


All times are GMT +2. The time now is 20:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06374 seconds with 13 queries