• Welcome to Dark Bit Factory & Gravity.
 

noob questions.

Started by Paul, March 08, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Paul

Hi, Ive got some noob questions.

1. How do i get rid of the window(the one whch always come up when i run anything)

2. Is it possible to get the commandline parameters in freebasic?

3. Is it possible to compie dlls with freebasic?
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

rdc

Yes, to all of those.

1) Compile with -s gui to get rid of the console.
2) You can get the command line parms using the Command function. From the help:


''
'' command-line arguments example
''

     Print "exe name= "; Command( 0 )

     Dim argc As Integer, argv As String

     argc = 1
     Do
         argv = Command( argc )

         If( Len( argv ) = 0 ) Then
             Exit Do
         End If

         Print "arg"; argc; " = """; argv; """"

         argc += 1
     Loop

     If( argc = 1 ) Then
         Print "(no arguments)"
     End If
     Print "The complete list: ";Command


3) Compile with -dll to create a DLL.

You can get the current docs at the FB wiki.

ferris

You beat me to this one :P
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Paul

Thx for the quick answer, helped allot:)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Paul

One more question how, a little more exactly do i create a dll.
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Paul

#5
I've got this code and its compiling to a dll but i cant get it to work.


#include "windows.bi"
option explicit
declare function testfunc(in as string) as integer

'testfunc("hello")

function testfunc(in as string) EXPORT
    return messagebox(0,in,"test",0)
end function


I'm using this code in Blitz to test it

bank=CreateBank(4)
Print CallDLL("dll.dll","testfunc@4",bank)


changed the code to and that works, but if i send a bank iwth anything other than 0 it craches


#include "windows.bi"
option explicit
declare function testfunc lib "dlltest" alias "testfunc" (in as string) as integer

'testfunc("hello")

function testfunc(in as string) EXPORT
    return messagebox(0,in,"test",0)
end function
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Shockwave

Damn, that's 2 questions that you posted today that I don't have a clue! Hopefully someone can help. Sorry.
Shockwave ^ Codigos
Challenge Trophies Won: