|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
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 ![]() |
|
#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 |
|
#7
|
|||
|
|||
|
Yeah I'll try playing around with the &.
I suck at pointers ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > .NET framework and the String class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|