Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049

    Unanswered: APIs, Common Dialog Resources and Help

    Hi All

    I am wanting to understand APIs and Common Dialog class concepts.

    I have used APIs before, by copying and pasting stuff I find on the 'net, but I want to get a better understanding of them. Here's why:

    I have a class module called clsCommonDialog. I'm sure many others would have this too. I look inside and I see code for accessing the colour picking dialog... somehow. I think: "there has to be an easy way to just get the colour picking dialog out of this and use it", however I am unsure how, so I go looking on the net again. I am concerned that I may be making this all too hard for myself.

    Two questions.

    What resources do you use to find API code that gives you this kind of thing?

    Can you help point me in the right direction on where I can go to understand these APIs better?

    Cheers and TIA
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    a possible starting point - it is a little old (2002) but most of it still works fine and its a great seed for your google adventures.

    no need to "get the colour picking dialog out" of the API - you just declare the parts of the API you want: the whole API is going to sit on your disk anyway.

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Thanks Izy, I'll give it a look today.

    BTW, I got the colour picker thingo working, next I'd like to have it open on the screen somewhere besides top left... preferably next to the button that opens it... would be good ^^
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Ken Getz Access Developer's book (advanced) does a very nice job touching on how to use API's and even develop your own. That's how I got started. Especially since the book comes with many existing API calls (which you'll probably notice I use in a lot of my examples in the code bank.) including clsCommonDialog
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Can you help me find the exact book you're referring to there?

    Is this the one?

    http://www.amazon.com/gp/offer-listi...&condition=new
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Are you able to write API calls now Paul? The most I've done is taken existing and tweaked them. If I can't find what I need via Google my general feeling is the return is unlikely to be proportional to the investment.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I've written a couple (very simple ones) many years ago but they were such a pain in the butt to write so like you pootle, I now just modify existing ones to work as I need them to. You are 100% correct in that they are very time-consuming to write and not really worth the time (other than learning.) If written incorrectly, they can really play havoc on your application and do some serious damage. The biggest pain I found was making sure it works with any version of Windows/office. And as you've said, you can find an API to do almost anything you need it to do via googling so creating new ones would only really be beneficial as a learning tool. I definately wouldn't attempt it on a "live" application. Be careful though as there are some bad API designs out there. I'm leary about using any other ones other than those from Devish or Getz.

    I believe a person called "Devish something" (I can't recall his exact name right now) liked to write good API's and I've used a lot of the ones he wrote without problems.

    As far as the link....

    I "think" this is the one which contains most of the API coding examples: http://www.amazon.com/VBA-Developers...d_rhf_f_t_cs_3

    or

    Maybe it was this one...
    http://www.amazon.com/VBA-Developers...d_bxgy_b_img_a

    (although these might be the same book - I lose track with all the sybex books I have but I'm kind of sure that it was the VBA developers book (2nd edition).

    I can't be certain though as I have these books at home and since I have almost all of the Sybex books, I can't recall which one had the most API examples. Either book you get, you'll most assuredly get some example API's on the cd that comes with the book. The book though doesn't go into a lot of detail on writing API calls but I believe it gave the basics. I'll try to see if I can find which specific book it was which had 1 good chapter on them. Again, I recall seeing only 1 chapter on them so don't expect to fully learn everything with them on 1 chapter. I'll take a look at my collection when I get home in a few weeks.

    As pootle touched on though, the easiest way to write them is to take an existing one and tweak it to fit your needs. I only designed a couple of really basic ones just to see how much I would have to learn (which is pretty extensive) and that I could do something a little more complicated if I wanted to spend the next 6 months writing, testing, re-writing, re-testing, etc...etc...etc....(which I decided is not worth the time investing!)

    Even after writing those couple of simple ones, it still had issues which I ultimately decided not to invest any more time on writing them. Personally ST, I'd maybe just try 1 or 2 very simple ones so you don't invest a lot of time on them and to see what you're getting into. You'll most likely discover that someone else has already written an API to do what you need it to do (or can be tweaked.)
    Last edited by pkstormy; 11-22-08 at 00:07.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •