Whereis Urlencode System::Web::HttpUtility

G

Guest

I have ran into a small problem which I am not sure how to resolve. I think
its a bug, but I searched the web and newsgroup and no one else has brought
up the issue. So I think just that i'm a noob when it comes to dot net.

Basically I cannot use the UrlEncode from VC2005 C++. The first porblem is
that intellisense does not show the HttpUtility when I look at the web
namespace.

I thought maybe it was just a intellisense bug so I just manually typed in
the url encode command like this:

String ^text = System::Web::HttpUtility::UrlEncode ("key=text");

But I get these errors during compile:
error C3083: 'HttpUtility': the symbol to the left of a '::' must be a type
error C2039: 'UrlEncode' : is not a member of 'System::Web'
error C3861: 'UrlEncode': identifier not found

Another odd things is the dotnet documenation lists many things in the
system::web namespace, but the VC++ intellisense only shows three items in
the system::web namespace. The ones that are listed are:
System::Web::AspNetHostingPermission
System::Web::AspNetHostingPermissionAttribute
System::Web::AspNetHostingPermissionLevel

I also tried to install VC2005 on two different computers, but I get the
same results.
 
G

Guest

Are you missing a reference to System::Web?

I'm not sure what you mean by reference? How do I check if I have a
reference to System::Web?

Regards,
kito
 
C

Carl Daniel [VC++ MVP]

kito said:
I'm not sure what you mean by reference? How do I check if I have a
reference to System::Web?

You should have a

#using <System.Web.Dll>

in your C++ source file.

-cd
 
G

Guest

You should have a
#using <System.Web.Dll>

in your C++ source file.

-cd

Thanks Carl. This works. This brings up new questions. Why do I not have
to use the #using directive on some of name spaces? For example, I use
System::Net namespace without having to use the #using statement. I'm
guessing the common name spaces are predefined by default. Is there some
kind of list of what is default and what is not default?

Also, it looks like I can use the /AI compiler option to add directories
where it will search for namespaces in the #using directive. However its
not clear to me what the path to the namespace "system.web.dll" is. When I
look at the dotnet framework 2.0 configuration assembly cache app there are
three system.web entires, but none of them have a directory name or path when
I click properties. However, if I use the dotnet 1.1 framework configuration
app then I see only one entry and if click on properties I get the following
path

file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/System.Web.dll

As a new user to CLR CLI .dotnot it would help to understand when I use the
#using directive what .net namespace is being used. As I said I'm a noob so
I am not sure if this matters. I'm just guessing its possible that I can
have namespace with different implementations on the same system. Therefore,
what do I do to tell where the dll files are for each namespace.

Thanks for your time,
kito
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top