User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,506 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,649 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 809 | Replies: 7
Reply
Join Date: Jul 2006
Location: Oblivion
Posts: 647
Reputation: jaepi is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
jaepi's Avatar
jaepi jaepi is offline Offline
Practically a Master Poster

Win32 vs standard library functions

  #1  
Sep 24th, 2007
Do you have any idea what functions to use in standard library to replace these Win32 functions (GetPrivateProfileInt and GetPrivateProfileString)?

Thanks!
Retreat!!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 5
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Win32 vs standard library functions

  #2  
Sep 24th, 2007
These are Windows specific functionis related to INI files which are Windows Configuration files, so there couldn't be any standard function.
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Win32 vs standard library functions

  #3  
Sep 24th, 2007
you can write your own functions to replace them. ini configuration files are nothing more than simple text files that are in the format
[tag name]
<field> = <value>

So the program you write just searches for the tag name then the field and value.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Jul 2006
Location: Oblivion
Posts: 647
Reputation: jaepi is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
jaepi's Avatar
jaepi jaepi is offline Offline
Practically a Master Poster

Re: Win32 vs standard library functions

  #4  
Sep 25th, 2007
I actually found an open source that corresponds to the functions that I mentioned.

here's the link: http://www.matteolucarelli.net/libre...eProfile.c.htm

Now my problem is, I need to insert wchar_t* instead of the char* datatypes for the parameters. This version of the function is using standard lib functions which only accepts the datatype char*. Any suggestion on how to or what to do?
Retreat!!!
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Win32 vs standard library functions

  #5  
Sep 25th, 2007
since you have the source code you can change it however you want. But ini files themselves are not usually UNICODE so you might have to add a little code to convert from wchar_t* to char*, assuming that is even possible, which it might not be with some languages.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Jul 2006
Location: Oblivion
Posts: 647
Reputation: jaepi is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
jaepi's Avatar
jaepi jaepi is offline Offline
Practically a Master Poster

Re: Win32 vs standard library functions

  #6  
Sep 26th, 2007
Uhmmm. What if I will use wcstombs() function to convert wide char to multibyte? Could it be possible?
Retreat!!!
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,541
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 40
Solved Threads: 972
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: Win32 vs standard library functions

  #7  
Sep 26th, 2007
Yes, I use that function frequently and it works well for me.
<<Freelance Programmer>> << Hobby Site>>
Signature links for sale. PM me for details
Reply With Quote  
Join Date: Jul 2006
Location: Oblivion
Posts: 647
Reputation: jaepi is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
jaepi's Avatar
jaepi jaepi is offline Offline
Practically a Master Poster

Re: Win32 vs standard library functions

  #8  
Sep 27th, 2007
Thank you sirs!
Retreat!!!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 3:38 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC