October 12, 2007
@ 07:56 PM

We had our monthly FoxPro user group meeting last night, and, like always, there were some cool new things shown and talked about that I’ve now got to play with. Cathy Pountney was kind enough to drive over from the Grand Rapids area to do a session on extending VFP 9’s report writer through extensions and hooking into the generation process with listeners. She demo’d some code which added a new print dialog box which allowed the user to pick/configure the printer before printing, being able to print a document range (ex. 1-10, 11), “Print to Fit” which resizes a report to fit on 1 page, duplex printing, booklet printing, and being able to print multiple pages per sheet of paper. Really cool stuff. She’ll be giving this same presentation at Southwest Fox next week, so if you’re planning on going, don’t miss this session.

One of the “hey, I didn’t know about that command” that came up was SYS(2600). This command lets you pass in a integer (pointer) and then returns the memory pointed to by the pointer as a string. It can also write data into the memory point. This is pretty slick since it allows you to easily interface with win32 API calls that require you to pass in pointers to structures, or use API calls that return pointers to structures. By setting/getting this memory as a string, you can then easily parse apart the structure to get the data back.

To be able to do anything useful with this, you’re also going to need the ability to allocate/de-allocate some memory (and get a pointer to it). The easiest way to do this is through a few API calls:

#DEFINE GMEM_ZEROINIT     0x40    && Init memory contents to zero

DECLARE INTEGER GlobalAlloc IN kernel32.dll ;
        INTEGER wFlags, ;
        INTEGER dwBytes       

DECLARE INTEGER GlobalFree IN kernel32.dll ;
        INTEGER hMem 

lnPointer = GlobalAlloc(GMEM_ZEROINIT, 110)

?lnPointer

IF lnPointer > 0

   * You should see a a bunch of squares (nulls)

   ?SYS(2600, lnPointer, 110)
   SYS(2600, lnPointer, 100, REPLICATE("X", 100))

   * Now you should see 100 X's followed by 10 nulls

   ?SYS(2600, lnPointer, 110) 

   GlobalFree(lnPointer)

ENDIF          

A side note: You may see some apps use LocalAlloc/LocalFree instead of GlobalAlloc/GlobalFree. They are essentially the same thing at this point (that is, there isn’t any difference between the two of them). This is one of those “backwards compatibility” things. If you want to know more: http://msdn2.microsoft.com/en-us/library/ms810603.aspx

There were a couple of other cool utilities/products that came up as well that I’ll be trying out/writing about.


 
Categories: VFP

  I was doing some searching the other day for pricing on MSDN Professional vs MSDN Premium editions, comparing what was included, etc. Pro seemed to be around $1000 vs upwards of $2000 for Premium (depending on the specific version picked). Here's a comparision of the differences. For me, I was really hoping to be able to get Vista, Outlook, and things like Expression. Unfortunately, those are only available with the Premium edition. $1000 was doable, but there was no way I was going to spend $2K on software (it's still not a bad deal, all things considered). I could get the Pro version and just buy what I wanted, but that still pushed the price up to the Premium edition range.

I remember running across some great deals for the MSDN Universal subscription a few years ago on E-bay, so I thought I'd poke around there to see if there was something similar for the Premium edition. I ran across an ad for the Premium version for around $950. "Not bad" I thought, then started looking at the description to make sure it wasn't the Educational version or anything weird. Part of the way down I read some of the requirements: I needed to agree to develop a commercial software app., place a product announcement on my website, make a best effort to pass one of the MS software tests.

Hey! That suddenly started sounding really familiar. Yep, those end up being the same requirements for Microsoft's Empower program. That you can get directly from Microsoft. For $375.

Yep, these guys are really just signing you up for the Empower program for a mere $525 more (handling charge, I guess). Un-Effing believable.


 
Categories: Software

October 11, 2007
@ 01:20 AM

Do you remember the show "Connections" with James Burke? It used to be on TLC at some point (according to the linked Wikipedia article, 1997). It was a show about seemingly unrelated things that were all connected. For example, how a Polish dirt farmer in 1743 stubbed his toe on a sharp rock, which led to a nasty infection, which led to someone creating the Pierogi, which led to the German's bombing Pearl Harbor*, which led to the Ironman Triathlon. Or something like that. Anyway, I really thought it was a cool show and it seems software development (and I.T. in general) follow the same sorts of patterns.

Take this blog for example. A set of seemingly disconnected events** led me to it. People have been blogging for years now. I'm a Johnny-come-lately to the game. Why? And why now? For me, it started with e-mail sites like Hotmail being blocked at work...

(for those that don't get the historical set of connections example, take web surfing as another example. How many times have you started searching for some Javascript code only to find yourself 3 hours later at some Japanese midget porn site. That happens at least once a week for me).

* Yes, I know the German's didn't bomb Pearl Harbor. Everyone knows it was the Swedes.

** I reserve the right to jump around a lot. And I'll try to eventually get around to tying everything together. Either that or get bored with the whole thing and stop. Definitely one or the other.


 
Categories: Other

October 8, 2007
@ 09:10 PM

Just a test to see how things look. And check to see if they work. There are still a few issues to iron out, but it's mostly functional.


 
Categories: