cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Help required...

From: Nielsen Linus <Linus.Nielsen_at_elema.siemens.se>
Date: Wed, 4 Jul 2001 09:49:01 +0200

> Hi Linus,
>
> Thanks once again. I was able to get ftpget.c compiled
> and I downloaded a File too... :) All credit to you.

Again, you're welcome.

> 1) Ok, now, I am not able to really understand the API
> provided with Curl to write my own programs... Are
> there any examples around apart from these..

I don't know. What is it exactly that you want to accomplish?

> I am not able to properly understand the 3rd parameter
> passed to every function properly
> Eg : Like for eg curl_easy_setopt(curl, CURLOPT_URL,
> "http://ftp.something.com/file.txt")
>
> I could understand that the 3rd param here is a URL
> since there is an example, but for the other
> functions, I am finding it difficult...
> Can you pl help me...

Well. The third parameter can be anything. The curl_easy_setopt()
function is not much more than an advanced variable assignment.
Say, for example, that you need to use an HTTP proxy for your
HTTP transfer, and the proxy address is myproxy.company.com:8080.
You have to tell curl about the proxy name and the proxy port number.
Then you need two curl_easy_setopt() calls:

curl_easy_setopt(curl, CURLOPT_PROXY, "myproxy.company.com");
curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080);

As you can see, the third parameter can be of (almost) any type. It
all depends on which option you are setting.

You can read the pages at http://curl.haxx.se/libcurl/c/ to
find out more about this.

> 2) How Can I get ftpget.c into a .dll so that I can
> call it from VB.??? Can you help me out please bye
> giving me a start. (or) If you have any site which has
> a thorough Docs for creating .dlls in VC so that they
> can be used in Vb, can you please pass it on.

Ooooh. Now we're entering foreign territory for me. I have
never used VB, and I haven't made a DLL since I took a Windows
system programming course in 1997. You see, I am a UNIX and
embedded systems programmer.

You could start by reading this article from MSDN:

HOWTO: Write C DLLs and Call Them from Visual Basic
Article ID: Q106553

It's on the MSDN library that comes with the VC++ compiler.
You can probably find it online too.

> Hope I am not troubling you,

No problem. I'm always glad to help.

/Linus
Received on 2001-07-04