DLLs and Networking question
Posted: Tue Oct 31, 2006 5:31 am
Hey Guys and Gals. I'm running into a issue I was hoping I could get some help with. I've been working on a small dll using Pure Basic. I wanted to use Pure Basic to create a dll to help out a friend with networking his in house app. Basically its not much, just needs to push strings to and from servers. I'll cut to the point before you fall asleep. This is all I have done on the DLL so far...
All works good until the procedure N_SendString is called. His app will crash. I tried to test it out using pure basic to make the calles using the fallowing code.
But sadly it too crashed. If you have any suggestions it would be helpful. Thank you all for your time.
Code: Select all
ProcedureDLL N_Init()
If InitNetwork() = 0
MessageRequester("Network Error","There was a error")
EndIf
EndProcedure
ProcedureDLL N_Connect(serverAddress.s)
port = 4010
Global ConnectionID = OpenNetworkConnection(serverAddress.s,port)
MessageRequester("Demo", "This is a beta dll and should not be in public domain.")
MessageRequester("",Str(ConnectionID))
EndProcedure
ProcedureDLL N_SendString(stringToSend.s)
MessageRequester("",Str(ConnectionID))
; SendNetworkString(,"stringToSend.s")
EndProcedure
Code: Select all
If OpenLibrary(0,"network.dll")
CallFunction(0,"N_Init")
CallFunction(0,"N_Connect","127.0.0.1")
If CallFunction(0,"N_SendString","Hello World")
MessageRequester("","Success!")
Else
MessageRequester("","Failed")
EndIf
EndIf