Author Topic: noob questions.  (Read 3358 times)

0 Members and 1 Guest are viewing this topic.

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
noob questions.
« on: March 08, 2007 »
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:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: noob questions.
« Reply #1 on: March 08, 2007 »
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:

Code: [Select]
''
'' 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.

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: noob questions.
« Reply #2 on: March 08, 2007 »
You beat me to this one :P
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: noob questions.
« Reply #3 on: March 08, 2007 »
Thx for the quick answer, helped allot:)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: noob questions.
« Reply #4 on: March 08, 2007 »
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:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: noob questions.
« Reply #5 on: March 08, 2007 »
I've got this code and its compiling to a dll but i cant get it to work.

Code: [Select]
#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
Code: [Select]
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

Code: [Select]
#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
« Last Edit: March 08, 2007 by Paul »
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: noob questions.
« Reply #6 on: March 08, 2007 »
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: