Furtano 11 Newbie Poster

hmm nobody an idea?

Furtano 11 Newbie Poster

I did,
that where the only instructions:

1.
__path__ = ["dir_with_chilkat_pyd"]
2.
require chilkat

Furtano 11 Newbie Poster

hi leegao,
no setup in there :(

Furtano 11 Newbie Poster

no does'nt work, i put all stuff in "C:\Python26\Lib".

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import chilkat
  File "C:\Python26\lib\chilkat.py", line 19, in <module>
    _chilkat = swig_import_helper()
  File "C:\Python26\lib\chilkat.py", line 15, in swig_import_helper
    _mod = imp.load_module('_chilkat', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.
Furtano 11 Newbie Poster

Hello,
I want to use an new library i downloaded e.g. chilkat library (http://www.chilkatsoft.com/python.asp), how do i do that ?

I tried to put on the beginning of my code:

__path__ = ["dir_with_chilkat_pyd"] 
require chilkat

but does'nt work.

What i want to run:
http://www.example-code.com/python/http_loginForm.asp

Furtano 11 Newbie Poster

Hi thanks for you answer.
I did it before, sorry it's not the whole code.
The Problem is i get from GetResponseStream() the Value System.Net.ConnectStream instead of an answer from the webserver.

Furtano 11 Newbie Poster

This is my first try with an API and HttpWebRequest Class in Visual Studio 2008 c++. I try to POST some variables to a link and want an link value from the API back, but I get an Response (not from API) : this->t_bbcode->Text = dataStream->ToString(); // System.Net.ConnectStream

I think there is an error in my Request.

/// Request / Bitte
 HttpWebRequest^ myReq = dynamic_cast<HttpWebRequest^>(WebRequest::Create( "http://linksave.in/protect?api=TRUE" ));
 myReq->Timeout = 3000;
 myReq->ServicePoint->Expect100Continue = false;
 myReq->Method = "POST";
 String^ inputData = "protect=true links=http://rapidshare.com/files/example.rar";
 ASCIIEncoding^ encoding = gcnew ASCIIEncoding;
 array<Byte>^ byte1 = encoding->GetBytes( inputData );
 // Set the content type of the data being posted.
     myReq->ContentType = "application/x-www-form-urlencoded";
     // Set the content length of the String* being posted.
 myReq->ContentLength = byte1->Length;
 System::IO::Stream^ newStream = myReq->GetRequestStream();
 newStream->Write( byte1, 0, byte1->Length );
 myReq->GetRequestStream();
 Console::WriteLine( "The value of 'ContentLength' property after sending the data is {0}", myReq->ContentLength );


 /// Response / Antwort

    HttpWebResponse^ response = dynamic_cast<HttpWebResponse^>(myReq->GetResponse());
System::IO::Stream^ dataStream = response->GetResponseStream();
this->t_bbcode->Text = dataStream->ToString();

// Close the Stream Object*.
  newStream->Close();
response->Close();

Thanks :).

Furtano 11 Newbie Poster

hello,
i defined t_wbrowser with the Webrowser Class.
After i navigated to the Website i want to Copy the text the user selected on the Page.
I have no idea how to do this,
i googled and there was something with ActiveX but is there an easy way?

String^ selected;
 t_wbrowser->Navigate(url);	
// now copy the selected thext into the string 
selected = ???
Furtano 11 Newbie Poster

Hello,
i have some decimal numbers and want to put them hexadecimal in a string stream. Every Hex number should consist of 2 chars^^. I can't find a flag for it.

0__1__2__3__4__5__6__7__8__9__a__b__c__d__e__f__10__11__12__13__14__15__16__17__18__19__1a__1b__1c__1d__1e__1f__20__21_

should be

00__01__02__03__04__05__06__07__08__09__0a__...
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>

using namespace std;

int main (){

 int number = 16;
 string test;

 stringstream out (stringstream::in | stringstream::out);

 for (int i = 0; i < 255; i++){
 	out << hex << i << "__";
 }

 test = out.str();
 cout << test;

return 0;
}
Furtano 11 Newbie Poster

@tux4life
Aaarg.
Yes sorry your right, now it works very fine.
I used g++ -o -W cbr cbr.cpp
instead of g++ -o cbr -W cbr.cpp

Thanks @ all :)

tux4life commented: You're welcome, and well-done on the code tags :) +11
Furtano 11 Newbie Poster

Thanks for your answers, but it doesnt work.

//edit: It does work, but whats with this warnings ?

#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>

using namespace std;

void int_to_hex(string &hex_string); // Prototype

int main(){
	string hex_string; //then hex_string becomes a value...
	hex_string = "test";
	int_to_hex(hex_string);
	return 0;
}

 

void int_to_hex(string &hex_string){
	hex_string += " works not";
}
chris@chris-desktop:~/Desktop/Programmieren II$ g++ -o -W chris cbr.cpp
chris: In function `_start':
/build/buildd/glibc-2.9/csu/../sysdeps/i386/elf/start.S:65: multiple definition of `_start'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o:/build/buildd/glibc-2.9/csu/../sysdeps/i386/elf/start.S:65: first defined here
chris:(.rodata+0x0): multiple definition of `_fp_hw'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o:(.rodata+0x0): first defined here
chris: In function `_fini':
/build/buildd/glibc-2.9/csu/../sysdeps/generic/initfini.c:109: multiple definition of `_fini'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crti.o:/build/buildd/glibc-2.9/csu/../sysdeps/generic/initfini.c:109: first defined here
chris:(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o:(.rodata.cst4+0x0): first defined here
chris: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o:(.data+0x0): first defined here
chris: In function `__data_start':
(.data+0x4): multiple definition of `__dso_handle'
/usr/lib/gcc/i486-linux-gnu/4.3.3/crtbegin.o:(.data+0x0): first defined here
chris: In function `_init':
/build/buildd/glibc-2.9/build-tree/i386-libc/csu/crti.S:15: multiple definition of `_init'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crti.o:/build/buildd/glibc-2.9/build-tree/i386-libc/csu/crti.S:15: first defined here
/tmp/cc06n2A3.o: In function `main':
cbr.cpp:(.text+0x77): multiple definition of `main'
chris:(.text+0x14e6): first defined here
/usr/lib/gcc/i486-linux-gnu/4.3.3/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
chris:(.dtors+0x4): first defined here
/usr/bin/ld: warning: Cannot create .eh_frame_hdr section, --eh-frame-hdr ignored.
/usr/bin/ld: error in chris(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld gab 1 als Ende-Status zurück
Furtano 11 Newbie Poster

Call by Reference with String

Hello,
how can I transfer a String variable with Call by Reference?
Here my code:

#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>

void int_to_hex(int *dez,string hex_string); // Prototype

int main(){
	string hex_string; //then hex_string becomes a value...
	int c = 123;
	int_to_hex(int_to_hex(c, hex_string);
       return 0;
}

void int_to_hex(int *dez,string hex_string){
	hex_string.insert(0,"0x");

}