473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

WebServices through VC.Net

Dear Sir/Madam

I should call web sevice from VC.Net,
The problem is when i want to create NetworkCredential object.
because that's undefined.
Please do me a Favore and tell me how can i do this.

because NetworkCredential defined in System.net,

Regards,
Nov 17 '05 #1
8 1072
Hamed,
I should call web sevice from VC.Net,
The problem is when i want to create NetworkCredential object.
because that's undefined.
Please do me a Favore and tell me how can i do this.

because NetworkCredential defined in System.net,


Did you add
#using <System.dll>

to your .cpp file?
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #2
Thank you,
But when I Try to use NetworkCredential in VC.Net I get this error.

Code:
NetworkCredential* myCredentials = new NetworkCredential("user", "pass");
Error:
error C2065: 'NetworkCredential' : undeclared identifier

and in C# just add this line of code using system.net;
But in VC.Net I dont know what should I do.
I added #using<system.dll> bu still that error occures.

Please let me know,
Thanks in advance.

"Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
Hamed,
I should call web sevice from VC.Net,
The problem is when i want to create NetworkCredential object.
because that's undefined.
Please do me a Favore and tell me how can i do this.

because NetworkCredential defined in System.net,


Did you add
#using <System.dll>

to your .cpp file?
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/

Nov 17 '05 #3
Hamed,
But when I Try to use NetworkCredential in VC.Net I get this error.

Code:
NetworkCredential* myCredentials = new NetworkCredential("user", "pass");
Error:
error C2065: 'NetworkCredential' : undeclared identifier

and in C# just add this line of code using system.net;
But in VC.Net I dont know what should I do.
I added #using<system.dll> bu still that error occures.


Well, you're not considering the namespace it is in. Either qualify the
name, or add a
using namespace System::Net;
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #4
Thanks alot,
I Set the option in compiler to /clr
#using <system.dll>
#using <mscorlib.dll>
using namespace System::Net;
in .cpp file

Ok now class in defined,
But there is a new error on this line:
NetworkCredential* myCredentials = new NetworkCredential("user", "pass");

ERROR:
error C3828: 'System::Net::NetworkCredential': placement arguments not
allowed while creating instances of managed classes
Regards & thanks in advance.
------------------------------

"Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
Hamed,
But when I Try to use NetworkCredential in VC.Net I get this error.

Code:
NetworkCredential* myCredentials = new NetworkCredential("user", "pass");

Error:
error C2065: 'NetworkCredential' : undeclared identifier

and in C# just add this line of code using system.net;
But in VC.Net I dont know what should I do.
I added #using<system.dll> bu still that error occures.


Well, you're not considering the namespace it is in. Either qualify the
name, or add a
using namespace System::Net;
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/

Nov 17 '05 #5
Hamed,
I Set the option in compiler to /clr
#using <system.dll>
#using <mscorlib.dll>
using namespace System::Net;
in .cpp file

Ok now class in defined,
But there is a new error on this line:
NetworkCredential* myCredentials = new NetworkCredential("user", "pass");

ERROR:
error C3828: 'System::Net::NetworkCredential': placement arguments not
allowed while creating instances of managed classes


Something else must be causing the error because that line you just posted
compiles just fine for me. Can you show us the exact code? (including some
before and following context lines)
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #6
I'm pretty sure your problem can be explained here:
http://msdn.microsoft.com/msdnmag/issues/04/09/CQA/

"Hamed" <gh*****@softechnic.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
OfCource yes,
This is the whole project attache to this message,
There is no extera code up and down of the function.

I had to set /clr option because of including #using <system.dll>

Regards,


"Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
news:e$*************@TK2MSFTNGP14.phx.gbl...
Hamed,
> I Set the option in compiler to /clr
> #using <system.dll>
> #using <mscorlib.dll>
> using namespace System::Net;
> in .cpp file
>
> Ok now class in defined,
> But there is a new error on this line:
> NetworkCredential* myCredentials = new NetworkCredential("user", "pass"); >
> ERROR:
> error C3828: 'System::Net::NetworkCredential': placement arguments not
> allowed while creating instances of managed classes


Something else must be causing the error because that line you just
posted
compiles just fine for me. Can you show us the exact code? (including
some
before and following context lines)
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/


Nov 17 '05 #7
Thanks, but
I didn't find anything related to Networkcredential.

regards,
"James Park" <jp**********@SpaMMEhotmail.com> wrote in message
news:uH*************@TK2MSFTNGP09.phx.gbl...
I'm pretty sure your problem can be explained here:
http://msdn.microsoft.com/msdnmag/issues/04/09/CQA/

"Hamed" <gh*****@softechnic.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
OfCource yes,
This is the whole project attache to this message,
There is no extera code up and down of the function.

I had to set /clr option because of including #using <system.dll>

Regards,


"Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
news:e$*************@TK2MSFTNGP14.phx.gbl...
Hamed,

> I Set the option in compiler to /clr
> #using <system.dll>
> #using <mscorlib.dll>
> using namespace System::Net;
> in .cpp file
>
> Ok now class in defined,
> But there is a new error on this line:
> NetworkCredential* myCredentials = new NetworkCredential("user",

"pass");
>
> ERROR:
> error C3828: 'System::Net::NetworkCredential': placement arguments not > allowed while creating instances of managed classes

Something else must be causing the error because that line you just
posted
compiles just fine for me. Can you show us the exact code? (including
some
before and following context lines)
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/



Nov 17 '05 #8
Read the part about MFC overloading the new operator.

"Hamed" <gh*****@softechnic.com> wrote in message
news:ez**************@tk2msftngp13.phx.gbl...
Thanks, but
I didn't find anything related to Networkcredential.

regards,
"James Park" <jp**********@SpaMMEhotmail.com> wrote in message
news:uH*************@TK2MSFTNGP09.phx.gbl...
I'm pretty sure your problem can be explained here:
http://msdn.microsoft.com/msdnmag/issues/04/09/CQA/

"Hamed" <gh*****@softechnic.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
> OfCource yes,
> This is the whole project attache to this message,
> There is no extera code up and down of the function.
>
> I had to set /clr option because of including #using <system.dll>
>
> Regards,
>
>
>
>
> "Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
> news:e$*************@TK2MSFTNGP14.phx.gbl...
>> Hamed,
>>
>> > I Set the option in compiler to /clr
>> > #using <system.dll>
>> > #using <mscorlib.dll>
>> > using namespace System::Net;
>> > in .cpp file
>> >
>> > Ok now class in defined,
>> > But there is a new error on this line:
>> > NetworkCredential* myCredentials = new NetworkCredential("user",
> "pass");
>> >
>> > ERROR:
>> > error C3828: 'System::Net::NetworkCredential': placement arguments not >> > allowed while creating instances of managed classes
>>
>> Something else must be causing the error because that line you just
>> posted
>> compiles just fine for me. Can you show us the exact code? (including
>> some
>> before and following context lines)
>>
>>
>> --
>> Tomas Restrepo
>> to****@mvps.org
>> http://www.winterdom.com/
>>
>>
>
>
>



Nov 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jinashe | last post by:
what do i need to enable accessing of webservices from a clients PC i'm hosting some webservices from my server in VB.NET. i've got some client windows applications done in VB.NET. what have i...
0
by: Erik P. Vinther | last post by:
Hi This might be slightly OT, but I couldn't find a better NG for this question The question is regarding versioning of webservices. A webservice end point URL basically consists of a base...
8
by: Allan Ebdrup | last post by:
I just had a discussion with one of my fellow programmers. We have a class for doing some logging and sending an email, it has 5 different scenarioes of loggin that are common enough to share a...
5
by: Stephanie Stowe | last post by:
Imagine that I had this <webServices> <soapExtensionTypes> <add type="Microsoft.Web.Services.WebServicesExtension, Microsoft.Web.Services, Version=1.0.0.0, Culture=neutral,...
1
by: Diffident | last post by:
Hello Guys, I have a question with regards to the efficiency and best practices in .NET framework. We are currently using Webservices as normal classes. The way we are invoking methods in...
5
by: cyberstrike | last post by:
Hi guys, my company was wondering if it's possible to develop ASP.NET/Webservices easily using a IIS installed on a server instead of installing IIS locally on the development boxes. Can you...
2
by: Antuane | last post by:
any one have any idea how transactions could be enabled in webservices. i.e., suppose i've got 2 methods - one to add a contact, & the other to set some miscellaneous details for the contact, in a...
1
by: Mike | last post by:
Hi all, I have written a webservice which I am using in my smartphone applicaiton. I have tried the webservice with a WinForms client and it works time and time again perfectly. When I include...
8
by: Komandur Kannan | last post by:
We have a smart device application running on handhelds(Symbol MC9000G). The backend is Oracle and a middle tier web services development done in Vb.net. We use pessimistic Locking due to...
5
by: ChrisM | last post by:
Hi, I have written a stand alone WinForms application with an MS Access back-end for the (small)company I work for. They are now talking about moving a part of their operations into a second...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.