topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday March 29, 2026, 3:06 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 1205 1206 1207 1208 1209 [1210] 1211 1212 1213 1214 1215 ... 1515next
30226
General Software Discussion / Re: good software review site
« Last post by mouser on August 12, 2006, 01:32 PM »
you've convinced me to be wary of this; im removing this from our blog.
30227
im not using any flags, its just that the code is mostly clean
for example:

Code: C [Select]
  1. SWIGEXPORT void * SWIGSTDCALL CSharp_new_SimpleKeyWrapper() {
  2.   void * jresult ;
  3.   SimpleKeyWrapper *result = 0 ;
  4.  
  5.   result = (SimpleKeyWrapper *)new SimpleKeyWrapper();
  6.   jresult = (void *)result;
  7.   return jresult;
  8. }
  9.  
  10.  
  11. SWIGEXPORT void SWIGSTDCALL CSharp_delete_SimpleKeyWrapper(void * jarg1) {
  12.   SimpleKeyWrapper *arg1 = (SimpleKeyWrapper *) 0 ;
  13.  
  14.   arg1 = (SimpleKeyWrapper *)jarg1;
  15.   delete arg1;
  16.  
  17. }

where SWIGEXPORT and SWIGSTDCALL are just the normal DLL exporting.

in other words, the C# target for Swig is mostly just the same wrapper you would make yourself to expose the functions.
and then it also generates a bunch of .cs modules to help access the functions, which i discard.
30228
General Software Discussion / Re: good software review site
« Last post by mouser on August 12, 2006, 11:04 AM »
i looked at one review briefly and it looked quite reasonable..
didn't appear to me that they were one of these fake review sites.. but if it turned out they were one of the fake "top hosting provider" sites, where companies pay to be listed, i would be very unhappy.
30229
yep now we are basically on the same wavelength.  i want to expose this c++ class dll to another program, not my own.

Let me sum up what Swig does, from my understanding, and this might explain better why I was so surprised.

Swing basicaly does TWO things.

1) it creats a simplified front end to call C++ class methods, and functions that accept references and pointers.
In other words, it takes a C++ interface and makes a plain C interface that doesnt use any c++ class objects, and stuff.  So it provides a wrapper interface to functions that need objects and makes them callable in a language neutral way.

2) it creates EXTRA helper code, to make it EASIER to interface this DLL from another language.

All I really was interested in is part 1, without the extra stuff stuck in their for language specific stuff.  Swig has no such thing, which is silly, so i basically build for csharp and remove extra stuff i dont need.
30230
well the issue isnt so much what its written in, since it is actually in c++.  The actual main DLL code is in c++.

the question is just who has to write 50 helper functions for EXPORT that can be called using a c api instead of the normal member functions to access a class.  That is, the main code uses classes - but i need to be able to call it from a client that knows nothing of classes.

the exported functions have to use that proxy method above in order to be called from a non-c++ client program (or even a client using a different c++ compiler).

i could actually have written manually the c style wrapper exported functions but i wanted to use SWIG to do it for me.
30231
I can see how what i said wasn't all that clear.
What I meant was that I have some classes with member functions that I wasn to expose as a standard DLL.
Because class datatypes are not safe accross languages, the solution is to basically create functions for creating objects and returning void* to them, and then creating new "proxy" functions that are called and passed the pointer to the function to work on.

Essentially this is what Swig does already.  It converts class member functions to global exported functions in a DLL that each have an additional variable that takes an object pointer to operate one.

so where in C++ you would do:

Cat* mycat = new Cat();
mycat.feed();

The wrapped C DLL would look like:

void *mycat = DLL->Cat_new();
DLL->Cat_feed(mycat);

Basically I can use Swig to create these wrapper/proxy classes by selecting a target language like C# and throwing away most of what gets produced, and changing some names and stuff, but it's confusing to me that no one has written a standard C DLL output emitter for Swig.  more than confusing.
30232
General Software Discussion / Re: good software review site
« Last post by mouser on August 12, 2006, 06:22 AM »
Yes - but they only compare software to buy, no freeware


yeah that's a bit suspicious.

Easy - to get better Google results.
agree, it's probably one of those search engine optimization advert-money things.
30233
i used Swig yesterday to wrap a DLL.
I have to say I was very impressed with it for the most part,
and at the same time terribly dissappointed at the lack of some mappings.

for example, if you look at their newsgroups youll see a bunch of people saying "hey can you use Swig to wrap c++ code for use in a c api" or ".. for a delphi api" or ".. for a vb.net api" and the response is usually "people have been asking for this for a year fairly regularly, it would be easy to do but no one has done it."

i may give it a try myself but it's kind of depressing that *the* wrapping tool above all others is missing some targets that would seem to me kinda obvious.  Wrapping c++ code for a plain vanilla c-interface DLL is sort of what i would consider the base case.  I don't understand why it doesn't exist.  It never ocurred to me that it wouldnt.

Of course it's not hard to get around this, by using Swig to output stuff for a dif language and stripping unnesc. stuff, and rewriting some simple stuff on the produced output, but it's annoying.
30234
General Software Discussion / Re: good software review site
« Last post by mouser on August 12, 2006, 05:53 AM »
that is really quite nice..  :up:

ps. in the future please resize images to be a more manageable size :)
30235
Developer's Corner / Scott Hanselman podcast on Open Source
« Last post by mouser on August 12, 2006, 05:51 AM »
Scott Hanselman has a nice blog and podcast.

Here's a recent show all about Open Source:

My twenty-eighth Podcast is up. This episode is about the Open Source Community. This is a pretty open ended talk, as there really isn't an easy solution.

http://www.hanselmin...fault.aspx?showID=38
30236
Developer's Corner / Programmer Meet Designer Website
« Last post by mouser on August 12, 2006, 05:03 AM »
Programmer Meet Designer Website - looks interesting and related to the kind of stuff on DC

This site was created to unite programmers and designers because rarely is a person good at both programming and designing. PMD helps programmers and designers partner up to make websites and web applications that look and work great. It also lets entrepreneurs and writers find people to work with.

How does the site work?
Ok, for example, if you are a programmer looking for a designer to help you with one job, you would create a listing with the appropriate info. Then, designers would come by your listing and if they are interested, they will make an offer. Basically, an offer is them saying "I'd like to do this job". However, they may also have any questions, such as "Do I have to use Photoshop?" or "Can I get paid a little more?". Check your offers once in a while. If you see an offer that you like (i.e. you look at the designers portfolio and you like it), you click "Accept Offer". Then you may choose to trade emails or IM usernames with your partner or use this site for communication.



from lifehacker.com
30237
Find And Run Robot / Re: Google Support
« Last post by mouser on August 12, 2006, 04:53 AM »
you can already do google searching with farr; see the other posts here about using aliases.
30238
Living Room / Shadow Girl Video - cool
« Last post by mouser on August 12, 2006, 04:24 AM »
30239
Living Room / Blog Post: A Pile Driven Life
« Last post by mouser on August 12, 2006, 01:39 AM »
Food for thought:

Have you ever noticed how much of life consists of pile reduction? Tasks where your sole involvement is to take the pile, let's call that N, and make N = 0, where 0 is really 0, nothing... or some state of equilibrium.

http://interimlover....rnal.com/436401.html



from http://www.scottberkun.com/blog/
30240
Developer's Corner / Re: The CADT programming model
« Last post by mouser on August 12, 2006, 12:38 AM »
ha!

what an interesting guy that is who wrote that actually, check out his homepage:
http://www.jwz.org/

Mosaic Netscape
1994-1995 Back before you had heard of Netscape, I was responsible for the Unix versions of Netscape Navigator through release 1.1. 
...
But now I've taken my leave of that whole sick, navel-gazing mess we called the software industry. Now I'm in a more honest line of work: now I sell beer.
Specifically, I own the DNA Lounge nightclub in San Francisco. However, it takes quite a lot of software to keep the place running, because we do audio and video webcasts twenty-four hours a day, and because the club contains a number of anonymous internet kiosks. So all that code is also available.

30241
Official Announcements / Re: COMING SOON: Site tour section w/ screencasts
« Last post by mouser on August 12, 2006, 12:34 AM »
http://tour.donationcoder.com

the page is really shaping up nicely!
30242
Tours and Tutorials / Screencast Tour: Our Exclusive Software Section
« Last post by mouser on August 12, 2006, 12:01 AM »
This screencast shows you around the Software section of our website, which contains exclusive software made by members of DonationCoder.com:

30243
Tours and Tutorials / Screencast Tour: Our Bi-monthly Newsletter
« Last post by mouser on August 11, 2006, 11:57 PM »
A tour of the bi-monthly newsletter, what it looks like and how to change subscription options to receive or not receive it.

All of Josh's tours/tutorials can also be found at http://tour.donationcoder.com

30244
Living Room / Re: Windows unstable? BAH! Read inside
« Last post by mouser on August 11, 2006, 11:29 PM »
hahaha, nice one.  :Thmbsup:
30245
Living Room / Re: OLDIE: Student suspended over use of PHP
« Last post by mouser on August 11, 2006, 11:14 PM »
 ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D
30246
Tours and Tutorials / Screencast Tutorial: Activating Membership after Donating
« Last post by mouser on August 11, 2006, 02:36 PM »
This one covers activating your supporting membership and DonationCredits after you donate.

All of Josh's tours/tutorials can also be found at http://tour.donationcoder.com

30247
Developer's Corner / Re: What's the Best Scripting Language?
« Last post by mouser on August 11, 2006, 02:32 PM »
i'm a very long time c++ coder and squirrel feels alot more like c++ syntax than lua.

this page compares them:
http://wiki.squirrel...paredToSquirrel.html
http://www.gamedev.n...&topic_id=352278

i also was interested very much in being able to sandbox functions and only provide the scripting language to exactly the functions i wanted, and it seems like squirrel is better at that.
30248
Living Room / Re: Smart Rabbit Computer Buddy Gadget
« Last post by mouser on August 11, 2006, 02:25 PM »
for $150 i'll buy a real rabbit and train him to check my email.
30249
Mini-Reviews by Members / Re: Flock: Web2.0 and all that buzz
« Last post by mouser on August 11, 2006, 02:11 PM »
that's pretty sweet.
30250
Living Room / Re: Smart Rabbit Computer Buddy Gadget
« Last post by mouser on August 11, 2006, 01:45 PM »
i guess it would depend on the price and how plaintively he was staring at me in the store.
Pages: prev1 ... 1205 1206 1207 1208 1209 [1210] 1211 1212 1213 1214 1215 ... 1515next