dclipx DC_GetNetName() returnvalue undef.

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

dclipx DC_GetNetName() returnvalue undef.

#1 Post by hz_scotty »

hi Roger

i use the function DC_GetNetName() in my application

it returns the netname from the registry (my netname "MSI-WORKS" has 9 chars und the
function returns 10 chars (when i test it with "len(dc_GetName())")

when i display the return value with MSGBOX() i see "MSI-WORKS" - ok
when i display the return value with DC_MSGBOX i see only "MSI_WOR...." (the end has "...")
with DCSAY i see a undefind Char at the End of the Name (see Picture)
i think that the char at the end makes the "MSI-WOR..." Error in DC_MSGBOX()

my workaround is to trim the last char -

Code: Select all

cNetName:=substr(cNetName,1,len(cNetName)-1)
Can you look at your function if you can fix it
is use WinXP SP3 but the problem is also on VISTA und i hera about that on WIN7 it is also

thanks
Attachments
dc_getnetname_error.jpg
dc_getnetname_error.jpg (7.19 KiB) Viewed 7248 times
best regards
Hans

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dclipx DC_GetNetName() returnvalue undef.

#2 Post by rdonnay »

Some Win API calls put a Chr(0) at the end of a string.

I would try this instead:

Code: Select all

cName := Strtran(cName,Chr(0),'')

RETURN (Upper(Alltrim(cName)))
The eXpress train is coming - and it has more cars.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: dclipx DC_GetNetName() returnvalue undef.

#3 Post by hz_scotty »

works fine :clap:

i put the line into DC_GetNetName() in _DCFUNCT.PRG - not in my Application!
so please remember this for your v255

thanks for help
best regards
Hans

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dclipx DC_GetNetName() returnvalue undef.

#4 Post by rdonnay »

I already made the change in 255.
The eXpress train is coming - and it has more cars.

Post Reply