May 16, 2024, 11:44:21 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Aurora Common Classes

Started by Zen, January 06, 2006, 11:26:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Parker

Wow, so weird. Apparently when the functions names are changed (StrToUnicode instead of ToUnicode) it works fine. Anyone know if another library has exported ToUnicode?

Ionic Wind Support Team

It is a Windows API function located in user32.dll

See MSDN for details.  Here is the snippit from their site:

Quote
Remarks

    The parameters supplied to the ToUnicode function might not be sufficient to translate the virtual-key code because a previous dead key is stored in the keyboard layout.

    Typically, ToUnicode performs the translation based on the virtual-key code. In some cases, however, bit 15 of the wScanCode parameter can be used to distinguish between a key press and a key release.

Function Information

    Minimum DLL Version   user32.dll
    Header   Declared in Winuser.h, include Windows.h
    Import library   User32.lib
    Minimum operating systems   Windows NT 3.1

Ionic Wind Support Team

Zen

Ha Ha. I knew there must of been something causing it. Thanks a lot Paul.

Lewis

Zen

Just a progress report for the HTTP class. Its coming along quite nicely. Although the first release will not have support for SSL, the final version will do (including client certificates) So there is not really a lot you wont be able to do with this.

There are support functions for reading headers, adding headers, status codes etc. The class has successfully made its first request, recieved a code 200 and printed the output to the console. ;D

So it shouldnt be too long before this is working.

Lewis

Rock Ridge Farm (Larry)

Does that possibly mean that I could write an Auora  program to sftp to another box with
this Class? It would be useful if I could visit boxes on my network and pick up
files for re-distribution to other boxes on the network. I know I can do this many ways
but I would like to use one program to do it. Kinda a transport utility.

Zen

Well i will be writing an FTP class after this HTTP class. Although you can transfer files, alsong as they are over the HTTP protocol. You would also have to write the files to disk yourself. I would recomend waiting for the FTP class but if you would like to have a go then feel free.

Lewis

Parker

From what I've heard all this web stuff just requires some commands to send to a server, which you can do with the windows API or the raw internet class. But I know nothing of internet programming so I'll just wait around for Lewis to write those before I do anything. I'm sticking to writing what I know ;)

Rock Ridge Farm (Larry)

If I did that I would never write anything. :)

Parker

Oh, I'm learning. But I'm not going to attempt an internet class since it would take much longer than it would for Lewis. I had never had a successful command line parser before, or used the registry. And coming soon are the piping and service classes, which I've used to some extent but will have to use MSDN a lot.

Even some of the terminology used with this internet stuff loses me, but I'm picking up on it when Lewis explains something ;)

Zen

Leave them to Lewis? ??? You make it sound like i know what im doing ;)

Well whilst programming the HTTP class its the first time ive used any unicode functions so thats something new. After having a bit of experience with web programming including raw HTTP stuff i am trying to make this class for the users who know nothing and just want to get web pages or download other files over HTTP. To the advanced user who wants to use PUT and POST methods and modify headers etc.

So it is still coming along qute nice. After the HTTP class i will be making an FTP class because Rock Ridge is waiting for it ;) Then i will probably finish of the MySQL class then do a HTTP server class, so you can make your own webservers.

Lewis

Parker

At least you know more than me.

About a server class, I wonder if it wouldn't be better to just download Apache. I suppose a simple one would be nice to have, but Apache supports all kinds of plugins and is stable having been around for years. Of course a simple server to do dynamic documentation for say a web scripting language ;) would be a nice thing to have.

Zen

Well i just thought for simple things, a server class would be good to just serve basic documents and images. It is also something i have always wanted to do too.

Lewis

Zen

January 24, 2006, 07:36:48 AM #112 Last Edit: January 24, 2006, 07:38:26 AM by Lewis
Ok the Wikki and docs stuff is coming along. Ive designed an XML based system that will allow me and parker to update and add docs via a website CMS ive built. The clever part is whenever you are connected to the internet the documents will automaticly check for updated versions of themselves by checking the signature of the file against the automaticly updated signature of the file on the server. This process is very fast as the signature is only 32 bytes. If the signatures do not match then it will automaticly download the updated file in the background.

The document files are simple XML documents, which will also help with speed in downloading as they are not as complex as word documents or other popular formats.

When a document is accessed by the document reader (the program) the XML file is parsed and rendered into a nice looking format. Each page in the document also features a Wikki type thing so that you guys can post your own bits of help and tricks to help others out when they use the docs.

All of this is done through one simple program (making use of the latest HTTP and XML classes from CCL). This program also features an offline mode so you dont even have to be on the internet.

It shouldnt be too long before i can release the first version of it. Maybe a week or so.

Lewis

Zen

i have an idea for the XML class. At first i thought it would not be a good idea making something like an XML parser as a class. Then i thought i could have an XML class which will perform most operations such as loading an unloading XML files and other basic functions. When it comes to recursing through nodes i thought about having the main class returning a pointer to a node class which would contain the data and the methods for that particular node. This way it would be easier to keep it moreobject orientated.

If no one understands what i mean, i could write a small example to show you.

How do people feel about this?

Lewis

Parker

There's a dynamic string now. It's not very complicated or efficient, it just uses GlobalReAlloc to resize itself when you call Concat. Also it should be pretty obvious from all I've been saying that you can't do something like DynString ds;
ds = "Hello";

You have to call the Assign() or Concat() methods.

class DynString
{
string *m_pString;

declare _DynString();

declare Assign(string str);
declare Concat(string str);

declare strptr(),pointer;
declare a_str(),string;
declare strlen(),unsigned int;
}


The strptr function returns the m_pString variable, the a_str function returns an Aurora string (like c_str for C++ std::string) and the strlen function returns the length of the string.

Later on it will support "blocks" so it doesn't have to reallocate every time you add something to it.

This is just for convenience, it's not a big effort. I think it took me all of 10 minutes to decide how it's going to be and make it. It will be sent to Lewis in the morning (well morning here) and be in the next CCL update and source update.

A simple example
global sub main()
{
DynString ds;
ds.Assign("Hello");
ds.Concat(" World");

writeln(ds.a_str());

while (GetKey() = "");
}

Zen

Just for those of you who are wondering what is currently going on and for those who are wondering about the source license.

I am currently working on the following classes:-

HTTP - To make requests and to receive data from web servers. Also download files over HTTP.

XML Parser. Used with the eXpat XML parser library. This class allows simple and powerfull parsing of XML files

MySQL - direct access to MySQL servers to perform operations in a simple manner. Covering up a lot of the nasty SQL stuff.

DImport - Dynamic importing of DLL files. Provides usefull methods for loading resources and subroutines from run-time loaded DLL's.

I have plenty more in mind such as encryption and encoding librarys. All to come in the near future. So this is just to give you a little heads up for what is to come.

Lewis

Parker

Just a reminder, if you are using the common class library and find it limited in some way, or that X class doesn't implement Y feature, let us know and we'll do our best.

Sometimes I oversee something and it takes a request to get it implemented.

Zen

Exactly. This is not just something that me and pakrer want. This is something for the whole community. Sometimes you dont think of things untill people suggest them. So anything you want just say. This is more than definatley an open to public thought project.

Lewis

Parker

While reading about some of the data structures on the internet, I discovered that there are terms used to put items into a Queue and to take them out, Enqueue instead of Put, and Dequeue instead of Get. Are there any objections to those functions changing or is someone already using them?

Zen

maybe you could make an alias. make Enqueue just call Put. so people can use both if they wish.

Lewis

Rock Ridge Farm (Larry)

Do you have any examples that use the CCL stuff yet?

Parker

The only official examples are the raw internet ones, which are installed in your examples directory. But all my classes have a test that would show how to use it, they just aren't included. Let me know which class you need to know how to use and we'll get something together for you.

Brian

Hi,

I've got a question! Where do we download the Common Classes from?

Thanks,

Brian

Zen

erm look a few pages back. there is a link on one of my posts.

I think i will make another topic with the download in it.

Lewis

Doc

Hello Brian, long time no see...

I believe you will find a link on this page: http://www.ionicwind.com/forums/index.php?topic=165.45

About 1/2 to 3/4 way down. :)

-Doc-