Page 1 of 1

Add REG_MULTI_SZ to Registry

Posted: Mon Mar 08, 2010 1:03 pm
by bwolfsohn
Tried to lookup on the old barod if this had ever been asked, but the old board didn't respond..

I'd like to add a REG_MULTI_SZ entry to a registry, but dc_regwrite() doesn't seem to handle that type of entry..

btw, this is to add a dependency on ads database server for a service, so when the machine reboots, everything comes up correctly.

I currently do this manually

Brian

Re: Add REG_MULTI_SZ to Registry

Posted: Mon Mar 08, 2010 2:34 pm
by rdonnay
I rebooted the old server, so you can try again with your search.
I discovered that it will be a monumental project to try to move that data into the new forum. Sorry.

I will see what I can do with DC_RegWrite() to handle this.
I thought that this issue came up once in the past and was resolved.

Re: Add REG_MULTI_SZ to Registry

Posted: Mon Mar 08, 2010 4:25 pm
by Cliff Wiernik
Would it be possible or easier to just export to a type of database and then be able to search it. You could download the data to search as needed.

Re: Add REG_MULTI_SZ to Registry

Posted: Tue Mar 09, 2010 9:03 am
by rdonnay
Brian -

I modified DC_RegWrite() to support REG_MULTI_SZ, however now you must pass a 5th parameter as the
type. If this parameter is not passed, then the previously supported types will still work as before to prevent any regression. What I read about REG_MULTI_SZ is that all values are separated by a null plus a terminator null.

Download the updated _DCREG.PRG from here:

http://bb.donnay-software.com:8080/support/_dcreg.prg

Copy it to \exp19\source\dclipx directory.

Run build19.bat or build19_sl1.bat to rebuild dclipx.dll

My test program:

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL cString, nStatus

cString := '111' + Chr(0) + '222' + Chr(0) + '333' + Chr(0) 

nStatus := DC_RegWrite(HKEY_CURRENT_USER,'Software\Cus\Test','Brian',cString, REG_MULTI_SZ )

WTF nStatus

cString := DC_RegQuery(HKEY_CURRENT_USER,'Software\Cus\Test','Brian')

WTF cString

RETURN nil

PROC appsys ; return