Kkula
Is it possible to read/write .ini files via a C script?
I was thinking that the windows.h functions was included, but if I use for example the function
GetPrivateProfileInt the compiler tells that is not a function.
Yes, it's possible to read and write .INI files using C scripts on Windows, but requires linking with the appropriate library.
The functions like GetPrivateProfileInt, GetPrivateProfileString, WritePrivateProfileString, etc., are part of the Windows API and reside in the kernel32.lib library.
The error "is not a function" indicates that you haven't linked against kernel32.lib during compilation.
Solution: You need to explicitly link kernel32.lib to your C project. How you do this depends on your compiler/IDE:
kernel32.lib-lkernel32 linker flag during compilation (e.g., gcc your_file.c -o your_program -lkernel32).For more detailed information on Windows API INI file functions, refer to the official Microsoft documentation:
Microsoft INI File DocumentationSiePortal Knowledge Article: Reading and writing INI files from a WinCC script (While WinCC specific, provides useful context on INI file handling in Windows)
Our flexible community website is a platform that allows users to connect, share information, and collaborate on various topics of interest. The website offers a range of features such as discussion forums, messaging, user profiles, event calendars, and more. Users can customize their experience by creating and joining different groups or communities based on their interests or location. The website is designed to be user-friendly and adaptable to the needs and preferences of our diverse user base. Whether you are looking to network professionally, share hobbies and interests, or simply connect with like-minded individuals, our flexible community website has something for everyone. Join us today and become a part of our thriving online community!
India
Copyright ©2025
Share this page with your family and friends.