GetPrivateProfileString, not from file, from string -
I'm using the GetPrivateProfileString function to read INI's, it does what I need it to do, but I need to make it so instead of running the function on a file, I need it to run the function on a string. Right now, I have my app writing the string to a file (String is from a MySQL), then reading it from that file, but this is a winsock application, so that can take up some time to do that when there are lots of sockets connected.
GetPrivateProfileString, not from file, from string -
I'm using the GetPrivateProfileString function to read INI's, it does what I need it to do, but I need to make it so instead of running the function on a file, I need it to run the function on a string. Right now, I have my app writing the string to a file (String is from a MySQL), the
retrieve from ini with getprivateprofilestring -
I am having trouble retrieving from an ini. I only get a blank string. Any help would be appreciated!
Here's my code:
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal
Read INI (getprivateprofilestring)...max of 255 characters!! -
Okay, here is the code im using to read files:
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVa
INI Help -
I am trying to read multiple items from an INI file located in the same directory as my application. I can read different areas of the INI file but I cannot display them or use them in the same msgbox. Please see code below:
Private Declare Function GetPrivateProfileString _
Li
GetPrivateProfileString - Removing '0' character from string -
I'M using the GetPrivateProfileString API and I just realised it was causing an error to mycode. I used the CIniFile class provided on vbworld.
Look carefully at the line in red, it fills the var all with 0. I need to remove them after, how do I achieve this ?
Code:
Public
Debugging and GetPrivateProfileString -
Hi everyone, this is my first time here.. and I hope somebody have encountered this problem before...
the thing is that, I have an app that gets values from ini and is using API
GetPrivateProfileString
it is fine when I run the application as an exe, but then if I debug it.. the p
Referencing Functions -
Hello all. I found a function that goes out and get values from an INI file. I am trying to build a class module that will do it. Unfortunately, I have to declare a public function some where that will make the code work. The only way I can get it to work is if I put the function d
Loading ini file values -
I'm using the GetPrivateProfileString API function to read all the values stored in the app's ini file at program start. The way I do it is, I make repeated calls to GetPrivateProfileString and at each call one variable is read.
Everything works fine but then I thought, does it make
GetPrivateProfileString problem in Win 98 & ME -
Hi
I have a large Ini file that contain many texts.
I use the API function: "GetPrivateProfileString" to get the text i need.
All works ok in 2000 & XP but in 98 & Me i get empty some empty strings.
I created a small project that get 3 texts from 3 locations: to
getprivateprofilestring -
Hi
I´m using the API function «getprivateprofilestring» to read file notes.ini in drive c:\notes, then i use textbox to put the information i need into.
Sometimes notes.ini is intalled in drive c:\..and h:\, when i want to put the informaion into to different textbox it only
Problems Reading INI file -
I have written an application that needs several values stored in an INI file, I have found several examples of how to read an INI file but have been unsuccessful in making it actually happen.
Here is the code that I put in the module.
Private Declare Function GetPrivateProfileSt
GetPrivateProfileString in Vista -
Hi there.
Our VB6 application runs well on XP.
Now one of our client has upgraded to Vista.
He said that he has managed to install and run our application on Vista. But seems that program can't pick up the old settings by GetPrivateProfileString function (the settings are stored i
INI file -
Can an INI file have a maximum length ?
I made 2 ini files. one is only 1 page long, the other is 50 pages long. When I try to read data with the GETPRIVATEPROFILESTRING-api, it returns the correct value from the 1 page long file, but from the 50 pages long file, he returns the defaul
*RESOLVED * String Comparison Problem -
I have stored the names of two printers in an INI using WritePrivateProfileString. I read them back into two strings using GetPrivateProfileString. I then want to set the printer to the name of one of those strings:
Dim prn As Printer
Dim str As String
For Each prn In Printers
Reading INI File and replace a key.. how to executing a .vbs script -
I want to read an INI file and and replace a certain key within the a certain section of the file... I cant figure out how to replace the key... This is my first time using VBscript... so I also dont know how to run the .vbs file to see if what I have will work.... if I click on the .v
little problem with variable -
i'm using a class to get info from an ini file
the variable rdnPath stays null???
Form code:
Dim objIni As clsIni
Dim rdnPath As String
Private Sub Form_Load()
Set objIni = New clsIni
rdnPath = objIni.GETINI("RDNMakro", "RDNPath", "c:\test.ini&quo
File not found: kernel -
Hi,
I've tried to load the whole of my original VB 3 program in VB 6. However, whenever I tried to run it, an error will occur "Run Time Error 53: File not found: kernel". (I did not change the program's original directory.)
The following is the code is I've used:
****
Win98 and VB reading ini file -
I'm trying to read from an ini file with following function
This is what I declare
#If Win32 Then
Public Declare Function GetPrivateProfileStringA Lib "kernel32" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedSt
GetPrivateProfileString -
what's wrong w/ this........
GetPrivateProfileString (App.EXEName, strKey, "", strValue, 1024, strINIPath) ?
it just returns the Default(""), even when there is definitely a value that should be returned.
thnx!
VB2005 (Populate combo box with .ini info) -
I know an .ini file is not the way to go with vb.net but I chose to use an .ini file. How would I go about reading only the headings, and adding this information to a combo box? Here is an example of the .ini file I am using. I have changed the headings I would like added to the comb b
connection strings and ini file -
anyone got an example of how to read server and database name for a sql server from an ini file in .Net.
In vb.6 i would use an api call to GetPrivateProfileString...
then simply from a function use the following code:
Quote:
retval = GetPrivateProfileStri
string limit 50 -
i found this code on here today for use of ini files and it works great
but the Dim strResult As String * 50 has me confused. i need more than 50 characters per line so i changed it to 500 and it seems to still work fine.
but i am learning vb by example the best that i can , an
Read getprivateprofilestring C:\ and H:\ same time -
Hi
I´m using the API function «getprivateprofilestring» to read file notes.ini in drive c:\notes, then i use textbox to put the information i need into.
Sometimes notes.ini is intalled in drive c:\ and h:\, when i want to put the informaion into to different textbox it only
GetPrivateProfileString question [resolved] -
Can I do this?
GetPrivateProfileString("General", "version", "", strBuffer, 30, "http://www.somewebsite.co.uk/config.txt")
I want to have my VB6 app check for updates online - but this doesn't seem to work.
Simon
Understand Code -
Dim lRet As Long
Dim buffer As String * 100
lRet = GetPrivateProfileString("System", "Setting", "FAC_C", buffer, Len(buffer), sfile)
lRet return value is 5
sfile is \\server1\microsoft\code\app\export\application.ini
What is GetPrivateProfi
Eek my API ini read ain't working. -
Code:
Public Declare Function GetPrivateProfileString lib "kernel32" _
Alias "GetPrivateProfileIntA" (ByVal lpApplicationname as String, _
ByVal lpKeyName as string, ByVal lpDefault as String, _
ByVal lpReturnedString as String, byVal nSize as Long,
One More Problem !! Urgent -
You guy help me out on this code early but I forgot to say text2 is a multiline textbox but my code will only save the first line and load the first.
Option Explicit
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStrin
Help with reading INI files -
Hola, I need help with loading in a menu this ini file. I haven't figured out yet to load the name of the application in a menu and run it when clicked. I know a need to loop the ini file, but I dont know how. Please, I need help. Thanks.
[Tools]
ItemName1 = NotePad
ItemProg1 =
Add to ini file -
Hi
I am using the following code to achieve...
[Settings]
path = c:\test\
Is there a way to add more than 1 line to a section? ie...
[Settings]
path = c:\test\
colour = red
datadirectory = c:\data\
Option Explicit
Private Declare Function GetPrivateProfileStri
INI File reading -
I have an .ini file, this file is the typical .ini file, but, there is one Key that excludes the Item and only contains the Value:
---------------------------
[AuthDomains]
mail.domain1.net
mail.domain2.com
mail.domain3.com
mail.domain4.com
mail.domain5.com
mail.domain6.com
read/write ini .... in floppy -
Hi,
There's a lot of info in this forum about read/write from/to ini files. For example, this one posted by peet
____________________________________________________
Private Declare Function GetPrivateProfileString _
Lib "kernel32" Alias "GetPrivateProfileStringA&q
Querying An INI Key -
How do I get the value of a key from an INI file? I'm using the GetPrivateProfileString code.
I forgot (*RESOLVED*) -
I have done this before and it doesn't seem to work any more...
I am trying to read ALL the section names from an INI file. This should work AFAIK but I get VB crashing!
All the below needs is a form with a text box (txtFilename), a button (cmdGetFilename) and the CommonDialogCon
Value Problem!!! Help! -
I put this in my code:
In General Declaration:
Code:
Dim eee As String
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As Any, ByVal lsString As Any, By
ini files on windows 2000 -
I am using Visual Basic 6 on Windows 2000.
I want to read and write to an ini file, but the function GetPrivateProfileString does not work. It does not return me anything. All the rest (GetPrivateProfileInt and wrtting to the ini file) is working fine.
In the msdn site they recommed
Ini Files - Cannot combine results -
Hi all,
I have a ini file that looks like this:
[Settings]
UpdateExePath=H:\intranet\timesheets\
FileName=update.bat
Now here is my Code (API Declarations are already made)
Dim strBuffer as String
strBuffer = space(255)
n% = GetPrivateProfileString("Settings", "
Contention issues with GetPrivateProfileString/WritePrivateProfileString [VC++6] -
I have X computers (typically 5, 7, or 9) that all access a single .INI file on one of the computers (so if I have 5 machines, 4 connect remotely using \\MachineName\Folder\
and the other one that houses the .INI file connects locally using the typical C:\Folder\).
The function in
Problems with GetPrivateProfileString -
I have found here tons of examples to use this API function. However, I am still having trouble using it.
It works fine when placing the returned data in a TextBox but I need to place it in a String variable and I get funky characters after the useful data I am looking for...
Her
Save/Open INI Files -
This may seem like a really easy question for some of you, but I can't seem to get this...
I have a RichTextBox on my form and I want to save the text I write in it in a .ini file in a particular directory. I got it working with a normal text box, but for some reason it doesn't work
reading INI file - puzzled, baffled, perplexed -
I am reading an INI file to pre-set some properties on a form.
I do not understand how the returned "temp" works - it appears
to string together everything it already got. The return number
from the API function (I think) specifies where in "temp" to find
the s