.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 17th, 2003, 09:17 AM
kenshiro kenshiro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Rochester, NY
Posts: 21 kenshiro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to kenshiro
Question .NET framework and the String class

OK, I'm working on an app in .NET C++ and I have two questions.

1) Is there any way to make the .NET framework stuff that my app needs part of my binary .exe file? It's kind of annoying how people have to install the .NET framework just to run my app.

2) I'm passing String objects to a function that is expecting a normal string like "a string" but for some reason it doesn't seem to work. I tried .ToString() and .ToCharArray() but neither of them worked either.

Thanks in advance.

Reply With Quote
  #2  
Old October 17th, 2003, 09:32 AM
oni9 oni9 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Brisbane, Australia
Posts: 50 oni9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
1) theoritically there should be a way.... however if your user does update their windows all the time, they should should have .NET framework installed...



2) did you do any pointer address operation on the string you passing to your function? it is hard to guess what actually happened with out seeing the actual syntax...

your function should be able to read the string directly (as if your string is defined as System.String, alia: string)





--------------------
EDIT, added for the 1st part (I forgot to give you my solution)
This is C# way, I have not tried it, so don't expect it to work.
If you open the property window for the resource library you are using, you will see a property called "Copy Local". Assign true to this property, and that particular library will be output together with your app.
I have only tried it with something like MSChart, MSWord, never tried with the .NET core, so good luck

Last edited by oni9 : October 17th, 2003 at 09:43 AM.

Reply With Quote
  #3  
Old October 17th, 2003, 09:38 AM
kenshiro kenshiro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Rochester, NY
Posts: 21 kenshiro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to kenshiro
I declare them in my header file like this:

String *proxyServer;
String *proxyPort;

Then I pass String*'s to this function:

void curlWorker::SetProxy(String *proxyServerIn, String *proxyPortIn)
{
this->useProxy = true;
this->proxyServer = String::Copy(proxyServerIn);
this->proxyPort = String::Copy(proxyPortIn);
}

Then I try to pass the strings to cURL like this:

if(this->useProxy)
{
curl_easy_setopt(curl, CURLOPT_PROXY, this->proxyServer);
curl_easy_setopt(curl, CURLOPT_PROXYPORT, this->proxyPort);
}

But it doesn't seem to work.

When I hardcode in values for the proxy like:

curl_easy_setopt(curl, CURLOPT_PROXY, "proxyserver");
curl_easy_setopt(curl, CURLOPT_PROXYPORT, this->"8000");

it does work.

Any idea what I'm doing wrong? Thanks.

Reply With Quote
  #4  
Old October 17th, 2003, 09:49 AM
oni9 oni9 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Brisbane, Australia
Posts: 50 oni9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I never use C++ .NET (I did VC++ long ago)

---------- ignore below
probably your proxyServer and proxyPort were not defined as (string *)
---------- ignore ends


Code:
String *proxyServer;
String *proxyPort;

Then I pass String*'s to this function:

void curlWorker::SetProxy(String *proxyServerIn, String *proxyPortIn)
{
  this->useProxy = true;
  this->proxyServer = String::Copy(proxyServerIn);
// try this->proxyServer = proxyServerIn->Clone() instead
  this->proxyPort = String::Copy(proxyPortIn);
// try this->proxyServer = proxyPortIn->Clone() instead
} 

Last edited by oni9 : October 17th, 2003 at 09:54 AM.

Reply With Quote
  #5  
Old October 17th, 2003, 09:52 AM
kenshiro kenshiro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Rochester, NY
Posts: 21 kenshiro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to kenshiro
Actually I did that in the header file like:

String *proxyServer;
String *proxyPort;

Well, I'll keep investigating. This is a PITA because I've been stuck on it for like 24 hours

Reply With Quote
  #6  
Old October 17th, 2003, 09:57 AM
oni9 oni9 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Brisbane, Australia
Posts: 50 oni9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
have you tried '&' operator yet?

sorry I did not touch C++ for a year now... forgot how to play with pointers... I'm sure it is the memory address pointer problem

Reply With Quote
  #7  
Old October 17th, 2003, 09:59 AM
kenshiro kenshiro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Rochester, NY
Posts: 21 kenshiro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to kenshiro
Yeah I'll try playing around with the &.

I suck at pointers

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > .NET framework and the String class


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT