Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/08/2010, 09:33
F_rank_cisco
 
Fecha de Ingreso: agosto-2006
Mensajes: 45
Antigüedad: 17 años, 8 meses
Puntos: 0
Leer clave de archivo INI

Hola a todos:

Tengo que leer unos datos de un archivo.ini de otra aplicación.
Tengo declaradas estas funciones:

GetPrivateProfileInt
GetPrivateProfileSection
GetPrivateProfileSectionNames
GetPrivateProfileString
GetProfileInt
GetProfileSection
GetProfileString

El problema es que el archivo.ini a leer tiene una estructura que me despista.

Los 8 datos que tengo que leer son los que puesto en color Rojo, que son coordenadas, lo puedo leer como string y luego yo separo las coordenadas, solo necesito las 2 primeras de cada dato.

Lo que me despista es que como vereis las claves "[SNAPSHOT_BUTTON]" son la misma, solo se diferencian en que cada una tiene una Key, que las he puesto en color azul, que se llama "column" que van del 0 al 7

Como puedo hacer para leer los 8 datos diferenciando en función de la Key "column" = 0,1,2....7

Este es el contenido del archivo.ini:

-----------------------------------------------
[SNAPSHOT_BUTTON]
column= 0
bbox= 2, 344, 20, 360
bitmap2=seq9_mixer1.bmp, 224, 344, 242, 360
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 0
bbox= 23, 347, 81, 360
textcolorRGB=5,5,5
textsize=1

[SNAPSHOT_BUTTON]
column= 1
bbox= 2, 361, 20, 378
bitmap2=seq9_mixer1.bmp, 224, 361, 242, 378
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 1
bbox= 23, 364, 81, 378
textcolorRGB=5,5,5
textsize=1

[SNAPSHOT_BUTTON]
column= 2
bbox= 2, 378, 21, 395
bitmap2=seq9_mixer1.bmp, 224, 378, 242, 395
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 2
bbox= 23, 381, 81, 395
textcolorRGB=5,5,5
textsize=1

[SNAPSHOT_BUTTON]
column= 3
bbox= 2, 395, 21, 412
bitmap2=seq9_mixer1.bmp, 224, 395, 242, 412
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 3
bbox= 23, 398, 81, 412
textcolorRGB=5,5,5
textsize=1

[SNAPSHOT_BUTTON]
column= 4
bbox= 2, 412, 21, 429
bitmap2=seq9_mixer1.bmp, 224, 412, 242, 429
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 4
bbox= 23, 415, 81, 429
textcolorRGB=5,5,5
textsize=1

[SNAPSHOT_BUTTON]
column= 5
bbox= 2, 429, 21, 446
bitmap2=seq9_mixer1.bmp, 224, 429, 242, 446
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 5
bbox= 23, 432, 81, 446
textcolorRGB=5,5,5
textsize=1

[SNAPSHOT_BUTTON]
column= 6
bbox= 2, 446, 21, 463
bitmap2=seq9_mixer1.bmp, 224, 446, 242, 463
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 6
bbox= 23, 449, 81, 463
textcolorRGB=5,5,5
textsize=1

[SNAPSHOT_BUTTON]
column= 7
bbox= 2, 463, 21, 480
bitmap2=seq9_mixer1.bmp, 224, 463, 242, 480
textcolorRGB=5,5,5
textsize=2

[SNAPSHOT_NAME]
column= 7
bbox= 23, 466, 81, 480
textcolorRGB=5,5,5
textsize=1
------------------------------------------

Me estoy volviendo loco, y solo consigo leer el primer dato de los 8. Como tengo que hacerlo, posible es puesto que la aplicación las lee para funcionar.

Gracias de antemano, a ver si tengo suerte y alguien quiere ayudarme.

Un saludo.