Page 1 of 1

PB parameters in .ini file in PB dir...

Posted: Fri Sep 17, 2010 7:05 pm
by DoMi
I'd like to install PB on an USB key
Is there a way to store PB setup parameters in an INI file (in PB directory) instead of in registry?
Thanks for your reply

Re: PB parameters in .ini file in PB dir...

Posted: Fri Sep 17, 2010 7:18 pm
by Thorium
Take a look on the help: Commandline options for the IDE
There is a special commandline parameter for that: /PORTABLE

Re: PB parameters in .ini file in PB dir...

Posted: Fri Sep 17, 2010 8:56 pm
by DoMi
Thanks a lot, it works fine!

Re: PB parameters in .ini file in PB dir...

Posted: Thu Sep 23, 2010 4:32 am
by Vitor_Boss®
I wrote a code to do this, can i post the code here?

Re: PB parameters in .ini file in PB dir...

Posted: Mon Oct 11, 2010 7:54 am
by Vitor_Boss®
I'm trying to receive strings from "kernel32dll" using a Unicode executable and aways fail. Someone can help-me?

Code: Select all

Prototype.l pWritePrivateProfileString(lpApplicationName.p-unicode, lpKeyName.p-unicode, lpString.p-unicode, lpFileName.p-unicode)
Prototype.l pGetPrivateProfileString(lpApplicationName.p-unicode, lpKeyName.p-unicode, lpDefault.p-unicode, lpReturnString.p-unicode, nSize.l ,lpFileName.p-unicode)  

Procedure.s GetINI (iniDatei.s, sSection.s, sKeyName.s, sDefault.s)  
  Protected.s sReturn
  sReturn = Space(255)
  OpenLibrary(0,"kernel32.dll") 
  GetPrivateProfileString.pGetPrivateProfileString = GetFunction(0, "GetPrivateProfileStringW")
  sReturn = Left(sReturn, GetPrivateProfileString(sSection, sKeyName, sDefault, sReturn, Len(sReturn), iniDatei))
  CloseLibrary(0)  
  ProcedureReturn sReturn
EndProcedure

Procedure WriteINI (iniDatei.s, sSection.s, sKeyName.s, sNewString.s)  
  OpenLibrary(0,"kernel32.dll") 
  WritePrivateProfileString.pWritePrivateProfileString = GetFunction(0, "WritePrivateProfileStringW")
  WritePrivateProfileString(sSection, sKeyName, sNewString, iniDatei)
  CloseLibrary(0)
EndProcedure
Edit- Now work like should.

Re: PB parameters in .ini file in PB dir...

Posted: Mon Oct 11, 2010 8:08 am
by DarkDragon
Vitor_Boss® wrote:I'm trying to receive strings from "kernel32dll" using a Unicode executable and aways fail. Someone can help-me?
[...]
The problem is when I compile using Unicode flag, always return a lot of "?". What i must do to fix this?
GetPrivateProfileStringA -> GetPrivateProfileStringW
WritePrivateProfileStringA -> WritePrivateProfileStringW

W is widechar for 16-bit unicode. And then rename all p-ascii to p-unicode.

Re: PB parameters in .ini file in PB dir...

Posted: Mon Oct 11, 2010 8:14 am
by Vitor_Boss®
Work very fine. I don't think in that.


Thank you.