It is currently Thu Oct 01, 2020 7:59 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 234 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15, 16  Next
Author Message
 Post subject:
PostPosted: Wed Apr 11, 2007 10:19 am 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
@Padde
Thanks for the bugreport! These functions are old ones from PB3.94 :wink:
I will change 2 functions to this:
Code:
Procedure.s    MSXML3_Uni2Ansi(unicodestr.l)
;   lenA = WideCharToMultiByte_(#CP_ACP, 0, unicodestr, -1, 0, 0, 0, 0);
;   ansistr.s = Space(lenA)
;   If (lenA > 0)
;     WideCharToMultiByte_(#CP_ACP, 0, unicodestr, -1, @ansistr, lenA, 0, 0);
;   EndIf
;   ProcedureReturn ansistr
  ProcedureReturn PeekS(unicodestr, #PB_Any, #PB_Ascii)
EndProcedure
Procedure.l    MSXML3_Ansi2Uni(ansistr.s)
;   lenA.l = Len(ansistr)
;   lenW = MultiByteToWideChar_(#CP_ACP, 0, ansistr, lenA, 0, 0)
;   If (lenW > 0) ; Check whether conversion was successful
;     unicodestr = SysAllocStringLen_(0, lenW)
;     MultiByteToWideChar_(#CP_ACP, 0, ansistr, lenA, unicodestr, lenW)
;     result = unicodestr
;     SysFreeString_(unicodestr)
;     ProcedureReturn result
;   Else
;     ProcedureReturn 0
;   EndIf
  Protected unicodestr.s, len.l = StringByteLength(ansistr, #PB_Unicode)
  unicodestr = Space(len + 2)
  PokeS(@unicodestr, ansistr, #PB_Any, #PB_Unicode)
  ProcedureReturn @unicodestr
EndProcedure


Can you test it

greetings
Thomas

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 11, 2007 6:02 pm 
Offline
New User
New User

Joined: Wed Apr 11, 2007 2:56 am
Posts: 5
Both procedures didn't work.. but i could fix at least
the MSXML3_Uni2Ansi procedure.

This one do the job well
Code:
Procedure.s    MSXML3_Uni2Ansi(unicodestr.l)
  ; lenA = WideCharToMultiByte_(#CP_ACP, 0, unicodestr, -1, 0, 0, 0, 0);
  ; ansistr.s = Space(lenA)
  ; If (lenA > 0)
    ; WideCharToMultiByte_(#CP_ACP, 0, unicodestr, -1, @ansistr, lenA, 0, 0);
  ; EndIf
  ; ProcedureReturn ansistr
  ProcedureReturn PeekS(unicodestr, #PB_Any, #PB_Unicode)
EndProcedure


The MSXML3_Ansi2Uni procedure always throws an invalid memory
access. Played a bit around with it.. but i was unable to force that bloody-minded peace of code to work :cry:



######### EDIT #########
This is getting realy weird... found out some sort of side-effect with
my previously posted MSXML3_Ansi2Uni fix.

If i use the untouched lib of pbosl loading files with MSXML3_Load is
working well.. even with big files... but loading via string with the
MSXML3_LoadXML procedure fails with string sizes above 16k :shock:

But thats not all... if i use the fixed MSXML3_Ansi2Uni procedure the
problem is exactly vice versa... loading files via string with
MSXML3_LoadXML is working well.. no matter what string sizes i use.
BUT.. yeah.. there is a but! MSXML3_Load fails on all file sizes.. what the
hell is going on :evil:

Just now i try a workaround with 2 Ansi2Uni procedures one for each
Load procedure....


Last edited by Padde on Wed Apr 11, 2007 6:52 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 11, 2007 6:44 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
Okay, this should work:
Code:
Procedure.l MSXML3_Ansi2Uni(ansistr.s)
  Protected *out = AllocateMemory(StringByteLength(ansistr, #PB_Unicode) + 1)
  If *out
    PokeS(*out, ansistr, #PB_Any, #PB_Unicode)
    ProcedureReturn *out
  EndIf
EndProcedure

please test it again, thx

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 11, 2007 6:58 pm 
Offline
New User
New User

Joined: Wed Apr 11, 2007 2:56 am
Posts: 5
This one fails in all cases.. MSXML3_Load and MSXML3_LoadXML both throw
an invalid memory access error


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Apr 11, 2007 7:06 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
the function itself works for me, but i have inform the author (kiffi) to solve these problems

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 08, 2007 10:53 am 
Offline
User
User
User avatar

Joined: Wed Nov 16, 2005 7:51 pm
Posts: 88
Location: France
Hi ts-soft, i have some problems with DBin lib to extract files of file.bin. (To add files it's work correctly) Can you test this code? It's a bug or one error of me? thanks.

Code:
Global Dir$,key$
Dir$ = GetCurrentDirectory()
key$ = "MykeyMouse"
Procedure Gen_bin_File() ;to create test file
 
  CreateINI = CreatePreferences(Dir$+"PARAM.ini")

    If CreateINI <>0
      WritePreferenceString("value1","Test of DBin lib")
      WritePreferenceString("value2","DBin lib is good")
      WritePreferenceString("value3","DBin lib is bad")
      ClosePreferences()
    Else
      Debug "ERROR! INI is failed"
      MessageRequester("ERROR!","INI is failed",#MB_ICONEXCLAMATION)
    EndIf
         
    If FileSize(Dir$+"PARAM.ini") <> -1
      DBinfile = DBin_Create(Dir$+"DBfile.bin",0) 
       If DBinfile = 0
          Debug "ERROR! DBin is failed"
          MessageRequester("ERROR!","DBin is failed",#MB_ICONEXCLAMATION)
       Else
          Result = DBin_AddFile(Dir$+"DBfile.bin",Dir$+"PARAM.ini", key$,9)
           If Result<>0
             Debug "Addfile is done"
             Delete = DeleteFile(Dir$+"PARAM.ini")
           Else
             Debug "ERROR! Add Param is failed"
             MessageRequester("ERROR!","Add Param is failed",#MB_ICONEXCLAMATION)   
           EndIf
       EndIf
    EndIf
 
EndProcedure

Procedure Extract_bin_File() ;to extract file of bin
 
  If FileSize(Dir$+"DBfile.bin")<> -1
 
   totalfiles=DBin_TotalFiles(Dir$+"DBfile.bin") 
      For files=1 To totalfiles
       file$=DBin_Dir(Dir$+"DBfile.bin",files)     ; <------------ first method  : no works!
       Debug file$;<-------- return Dir$ !!
      Next
 
    ;file$ = DBin_Dir(Dir$+"DBfile.bin",1)         ; <------------ second method  : no works!
    ;Debug file$    ;<-------- return Dir$ !!
   
    TempF$  = Dir$+"PARAM.ini"     
    CopyF  = DBin_SaveFile(Dir$+"DBfile.bin",file$,TempF$,key$) ; why not?
 
  EndIf
   
    If CopyF = 0
      Debug "ERROR! Extract is failed!"
      MessageRequester("ERROR!","Extract is failed!",16)
    EndIf
   
       
EndProcedure

;-Test
Gen_bin_File()
Extract_bin_File()
If FileSize(Dir$+"DBfile.bin")<> -1
 DeleteFile(Dir$+"DBfile.bin")
EndIf

_________________
PureBasicien tu es, PureBasicien tu resteras.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 08, 2007 11:25 am 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
@Jacobus

You use a absolute path for DBin_Dir, this doesn't work, please change to:
Code:
file$=DBin_Dir("DBfile.bin",files)

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 08, 2007 12:50 pm 
Offline
User
User
User avatar

Joined: Wed Nov 16, 2005 7:51 pm
Posts: 88
Location: France
Thank you. In test code it's ok. I'll make another code for my app and change all paths... :? Because the problem persist if the files are generated in a sub-folder. If the current directory is for example : Dir\SubDir\DBin.bin The relative path doesn't work.

_________________
PureBasicien tu es, PureBasicien tu resteras.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 09, 2007 3:24 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4628
Location: Spa, relaxing and thinking, and learning...
I don't find exDatabase in the PBOSL pack, where is it?

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 09, 2007 3:31 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
Psychophanta wrote:
I don't find exDatabase in the PBOSL pack, where is it?

Tailbite can't compile the source, SQLConfigDataSource_ doesn't work, but a new version is in progress.
http://www.purebasic.fr/german/viewtopi ... t=database

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jun 01, 2007 1:50 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
PBOSL windows binaries recompiled for PB4.10
Please test this versions, but some libs doesn't work

Please tell me all bugs

Beta-Download: http://ts-soft.eu/dl/pbosl_win.zip

regards
Thomas

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Last edited by ts-soft on Fri Jun 01, 2007 2:17 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jun 01, 2007 2:09 pm 
Offline
Addict
Addict
User avatar

Joined: Sun Oct 15, 2006 8:56 pm
Posts: 1040
Location: Germany
TS, you cannot "found" a bug... :lol:

_________________
PB 4.30
Code:
onErrorGoto(?Fred)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jun 01, 2007 2:18 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
AND51 wrote:
TS, you cannot "found" a bug... :lol:

My bad english :wink:

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jun 02, 2007 8:00 am 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
New Testversion of PBOSL_LoadDllMemory for PB4.10

Supports Unicode (without Subsystem)
New Function: GetModuleHandleM(hMemoryModule.l)
This handle is to use Resources in included DLL

Download with Source:
http://ts-soft.eu/dl/pbosl_loaddllmemory.zip

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jun 02, 2007 8:32 am 
Offline
PureBasic Fanatic
PureBasic Fanatic

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2236
Location: Elbonia
Hi ts-soft! I'm gonna test this lib right away and report any problems. Thanks!

_________________
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 234 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14, 15, 16  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye