Problem with creating DLL

Everything else that doesn't fall into one of the other PB categories.
Thorsten
User
User
Posts: 28
Joined: Sun Apr 27, 2003 2:55 pm
Location: Germany
Contact:

Problem with creating DLL

Post by Thorsten »

My DLL Code:

Code: Select all

ProcedureDLL.l GetFolder(Mainfolder.s, Patter.s, Number.l, Gadget.l)
  
  Protected Mainfolder
  Protected Patter
  Protected Number
  Protected Gadget
  
  ;Number := Freie ID
  ;Patter := Welche Dateien sollen ausgegeben werden? Beispiel: *.exe
  ;Mainfolder := Ordner, wo die E-Mail Daten gespeichert sind
  ;Gatget := Die Gadget Nummer des Zieles
  
  Protected What.l
  

  
  If ExamineDirectory(Number, Mainfolder, Patter) <> 0
    
    ClearGadgetItemList(Gadget)
    
    Repeat
      What = NextDirectoryEntry()
      If What = 2        
        AddGadgetItem(Gadget, -1, DirectoryEntryName()) 
      EndIf
    Until What = 0
    
    ProcedureReturn #True
    
  Else
    MessageRequester("Fehler","Das Datenverzeichnis kann nicht durchsucht werden!",#MB_SETFOREGROUND|#PB_MessageRequester_Ok|#MB_ICONEXCLAMATION|#MB_DEFBUTTON1)
    ProcedureReturn #False
  EndIf  
  
EndProcedure
I create now a DLL. Then I copy the new PureBasic.dll to my program
directory and rename it.

But any time the OpenLibrary() function don't work. I can't open my own
DLL ....

I use the newest PB version with all updates from
http://www.purebasic.com/update/
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Did you disable the debugger when creating the dll?
I heared there are some problems when not.

I am also not sure, if stuff like AddGadgetItem() works with Gadgetsthat are created from the main program. You'll have to test that.

Timo
quidquid Latine dictum sit altum videtur
Thorsten
User
User
Posts: 28
Joined: Sun Apr 27, 2003 2:55 pm
Location: Germany
Contact:

Post by Thorsten »

Yes - the debugger is off :wink:

But I can't test the Gadget things, if the simple
OpenLibrary() don't work :?

Any idea?

What's about this: Any one from you make for me the DLL
(see the code at top) and I test it.

If this is okay, my PB have a problem. If not - maybe PB have
a bug.
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2148
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

But any time the OpenLibrary() function don't work. I can't open my own DLL ....
I've tested your code on my system (WinXP SP1, PB3.62 + latest updates) and the OpenLibrary function worked without problems. But you must SAVE your source with the loading rountine first (in same directory as the renamed Dll)...
See also my more detailed answer on your thread in german forum.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2148
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

Thorsten wrote:What's about this: Any one from you make for me the DLL (see the code at top) and I test it.
Thorsten, have send you the Dll per Mail.
(Here on english forum, no one can see your email address...)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Thorsten
User
User
Posts: 28
Joined: Sun Apr 27, 2003 2:55 pm
Location: Germany
Contact:

Post by Thorsten »

Ohh ... I have found the problem 8)

What have I do?

I have erase my complete PB. Then I have my PB 2.9
install and then the update to the newest version.

Then: All is okay, my DLL work's fine :D

But: If I copy the updates from http://www.purebasic.com/update/
to my PB, the DLL don't work :!: :!: :!:

So - the updates have a new bug :( !!!
Thorsten
User
User
Posts: 28
Joined: Sun Apr 27, 2003 2:55 pm
Location: Germany
Contact:

Post by Thorsten »

Sorry - the updates are okay :oops:

I have test it a little bit, and the error is inside the editor 8O
If I start the editor first time, and I make then my DLL, all is okay.

But if I make the DLL again - I can't use the DLL.
If I restart the editor - all is fine. But only for the first DLL ...

Hmm ... is hard to describe with english .... :( :oops:
Post Reply