A question about GetPrivateProfi leString
a section in a .ini file , for example
[server]
ip = 192.168.1.112
....
i want to get the ip value by using GetPrivateProfi leString() function.
the code is :
char szBuffer[NAX_BUFFER_LEN];
szBuffer[0]=0;
if (::GetPrivatePr ofileString("Ga meServer1", "GameServerIp", \
NULL, szBuffer, sizeof(szBuffer ), szPath)>0)
{
m_ip.SetWindowT ext(szBuffer);
}
i get it successfully.
however, when i modify the ip's value manually, the value returned by
GetPrivateProfi leString() function is always less than 0 . Can you
tell me why?
thanks in advance 5 7644
海风 wrote: A question about GetPrivateProfi leString
What's that? It's certainly not part of standard C++, nor have you
provided a definition of it, so I assume you're asking about some
platform-specific API, in which case you're off-topic and need to read
the FAQ before posting, as is common courtesy for any newsgroup.
parashift.com/c++-faq-lite
Luke
Luke Meyers wrote: What's that? It's certainly not part of standard C++, nor have you provided a definition of it, so I assume you're asking about some platform-specific API, in which case you're off-topic and need to read the FAQ before posting, as is common courtesy for any newsgroup.
parashift.com/c++-faq-lite
Luke
ow that's a windows api. Maybe i posted on a wrong place. sorry.
but if you only manipulate the pure c++ without supporting of specific
platform.
what can you do?
海风 wrote: Luke Meyers wrote: What's that? It's certainly not part of standard C++, nor have you provided a definition of it, so I assume you're asking about some platform-specific API, in which case you're off-topic and need to read the FAQ before posting, as is common courtesy for any newsgroup.
parashift.com/c++-faq-lite
Luke
ow that's a windows api. Maybe i posted on a wrong place. sorry. but if you only manipulate the pure c++ without supporting of specific platform. what can you do?
Well, I don't know what GetPrivateProfi leString does, but it seems to have
something to do with networking, which is not supported by standard C++.
Anyway, there are quite some newsgroups about Windows programming where you
can ask your question about GetPrivateProfi leString.
A-Person-With-A-Unicode-Name wrote: A question about GetPrivateProfi leString (snip stuff) GetPrivateProfi leString ( "GameServer 1", "GameServer Ip", NULL, szBuffer, sizeof(szBuffer ), szPath
... when i modify the ip's value manually, the value returned by GetPrivateProfi leString() function is always less than 0 . Can you tell me why?
That's strictly Microsoft Windows stuff. This is a C++ group, so this is
off-topic here. I'm setting followup to:
comp.os.ms-windows.program mer.win32
To learn more about "GetPrivateProf ileString", highlight it in your source
and hit F1. That should launch your MSDN and set it to display info on this
function. (Assuming you're using Visual Studio and have MSDN installed.)
MSDN says that the third parameter is not allowed to be NULL, so you're
abusing the function. Provide a valid default string and see what happens.
For more info, ask in the group I mention above. Also, read MSDN. Also,
get Charles Petzold's book "Programmin g Windows".
--
Cheers,
Robbie Hatley
Tustin, CA, USA
lonewolfintj at pacbell dot net (put "[ciao]" in subject to bypass spam filter) http://home.pacbell.net/earnur/
海风 wrote: but if you only manipulate the pure c++ without supporting of specific platform. what can you do?
You can write standard c++ code that's portable and not dependent on
platform specific libraries, especially ones which are tied to a single
company who's goal is to control the world.
-Brian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: eScrewDotCom |
last post by:
eScrew
Welcome to eScrew!
eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew
story if you promise eScrew to consider eScrew story as joke. eScrew
story is very funny. eScrew story is so funny that eScrew will have to
take break from time to time because eScrew needs some rest from
laughing. Oh boy, here it comes......
|
by: Mark Hayworth |
last post by:
Randy:
I too am having the problem that this other guy/girl had. I put in
the proper API declarations and arguments for GetPrivateProfileString
yet it doesn't return the correct stuff. It always returns the
default value (padded with huge amount of spaces on the right) and the
return value (number of characters read) is some crazy huge...
|
by: cyranoVR |
last post by:
This is the approach I used to automate printing of Microsoft Access
reports to PDF format i.e. unattended and without annoying "Save As..."
dialogs, and - more importantly - without having to use a commercial
program such as Adobe Acrobat and its associated API.
The technique uses Ghostscript and Redirection Port Monitor - two free...
|
by: Eifel-benz |
last post by:
I'm working the first days with Visual C#.net. So most of you think these questions are really easy.
1. How can I read out the windows-account?
2. How can I read datas from an INI-file?
A short example will help me quiet good.
Thanks.
|
by: Germic |
last post by:
Does C# has an equivalent of the 'C' GetPrivateProfileString? or is the only
way to get similar features to read from an INI file is to do a DllImport on
Kernel32.dll?
Thanks
| |
by: L |
last post by:
static extern uint GetPrivateProfileString(
string lpAppName,
string lpKeyName,
string lpDefault,
StringBuilder lpReturnedString,
uint nSize,
string lpFileName);
Interoping GetPrivateProfileString is giving me this Exception in
|
by: Nhan |
last post by:
Hi,
I am trying to use the function GetPrivateProfileString as following:
public static extern Int32 GetPrivateProfileString(string lpAppName, string
lpKeyName, string lpDefault, string lpReturnedString, short nSize, string
lpFileName);
.......
String sDatabase = "";
|
by: thiago777 |
last post by:
Is there a better way of accomplishing this ?: http://msdn2.microsoft.com/en-us/library/ms724353.aspx
I have some program settings which should be easily editable by the user (really like in a text file), but dont want to use such an old function like GetPrivateProfileString..
maybe an XML file would be the best solution ?
thanks
|
by: alag20 |
last post by:
Hi Guys,
I need some urgent help with this as I am becoming clueless now.
I have 2 DllImport as below from Kernel32
private static extern int GetPrivateProfileString(string section, int key, string defaultValue, byte result, int size, string fileName);
private static extern int GetPrivateProfileString(string section, string key,...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |