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

Everything else that doesn't fall into one of the other PB categories.
DoMi
User
User
Posts: 67
Joined: Sat Jan 10, 2004 5:41 pm
Location: France

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

Post 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
DoMi
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

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

Post by Thorium »

Take a look on the help: Commandline options for the IDE
There is a special commandline parameter for that: /PORTABLE
DoMi
User
User
Posts: 67
Joined: Sat Jan 10, 2004 5:41 pm
Location: France

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

Post by DoMi »

Thanks a lot, it works fine!
DoMi
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

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

Post by Vitor_Boss® »

I wrote a code to do this, can i post the code here?
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

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

Post 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.
Last edited by Vitor_Boss® on Mon Oct 11, 2010 8:16 am, edited 1 time in total.
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

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

Post 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.
bye,
Daniel
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

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

Post by Vitor_Boss® »

Work very fine. I don't think in that.


Thank you.
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
Post Reply