473,796 Members | 2,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GetPrivateProfi leString problem!

I need to read some configuration data from .ini file located at
Application.Sta rtupPath location .
Here is code snippet :

Public Declare Unicode Function GetPrivateProfi leString Lib "kernel32" Alias
"GetPrivateProf ileStringW" (ByVal lpApplicationNa me As String, ByVal
lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedStrin g As
String, ByVal nSize As Int32, ByVal lpFileName As String) As Int32
Dim File As String = Application.Sta rtupPath & "\" & filename
x = GetPrivateProfi leString("Confi guration", "DestDbPath ", "Error",
tmpString, Len(tmpString), filename)

What is the problem; Everything works fine on XP platform but when I deploy
application on Win98 platform i have problem.

File path is correct, file is correctly formated :

[Configuration]
DestDbPath = \\tlos-server\podaci\n ucleus2002\Baza-proizvodnja.mdb
SourceXMLPath = c:\tlos\izdatni ce
SkladIDs = 655
OJ = 11
User = Domagoj Kovačević
GetPrivateProfi leString function doesn't retreive data for requested
parameter but fills string buffer passed as reference with "Error"
What to do??????
Is my API declaration correct , I have "googled" and realized that there is
problem with GetPrivateProfi leString function , what is solution????
Win98 platform is mandatory!
I got about 25 stations with Windows 98!
Thanks a lot!


Jun 29 '06 #1
1 3657
Hello Domac,

http://msdn.microsoft.com/library/de...filestring.asp
Do your stations have the Microsoft Layer for Unicode installed?

-Boo
I need to read some configuration data from .ini file located at
Application.Sta rtupPath location .

Here is code snippet :

Public Declare Unicode Function GetPrivateProfi leString Lib "kernel32"
Alias "GetPrivateProf ileStringW" (ByVal lpApplicationNa me As String,
ByVal lpKeyName As String, ByVal lpDefault As String, ByVal
lpReturnedStrin g As String, ByVal nSize As Int32, ByVal lpFileName As
String) As Int32

Dim File As String = Application.Sta rtupPath & "\" & filename

x = GetPrivateProfi leString("Confi guration", "DestDbPath ", "Error",
tmpString, Len(tmpString), filename)

What is the problem; Everything works fine on XP platform but when I
deploy application on Win98 platform i have problem.

File path is correct, file is correctly formated :

[Configuration]
DestDbPath = \\tlos-server\podaci\n ucleus2002\Baza-proizvodnja.mdb
SourceXMLPath = c:\tlos\izdatni ce
SkladIDs = 655
OJ = 11
User = Domagoj Kovačević
GetPrivateProfi leString function doesn't retreive data for requested
parameter but fills string buffer passed as reference with "Error"
What to do??????

Is my API declaration correct , I have "googled" and realized that
there is
problem with GetPrivateProfi leString function , what is solution????
Win98 platform is mandatory!
I got about 25 stations with Windows 98!
Thanks a lot!

Jun 29 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
19244
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 number like 51298398749084 Your demo doesn't work in .Net - it's for prior versions of VB, and so the...
117
7273
by: Peter Olcott | last post by:
www.halting-problem.com
1
3962
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
5
19690
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
5
7664
by: 海风 | last post by:
A question about GetPrivateProfileString a section in a .ini file , for example ip = 192.168.1.112 .... i want to get the ip value by using GetPrivateProfileString() function. the code is :
2
3755
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 = "";
4
16983
by: xoinki | last post by:
hi all, I have a ini file in UTF-8, I am using GetPrivateProfileStringA() for reading and WriteprivateProfileStringA() for writing into the ini file. I am writing multibyte data into the file (using normal char *). so ini file is saved in UTF-8. And ini file is maintained in App data folder in windows systems. Now the problem is. if a user has unicode username, then SHgetFolderPath() -- with CSIDL_APPDATA option would return a path with...
1
1683
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
6
3813
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, string defaultValue, StringBuilder result, int size, string fileName);
0
9680
marktang
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7548
isladogs
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
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
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.