Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / GDK Commandline parameters

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 9th Sep 2006 08:03
does anyone know what dbCL returns when it has no parameters null seems to get me errors "/0" dont work either.

and if anyone has got the following code to work i would love to know what they did with the below error.

http://forum.thegamecreators.com/?m=forum_view&t=57438&b=22 is an excellent commandline parameter example with their own code created but it gives the following error "error C2440: '=' : cannot convert from 'LPWSTR' to 'char *'"

fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 9th Sep 2006 09:10
here is the code i want to get 2 work



fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 9th Sep 2006 09:12
in regards to the above code i forgot to mention then continent variable is declared as follows
char continent[11];

fubar
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 9th Sep 2006 11:26
Quote: "does anyone know what dbCL returns when it has no parameters null seems to get me errors "/0" dont work either"

Yes, it returns an empty string, and NOT NULL.

Come to the last Unofficial DBPro Convention - register interest by Saturday 2/9/06 (http://convention.logicstudios.net/)
Demoing at the last Chichester Convention : Humans On A Planet
malcolm
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location:
Posted: 9th Sep 2006 12:11
i found out that this command did not work so told lee
he sent me a new 3d.lib file which i am using for my program has i needed this command
i can not send you the file
but if you realy need it ask lee and tell him malcolm told you

i think it will be fixed in the next update
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 9th Sep 2006 13:23
AH the precious updates, I dont think you would be allowed to send the file so thats okay. Im still waiting for the dbGhosting commands to be fixed aswell. I will just have to wait for the update.

The Problem is my menu program executes another file which uses command line parameters. The executing passes a redirection to a pointer.


fubar
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 19th Sep 2006 08:51 Edited at: 19th Sep 2006 08:52
if trying to get command lines, there is always my old hacky method:

http://forum.thegamecreators.com/?m=forum_view&t=57438&b=22

i presume it still works with the latest versions - kinda surprised dbCL() doesnt work yet though o.O

Kaiyodo
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 19th Sep 2006 14:41
Or you could use __argc and __argv. They're exactly the same as the ones you'd get passed into main(), but they're available as global variables if you're compiling for Windows.

Kaiyodo.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th Sep 2006 15:46
thanks kaiyodo just got the following to compile using __argc and __argv ill test when my download stops or sooner if i get impatient


and anyone interested in great command line parameters can use the header #include "CmdLine.h"
CCmdLine is a simple way to parse a command line into switches and arguments it works with both mfc and non mfc apps and im sure if you google it you will find plenty of help using it

fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th Sep 2006 17:07
Yep __argc and __argv worked perfectly

my working code for those interested


fubar
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 20th Sep 2006 14:30
You do know that third strcpy function will never be called...

Wibble
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 20th Sep 2006 15:59
The 3rd string function is only meant to be called if the compared values are all false ie maybe Autralia entered instead of australia so it should default to australia. And i was under the impression strcmp returns 1 if true and 0 if false so if all false it should copy Australia.

fubar
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 20th Sep 2006 16:17 Edited at: 20th Sep 2006 16:18
No, its the opposite way around.

= 0 - Strings compare
< 0 - One side is greater than the other
> 0 - Other side is greater than the other

Wibble

Login to post a reply

Server time is: 2024-11-19 08:29:36
Your offset time is: 2024-11-19 08:29:36