Thanks Paul. I'll see what I can do with that :o)
Â
/Alex
 _____ Â
From: Paul.Fowler@raytheon.co.uk [mailto:Paul.Fowler@raytheon.co.uk]
Sent: den 30 augusti 2006 18:44
To: VRF
Cc: VRF
Subject: Re: [vrf] How can I delete a Key from an INI.file ??? w/ ATTACHMENT THIS TIME
There is a (somewhat dodgy) workaround for this.
You can incorrectly define the function prototype for WritePrivateProfileStringA to set the type of lpString to 'long' - like this:
long __stdcall WritePrivateProfileStringA(const char* lpAppName, const char* lpKeyName, long lpString, const char* lpFilename);
Then pass a 0 as the lpString parameter - this will be interpreted as a NULL. If you pass anything other than 0 you will get a nasty BRB.
To use this in your application you will need to load Kernel32.dll twice into differently named libraries - once with the correct definition file and once with the altered one.
Â
If you also wish to be able to delete an entire section, you will need to load Kernel32.dll a THIRD time, this time with the type of lpKeyName set to 'long' as well, like this:
long __stdcall WritePrivateProfileStringA(const char* lpAppName, long lpKeyName, long lpString, const char* lpFilename);
Good luck with it.
Cheers
Paul F.
"Alexander Poulikakos (KI/EAB)" <alexander.poulikakos@ericsson.com>
Document Marked as Unclassified
"Alexander Poulikakos (KI/EAB)" <alexander.poulikakos@ericsson.com>
30/08/2006 15:54
Please respond to
"Alexander Poulikakos (KI/EAB)" <alexander.poulikakos@ericsson.com>
To
VRF <vrf@agilent.com>
cc
Subject
[vrf] How can I delete a Key from an INI.file ??? w/ ATTACHMENT THIS TIME
Hi VRF
How can I delete a Key (or section) from an INI-File, by using the
Get/WritePrivateProfileStringA functions from Kernel32?
I have attached an example I made (INI-file.vee).
I found this VisualBasic example on the internet, which explains how to
do it:
=============================================
Private Sub ProfileDeleteItem(sSection As String, sKeyName As String,
sIniFile As String)
 'this call will remove the keyname and its
 'corresponding value from the section sepcified
 'in sSection. This is accomplished by passing
 'vbNullString as the sValue parameter. For example,
 'assuming that an ini file had:
 ' [Colours]
 '  Colour1=Red
 '  Colour2=Blue
 '  Colour3=Green
 '
 'and this sub was called passing "Colour2"
 'as sKeyName, the resulting ini file
 'would contain:
 ' [Colours]
 '  Colour1=Red
 '  Colour3=Green
Â
 Call WritePrivateProfileString(sSection, _
                 sKeyName, _
                 vbNullString, _
                 sIniFile)
End Sub
(see entire link here:
http://vbnet.mvps.org/index.html?code/file/pprofilebasic.htm )
=============================================
I just can't make this happen in VEE!?!? How can I make a
"vbNullString"? Someone must have done this before..... HELP!
Regards,
Alex
---
You are currently subscribed to vrf as: Paul.Fowler@raytheon.co.uk
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, Â email "vrf@agilent.com". Â
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".[attachment "INI-file.vee" deleted by Paul Fowler/H9569/RAYTHEONUK]
--- You are currently subscribed to vrf as: alexander.poulikakos@ericsson.com To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body. To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com". To send messages to this mailing list, email "vrf@agilent.com". If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com". Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
---
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
Â
/Alex
 _____ Â
From: Paul.Fowler@raytheon.co.uk [mailto:Paul.Fowler@raytheon.co.uk]
Sent: den 30 augusti 2006 18:44
To: VRF
Cc: VRF
Subject: Re: [vrf] How can I delete a Key from an INI.file ??? w/ ATTACHMENT THIS TIME
There is a (somewhat dodgy) workaround for this.
You can incorrectly define the function prototype for WritePrivateProfileStringA to set the type of lpString to 'long' - like this:
long __stdcall WritePrivateProfileStringA(const char* lpAppName, const char* lpKeyName, long lpString, const char* lpFilename);
Then pass a 0 as the lpString parameter - this will be interpreted as a NULL. If you pass anything other than 0 you will get a nasty BRB.
To use this in your application you will need to load Kernel32.dll twice into differently named libraries - once with the correct definition file and once with the altered one.
Â
If you also wish to be able to delete an entire section, you will need to load Kernel32.dll a THIRD time, this time with the type of lpKeyName set to 'long' as well, like this:
long __stdcall WritePrivateProfileStringA(const char* lpAppName, long lpKeyName, long lpString, const char* lpFilename);
Good luck with it.
Cheers
Paul F.
"Alexander Poulikakos (KI/EAB)" <alexander.poulikakos@ericsson.com>
Document Marked as Unclassified
"Alexander Poulikakos (KI/EAB)" <alexander.poulikakos@ericsson.com>
30/08/2006 15:54
Please respond to
"Alexander Poulikakos (KI/EAB)" <alexander.poulikakos@ericsson.com>
To
VRF <vrf@agilent.com>
cc
Subject
[vrf] How can I delete a Key from an INI.file ??? w/ ATTACHMENT THIS TIME
Hi VRF
How can I delete a Key (or section) from an INI-File, by using the
Get/WritePrivateProfileStringA functions from Kernel32?
I have attached an example I made (INI-file.vee).
I found this VisualBasic example on the internet, which explains how to
do it:
=============================================
Private Sub ProfileDeleteItem(sSection As String, sKeyName As String,
sIniFile As String)
 'this call will remove the keyname and its
 'corresponding value from the section sepcified
 'in sSection. This is accomplished by passing
 'vbNullString as the sValue parameter. For example,
 'assuming that an ini file had:
 ' [Colours]
 '  Colour1=Red
 '  Colour2=Blue
 '  Colour3=Green
 '
 'and this sub was called passing "Colour2"
 'as sKeyName, the resulting ini file
 'would contain:
 ' [Colours]
 '  Colour1=Red
 '  Colour3=Green
Â
 Call WritePrivateProfileString(sSection, _
                 sKeyName, _
                 vbNullString, _
                 sIniFile)
End Sub
(see entire link here:
http://vbnet.mvps.org/index.html?code/file/pprofilebasic.htm )
=============================================
I just can't make this happen in VEE!?!? How can I make a
"vbNullString"? Someone must have done this before..... HELP!
Regards,
Alex
---
You are currently subscribed to vrf as: Paul.Fowler@raytheon.co.uk
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, Â email "vrf@agilent.com". Â
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".[attachment "INI-file.vee" deleted by Paul Fowler/H9569/RAYTHEONUK]
--- You are currently subscribed to vrf as: alexander.poulikakos@ericsson.com To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body. To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com". To send messages to this mailing list, email "vrf@agilent.com". If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com". Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
---
To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".
<font size=2 face="sans-serif">There is a (somewhat dodgy) workaroundfor this.</font>
<font size=2 face="sans-serif">You can incorrectly define the functionprototype for WritePrivateProfileStringA to set the type of lpString to'long' - like this:</font>
<font size=2 face="sans-serif">long __stdcall WritePrivateProfileStringA(constchar* lpAppName, const char* lpKeyName, long lpString, const char* lpFilename);</font>
<font size=2 face="sans-serif">Then pass a 0 as the lpString parameter- this will be interpreted as a NULL. If you pass anything other than 0you will get a nasty BRB.</font>
<font size=2 face="sans-serif">To use this in your application youwill need to load Kernel32.dll twice into differently named libraries -once with the correct definition file and once with the altered one.</font>
<font size=2 face="sans-serif"> </font>
<font size=2 face="sans-serif">If you also wish to be able to deletean entire section, you will need to load Kernel32.dll a THIRD time, thistime with the type of lpKeyName set to 'long' as well, like this:</font>
<font size=2 face="sans-serif">long __stdcall WritePrivateProfileStringA(constchar* lpAppName, long lpKeyName, long lpString, const char* lpFilename);</font>
<font size=2 face="sans-serif">Good luck with it.</font>
<font size=2 face="sans-serif">Cheers</font>
<font size=2 face="sans-serif">Paul F.</font>
<table border width=100%><tr valign=top><td width=13% bgcolor=#004200><div align=center><font size=1 color=#004200 face="Arial"><b>"AlexanderPoulikakos (KI/EAB)" |alexander.poulikakos@ericsson.com></b></font></div><td width=73% bgcolor=white><div align=center><font size=2 face="Times New Roman"><b>Document Markedas Unclassified</b></font></div><td width=12% bgcolor=#004200><div align=center></div></table>
<table width=100%><tr valign=top><td width=40%><font size=1 face="sans-serif"><b>"Alexander Poulikakos(KI/EAB)" |alexander.poulikakos@ericsson.com></b> </font><p><font size=1 face="sans-serif">30/08/2006 15:54</font><table border><tr valign=top><td bgcolor=white><div align=center><font size=1 face="sans-serif">Please respond to
"Alexander Poulikakos (KI/EAB)" |alexander.poulikakos@ericsson.com></font></div></table>
<td width=59%><table width=100%><tr valign=top><td><div align=right><font size=1 face="sans-serif">To</font></div><td><font size=1 face="sans-serif">VRF |vrf@agilent.com></font><tr valign=top><td><div align=right><font size=1 face="sans-serif">cc</font></div><td><tr valign=top><td><div align=right><font size=1 face="sans-serif">Subject</font></div><td><font size=1 face="sans-serif">[vrf] How can I delete a Key from anINI.file ??? w/ ATTACHMENT THIS TIME</font></table>
<table><tr valign=top><td><td></table>
</table>
<font size=2><tt>Hi VRF
How can I delete a Key (or section) from an INI-File, by using the
Get/WritePrivateProfileStringA functions from Kernel32?
I have attached an example I made (INI-file.vee).
I found this VisualBasic example on the internet, which explains how to
do it:
=============================================
Private Sub ProfileDeleteItem(sSection As String, sKeyName As String,
sIniFile As String)
'this call will remove the keyname and its
'corresponding value from the section sepcified
'in sSection. This is accomplished by passing
'vbNullString as the sValue parameter. For example,
'assuming that an ini file had:
' [Colours]
' Colour1=Red
' Colour2=Blue
' Colour3=Green
'
'and this sub was called passing "Colour2"
'as sKeyName, the resulting ini file
'would contain:
' [Colours]
' Colour1=Red
' Colour3=Green
Call WritePrivateProfileString(sSection, _
sKeyName, _
vbNullString, _
sIniFile)
End Sub
(see entire link here:
http://vbnet.mvps.org/index.html?code/file/pprofilebasic.htm )
=============================================
I just can't make this happen in VEE!?!? How can I make a
"vbNullString"? Someone must have done this before..... HELP!
Regards,
Alex
---
You are currently subscribed to vrf as: Paul.Fowler@raytheon.co.uk
To subscribe please send an email to: "vrf-request@lists.it.agilent.com"with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list, email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".[attachment"INI-file.vee" deleted by Paul Fowler/H9569/RAYTHEONUK] </tt></font>
---You are currently subscribed to vrf as: rsb@soco.agilent.comTo subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".To send messages to this mailing list, email "vrf@agilent.com". If you need help with the mailing list send a message to"owner-vrf@it.lists.it.agilent.com".Search the "unofficial vrf archive" at "www.oswegosw.com/vrf_archive/".