Article View: borland.public.cppbuilder.nativeapi
Article #3420Re: Create a shared network folder?
From: nivekski
Date: Fri, 23 Jun 2006 14:06
Date: Fri, 23 Jun 2006 14:06
72 lines
3073 bytes
3073 bytes
The code below returns the following errors
[C++ Error] mtt.cpp(44): E2034 Cannot convert 'char *' to 'wchar_t'
[C++ Error] mtt.cpp(44): E2141 Declaration syntax error
[C++ Error] mtt.cpp(46): E2034 Cannot convert 'wchar_t' to 'wchar_t *'
[C++ Error] mtt.cpp(50): E2034 Cannot convert 'char *' to 'wchar_t *'
[C++ Error] mtt.cpp(51): E2034 Cannot convert 'char *' to 'wchar_t *'
[C++ Error] mtt.cpp(63): E2034 Cannot convert 'int' to 'wchar_t *'
[C++ Error] mtt.cpp(63): E2342 Type mismatch in parameter 'servername'
(wanted 'wchar_t *', got 'wchar_t')
Any thoughts please folks?
void __fastcall TmainForm::create_share(void)
{
NET_API_STATUS res;
SHARE_INFO_2 p;
DWORD parm_err = 0;
wchar_t shareName = "DTTServer"
p.shi2_netname = TEXT(shareName);
p.shi2_type = STYPE_DISKTREE; // disk drive
p.shi2_remark = TEXT(shareName);
p.shi2_permissions = ACCESS_ALL;
p.shi2_max_uses = -1;
p.shi2_current_uses = 0;
p.shi2_path = TEXT("C:\\DTTServer\\");
p.shi2_passwd = NULL; // no password
res=NetShareAdd(shareName, 2, (LPBYTE) &p, &parm_err);
if(res==0) re1->Text = "Share created.\n";
else re1->Text = "Error: %u\tparmerr=%u\n", res, parm_err;
}
Thanks
--
Nevikski
www.kevsbox.com
"nivekski" <nevikski@tisconi.com> wrote in message
news:449bcb65$1@newsgroups.borland.com...
> Yes I have thanks. And yep that seems like just the thing.
> However being new to BuilderC++, spent many years in VB and Delphi, I am a
> bit of a newcomer to this language, so how do you run a api function in
> C++ please.
>
> Thanks
>
>
> --
> Nevikski
> www.kevsbox.com
> "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
> news:449bc1af$5@newsgroups.borland.com...
>>
>> "nivekski" <nevikski@tisconi.com> wrote in message
>> news:449b2212$1@newsgroups.borland.com...
>>
>>> Using C++Builder 6 I want to share an existing folder to it
>>> is read/write on the local network.Can this be done?
>>
>> Did you look at the WNetAddConnection...() functions yet?
>>
>>
>> Gambit
>>
>>
>
>
Technical Details
Message-ID:
<449bf567@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<449b2212$1@newsgroups.borland.com> <449bc1af$5@newsgroups.borland.com> <449bcb65$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,64233069cb76a215 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "nivekski" <nevikski@tisconi.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <449b2212$1@newsgroups.borland.com> <449bc1af$5@newsgroups.borland.com> <449bcb65$1@newsgroups.borland.com> Subject: Re: Create a shared network folder? Date: Fri, 23 Jun 2006 15:06:37 +0100 Lines: 74 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 212.159.46.118 Message-ID: <449bf567@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1151071591 212.159.46.118 (23 Jun 2006 07:06:31 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail