[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: thanks stefan. but i need little more help ;-(

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2006-03-13 18:56:22 CET

문홍재 wrote:

> i got a code from TortoiseShell\TortoiseSVN.cpp, especially
> GetStatusFromRemoteCache. and i got it it was roll with pipe features.
>
> i'm programming using by Microsoft Visual Basic 6, not dotnet
> or VC++, for rapid building for user interface.
>
> (and, i have no dotnet or visual studio 2005. so i can't compile any
> tsvn source. that is a additional problem. of cause, as i read from
> readme in tsvn soruce package, vs2005 express versions are open to
> public, but i can't use that some reason. sorry.)
>
> i can use TSVNCache pipe with CallNamedPipe(), not TransactNamedPipe.
>
> (i know about it is possible, too. i'll question about it in below.)
>
> but i have some problem. please tell me answer about this problem.
> maybe, this problem is some programming-language speicified problem, not
> a problem of visual c++ or TortoiseSVN. but i have hope about you may
> have answer about it.
>
> or, some others can help me. please help me. ;-(
>
> i googled over 1days, include sunday, but i can't find fittable answers. ;-(
>
> (1) using struct TSVNCacheRequest for requesting and WCHAR
>
> the originally delcared TSVNCacheRequest is are;
>
> struct TSVNCacheRequest
> {
> DWORD flags;
> WCHAR path[MAX_PATH+1];
> };
>
> and i potting it for visualbasic 6 as;
>
> Private Type structTSVNCacheRequest
> flags As Long
> Path As String * 261

A string is hardly a WCHAR! You basically reserve the memory for 261
strings here, not 261 chars!

> End Type
>
> and deal the struct as;
>
> tsvnRequest.Path = StrConv("c:\testwc",vbUnicode)
>
> tsvnRequest.flags = TSVNCACHE_FLAGS_NONOTIFICATIONS Or
> TSVNCACHE_FLAGS_RECUSIVE_STATUS
>
> but it wasnt does. the returned points are some meanless datas of 21
> bytes from CallNamedPipe().
>
> WCHAR is unicode stringset. and then, i suppose it can
> be potted to vb as deal the 'path' member to using StrConv() for
> convert to unicode. (strconv are some text convert to some charset).
> but. is it right? is it can make fittable char data?
>
> if charset convert was not a problem, there are some another rule about
> describe path? (i suppose it is few possibilities.)

Please accept that we can't give you support for your own program and
VB6 related problems. That just wouldn't be right, because we want to
work on TSVN and not something we (and our users) don't benefit from.

> (2) Can i use CallNamedPipe()?

I think so, yes. But it's much slower, because for every call, you open
a new pipe instead of reusing an already existing pipe. With
CallNamedPipe() you can put a real burden on the OS if you call it too
often.

> result= CallNamedPipe(szPipeName, VarPtr(tsvnRequest), Len(tsvnRequest),
> bArray(0), numBytes, cbRead, 50)
>
> i used CallNamedPipe, not TransactNamedPipe with CreateFile. i thought
> it is a simple better tsvnshell's way. but question are still being. why
> don't you use CallNamedPipe? as your descriptions,

CallNamedPipe is equal to

CreateFile
TransactNamedPipe
CloseFile

Sure, for one call, that's the same. But we only use CreateFile once,
then reuse the open file (pipe) handle for all other calls to
TransactNamedPipe, then close the file (pipe) handle once the shell
extension gets unloaded. In between, we don't create a new pipe every
time we want to ask the cache something.

> reasons of using TransactNamedPipe are for overlappedmode, and
> the reasons of using overlappedmode are quickly user reflection.

No. See above.

> if that was true, digging pipe using CallNamedPipe() has no
> problem, too. isn't it? frankly, i can't know about this. please mention
> about it.

Just did above.

> (2) Can i retrive result value as native data blocks?
>
> struct TSVNCacheResponse
> {
> svn_wc_status2_t m_status;
> svn_wc_entry_t m_entry;
> svn_node_kind_t m_kind;
> char m_url[INTERNET_MAX_URL_LENGTH+1];
> char m_owner[255]; ///< owner of the lock
> char m_author[255];
> bool m_readonly; ///< whether the file is write protected or not
> };
>
> i'm not skilled in potting VC++ to VB. so i'll retrive native data from
> TSVNCache, not seperated as struct. (of cause, it would possible,
> maybe.) if it possible, can you tell me length of struct
> TSVNCacheResponse? (especially, in Windows2000 or WindowsXP)

You can find out the length yourself. Check the Subversion source header
files. There you will find the structs svn_wc_status2_t, svn_wc_entry_t,
svn_node_kind_t. The size of 'char' is one byte.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Mon Mar 13 18:56:51 2006

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.