NO

Author Topic: Are there any sharing code or examples any more ?  (Read 11311 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1965
Are there any sharing code or examples any more ?
« on: October 05, 2012, 10:50:38 pm »
Are there anyone sharing code or examples any more ???
Least Add-In section has been while quiet except TimoVJL and CommonTater ???
Any comment's ???
May the source be with you

CommonTater

  • Guest
Re: Are there any sharing code or examples any more ?
« Reply #1 on: October 06, 2012, 12:26:27 am »
Are there anyone sharing code or examples any more ???
Least Add-In section has been while quiet except TimoVJL and CommonTater ???
Any comment's ???

A friend of mine whom I steered onto these forums a short while ago has commented privately that the forums look dead, which makes it look like Pelles C has been abandoned... And I'm pretty sure that's not the impression we want to leave.  I've tried to inspire some interest in the AddIns and User Contributions areas... but with download counts in single digits I have to say my friend just might be right.  Maybe it is abandoned, not by it's creator, by it's users.

Sharing things like the recent articles on SDL setup and the MSI things is how a community like this grows and prospers... It puts better code into the hands of all of us and it demonstrates interest in the product. 

Timo, you ask a good question...
Why are people not sharing? 
I have no good answer.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1888
Re: Are there any sharing code or examples any more ?
« Reply #2 on: October 07, 2012, 12:08:34 am »
Hi Timo and Tater,
I asked myself the same question time ago and made the following considerations:
  • The first scope of this forum is on PellesC and related issues. On this people are active, but not as much as Pelle would like (see some of his 'lively' comments  ;D)
  • Almost all the more expert developers of this forum deploy their sw on specialized sites (codeproject, sourceforge, etc)
  • The majority of users of this forum are beginners, the questions are much more than the answers, and are almost always very basic questions  :'( (maybe because on other forums they get no answer for so silly arguments)
What you think about?

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 771
Re: Are there any sharing code or examples any more ?
« Reply #3 on: October 07, 2012, 02:59:33 am »
Well, people need to be working (with Pelle's C) on things that are in fact shareable....

The Add-Ins section is certainly far to specialized unless you (= any fellow Pelle's C user) has him/herself a need to add something that (s)he needs. That already limits participation quite a bit IMHO, I for one simply have no such need for the ways how I use Pelle's C...

Beside that, it depends also on how the more advanced C programmers need to be working in something that in fact is shareable. And not everyone is in fact using Pelle's C as their main tool to develop Windows applications, I certainly don't.
I stumbled upon Pelle's C while looking for a compiler option to use as the actual code backend for a (x)Harbour related project a few years ago. Pretty much everyone else using Pelle's C like this isn't likely to work on anything shareable...

Ralf

CommonTater

  • Guest
Re: Are there any sharing code or examples any more ?
« Reply #4 on: October 07, 2012, 05:11:05 am »
Hi Frankie and Ralf...

Just one small counterpoint ... You don't have to share either your whole application or nothing ... libraries, clever functions, custom controls and such should be shareable no matter what you're working on.  (eg. My quick and dirty LPrint library and several that Timo has shared)

I don't think any of us reasonably expects to see the source of a complete application...
« Last Edit: October 07, 2012, 05:18:00 am by CommonTater »

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1888
Re: Are there any sharing code or examples any more ?
« Reply #5 on: October 07, 2012, 04:01:45 pm »
Yes BitBeisser, for many users of PellesC it isn't the main development tool.
There are some pecularities of this tool that comes to be very usefull in some cases and this could one of the main reasons for its use.
The efforts that Pelle has made to build a complete suite with compiler, assembler, IDE and tools allows it to compete with other tools as Borland or GCC.
But because everybody write OOP code (or they think so, considering that there is a lot of plane 'C' code out there with 'cpp' files extension) happens that many users after realizing that they can't compile that code move on other development platforms.
Also some building tools, specifically pomake, are not fully compatible with standard tools, so many free package cannot be compiled directly, so unless you want to manually build the project, you have to use MingW-Shell or the like.
Anyway you can make many things with it (as in this http://forum.pellesc.de/index.php?topic=443.0), and probably users are much more than code publishers.....
Maybe an Addin absolutely necessary is the creation/use of standard make files to compile packages ;)
« Last Edit: October 07, 2012, 04:04:30 pm by frankie »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 771
Re: Are there any sharing code or examples any more ?
« Reply #6 on: October 08, 2012, 03:04:04 am »
Yes BitBeisser, for many users of PellesC it isn't the main development tool.
There are some pecularities of this tool that comes to be very usefull in some cases and this could one of the main reasons for its use.
The efforts that Pelle has made to build a complete suite with compiler, assembler, IDE and tools allows it to compete with other tools as Borland or GCC.
But because everybody write OOP code (or they think so, considering that there is a lot of plane 'C' code out there with 'cpp' files extension) happens that many users after realizing that they can't compile that code move on other development platforms.
I don't think that OOP is an issue here, at least not as long as people understand that this is a C compiler only (and not C++ or even worse, C#).

The main thing that prevents me from even looking at Pelle's C as a viable tool to develop Windows (windowed, not console!) programs is the lack of a visual dialog/form editor, with easy access to all properties and events. That's why I rather use Delphi (or Lazarus, specially for Mac OS and Linux), as that saves me endless time to concentrate on my own program instead of the Windows API...

Ralf

CommonTater

  • Guest
Re: Are there any sharing code or examples any more ?
« Reply #7 on: October 08, 2012, 04:45:33 am »
The main thing that prevents me from even looking at Pelle's C as a viable tool to develop Windows (windowed, not console!) programs is the lack of a visual dialog/form editor

Ummm Ralf, POIDE includes one of the best Windows resource editors I've ever seen... It's half of why I stay with Pelles C, no other IDE does this even half as well.  In POIDE: File -> New -> Resources -> Dialog ... That's about as good as it gets.  I'm curious to know what else you need?
 
Forms emulation is a snap... Just build a dialog based application using CreateDialog() (That's what Delphi does).
 
« Last Edit: October 08, 2012, 04:49:18 am by CommonTater »

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1888
Re: Are there any sharing code or examples any more ?
« Reply #8 on: October 08, 2012, 11:01:39 am »
The main thing that prevents me from even looking at Pelle's C as a viable tool to develop Windows (windowed, not console!) programs is the lack of a visual dialog/form editor, with easy access to all properties and events. That's why I rather use Delphi (or Lazarus, specially for Mac OS and Linux), as that saves me endless time to concentrate on my own program instead of the Windows API...

Ralf

Yes I fully agree. And I started something the like with addins, but then I realized that I needed to interpret .rc files, so I started a simplified interpreter, then I needed a preprocessor, and I started it......
At the end I gave up because I had a lot of code and cannot see the end of the tunnel.
Things could have been much more easy with more hacking in the IDE that always has all that is needed, but it's closed.
Maybe a will post some of that code....

And it could be very simple: add code adding in properties list of resource editor, so you can right click the control and define file and routine.
« Last Edit: October 08, 2012, 11:05:19 am by frankie »

CommonTater

  • Guest
Re: Are there any sharing code or examples any more ?
« Reply #9 on: October 08, 2012, 03:41:15 pm »
Hi Frankie...  I, for one, would be interested in your code. 

Now, I may be wrong about this, but are you guys sure you are not playing "form over substance" here?  Delphi goes miles and miles (with tons of accompanying code) just to avoid the very simple message tossers used in Windows API.  The approach is to transform message tossing into an OOP event system creating a class for almost everything.  It's kinda like putting a Chevy V8 into a Volkswagon; yes you can do it, but at what cost?

What I do is "compartmentalize" my code.  I write the standard dialog using the visual editor then write the message tosser as a switch --also the standard approach-- but I rarely put actual code in the switch.  Instead I use the switch/tosser to call functions, one for each message. 
 
For example... (From Workspace Editor, project.c)
Code: [Select]

// dialog tosser
BOOL CALLBACK PrjTosser(HWND Dlg, UINT Msg, WPARAM wParm, LPARAM lParm)
  {
    switch (Msg)
      {
        case WM_INITDIALOG :        // initialization
          return InitDialog(Dlg,lParm);
        case WM_COMMAND :           // buttons
          switch (LOWORD(wParm))
            {
              case 4002 :           // project directory
                return GetProjectPath(Dlg,4003,4005);
              case 4004 :           // result directory
                return GetResultPath(Dlg,4005);
              case IDOK :           // Save
                return SaveProjectFile(Dlg);
              case IDCANCEL :       // Cancel
                return EndDialog(Dlg, 0); 
              default :
                return 0;
            }
        default :
          return 0;
      }
  }

Each message  is then handled by it's own free-standing bit of code, very much like events in Delphi... except conforming to the standard Windows API non-oop way of doing things.  I find this is very quick to write and far simpler to maintain than even Delphi code. 
 
Using this approach; if you need a list of functions ("events") you can go into the project tree and the source page and expand it to get a list of all functions on the page.  With a bit of careful organization --one dialog per page, descriptive function names, etc.-- you have a very obvious and simple way of getting at the code associated with each dialog and each message it handles.  (See screen cap, below)
 
It's really very straight forward...
 
So, forgive me if I'm wrong, but the argument sounds strangely like form over substance to me.
 
« Last Edit: October 08, 2012, 03:51:26 pm by CommonTater »

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1888
Re: Are there any sharing code or examples any more ?
« Reply #10 on: October 11, 2012, 12:05:05 pm »
Tater,
I'm in a busy period right now, so I have to find time to rearrange my modules to pubblish them.
Anyway the idea I had is very close to your programming concept.
I would create a SQLight DB for the project where to save the data. This DB file will be added to the project files as "other files", so it is saved in the project.
When designing a dialog I would catch the property popup menu and add to it an entry "Handle a message".
From this entry another menu open where you define for that item the message type and the handling subroutine (and eventually the source file where to locate the subroutine). These data would be saved in the project DB.
At any resource modification a dedicate routine scans the DB and create a general switch (like yours) adding the required entry: one for each message and the call of the related handling routine.
I planned to reuse the message cracker software to populate the list of available messages for that kind of control.
The list of messages and association may be held in another DB resident in PellesC installation folder (together with the addin dll), so the Addin can be updated with new messages and controls added by M$ without changing the software.
I Hope Timo and anyone could help would join and give us his considerations.

This could be one of the first shared projects on PellesC forum 8)
« Last Edit: October 11, 2012, 12:10:07 pm by frankie »

CommonTater

  • Guest
Re: Are there any sharing code or examples any more ?
« Reply #11 on: October 11, 2012, 02:34:45 pm »
Anyway the idea I had is very close to your programming concept.

Interesting ... but it's not a "concept" this is how I did things on a regular basis.  I've never needed to automate it, since it just comes naturally to work that way...

Quote
This could be one of the first shared projects on PellesC forum 8)

Now THAT would be interesting. 

Open Source projects aside...
I've been on several programming forums over the years and I've worked professionally with programmers (as a service manager) and the one thing I keep noticing is the rather obvious lack of comaraderie.  We seem to be a bunch of "lone wolves" (and I'm really bad for this) who just keep reinventing wheels... A bit of sharing and cooperation might make a huge difference. 
 

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1965
Re: Are there anyone sharing code or examples any more ?
« Reply #12 on: September 13, 2013, 09:17:33 pm »
It is time to ask this again ?
If interest is this low, can i remove all my code in this forum ?
May the source be with you

SKAN

  • Guest
Re: Are there anyone sharing code or examples any more ?
« Reply #13 on: September 14, 2013, 12:23:06 am »
Greetings from a Windows Programmer! :)

I am a newbie to "C" but have good experience in a high level interpreted language and especially WINAPI.
Until recently, I had never thought I would ever grasp even the simplest fundamentals of this great ancient language.

This is how I ended up here:
Because of my high exposure to WINAPI, I had always wanted to create a DLL on my own.
A couple of months ago, I finally wanted to give it a try. After many hours in Google I decided and downloaded BCX. It asked for LCC but I chose to try Pelles C. Everything went well when I tried a simple example DLL. After looking at the C code it generated, It just clicked inside me that I CAN really learn C.

I consider myself having made a good progress so far, given the fact that I have never touched a single text book.
Now and then, Google results were there to clarify my simple doubts, but knowledge has been imparted to me mainly from this forum in the form the posts and examples made by you and frankie / Bitbeisser / CommonTater / Vortex / Pelle and of course many others whom I do not remember at this moment.

When I began as newbie in an another Scripting Language Forum, I was so excited to try out WINAPI. Once I got the hang of it, I started to churn out lots of snippets which was regularly criticized and nitpicked and by the experts but were mostly appreciated as good attempts. Seeing the progress made by a noob like me inspired few other noobs to post code and then some more, and then many more and now forum flourishes with many millions of lines of useful code.... posted by those noobs who are now the experts.

Maybe, there is a void in our forum here. Every snippet I read, has been posted by experts.
I will try to contribute and fill the void. :)

It is time to ask this again ?
If interest is this low, can i remove all my code in this forum ?

I sincerely hope you are not serious. In case you are, please reconsider.
I already miss 'CommonTater' and feel sad for not having existed in the same timeline.
You just made me feel more sadder! :(

CLR

  • Guest
Re: Are there anyone sharing code or examples any more ?
« Reply #14 on: September 15, 2013, 08:45:07 am »
It is time to ask this again ?
If interest is this low, can i remove all my code in this forum ?

Hello timovjl.
I appreciate your code. It would be sad if you remove it.