IT-Consultant: Frederick J. Harris > Time For 64 Bit COM!

Begin Conversion Of PowerBASIC x86 ActiveX Grid To C++ x64

<< < (2/2)

Frederick J. Harris:
Well, maybe I do need more practice, so the educational value isn’t to be discounted.  It took me awhile to put this together, even though I’ve done it all before.  So I think I benefited from the practice! 

COM is involved I would say, and I was somewhat daunted by the issue of doing everything in x64.  I’ve simply not done much x64 and I really had no idea how switching to x64 Operating systems would affect everything having to do with COM.  Much to my surprise I’ve found everything – at least what I’ve done so far – works just like 32 bit.  So having reviewed the fundamentals at this low a level as I did with x64 was a good idea I think for me.  So far I’m amazed at how well Microsoft has made everything with x64 work out. 

I’m somewhat familiar with ATL and I’ve made a few learning type projects with it.  Its also impressive in terms of how Microsoft set it up to reduce code bloat.  I’ve no better reason for not using it other than my simply not liking it.  I prefer to figure out things myself and understand how they work rather than relying on auto-generated code.  I think at base its because I like to be somewhat self reliant, and having started with coding before the internet was much of a part of the picture, I’ve never proceeded with the idea in mind that if I’d get bad stuck, all I’d have to do is shoot out a question on some coding forum and piles of folks would jump in and attempt to solve my problems for me – hence the need to fully understand the basics.  So I don’t like to get too far ahead of myself. 

Then too I’m no friend of templates.  I’m sure you’ve run into C coders like me who’ve made off with what they wanted from C++ (classes, reference parameters) and left the rest (templates, endless arguments about object design and class inheritance hierarchies).   

I realize it was Microsoft’s idea that everybody would use ATL to build COM components, simply because so much of the underlying COM infrastructure code was both boilerplate and complex.  So C++ had ATL and Visual Basic had what it had – ActiveX Control visual designers and so forth.  But none of that helped us much with PowerBASIC.  If you wanted to build ActiveX Controls with PowerBASIC you pretty much had to start from scratch and fully understand everything to the point of building Vtables in memory, so on and so forth.  Actually, that was my main interest in ATL – to reverse engineer the auto-generated code so to speak,  so I could see what it did.  The reason for this was because there was little to no documentation out there on building ActiveX Controls in the raw, the way it would have to be done in PowerBASIC, or C for that matter without ATL.  And you know, now that I think of it, those internet articles by Jeff Glatt – I’m sure you remember them “COM In Plain C” …

… were really, really popular.  A lot of C++ coders I believe were somewhat fed up with the various ‘text substitution engines’, ATL, MFC, etc., coming out of Microsoft, and just wanted to know how stuff worked.

But I’m not above saving a little time.  Because so much of the COM infrastructure code is so boilerplate, only a little modification and addition to what I have posted above – a simple window and some logic to call back into an event sink in the server, and I’ll have a pretty good control template of my own for future use.    And you know, that isn't a whole lot different from how a lot of us SDK coders operate with our many years collections of various template code.

James C. Fuller:
My reason for following Fred's work is I use Visual Studio Express 2013 and there is no ATL/MFC so bare to the metal is the only way to go.


Frederick J. Harris:
If you are following the code James I'd appreciate if you would let me know of any issues you run into with the newer compilers.  I had thought of doing what you are doing, that is, installing the latest SDK, since I'm doing command line compiling anyway so Visual Studio's fancy wizards aren't helping me anyway!  But I paid $550 for it a few years back (pretty much for my Windows CE data collector work - which didn't pan out.  I hated Windows Mobile, like just about everyone else, and reverted to Windows CE.  And I had free tools for that work (Microsoft's eMbedded Visual C++ 4.0)).   

The other thing is, I'd actually prefer to use GNU, but that rotten problem I had years ago with not being able to figure out how to export DllGetClassObject() so that Microsoft's COM Service Control Manager ( SCUM ) could read it - well, that still has me stumped.  Maybe that would be something you might want to look into someday because I know you like to use the GNU tools.   And I hate like the dickens to admit defeat.  But that defeated me no ifs ands or buts.  I lost weeks on that.  And I know it can be done.  I just can't figure out how to do it. 

James C. Fuller:
  A week or so ago I went back to old COM code that I thought I had working based on your original com project.
I beat on it awhile but other things took precedence. I hope to get back to it but I got a bit burned out on it the first time around.

Your code here is a bit beyond what I want to do. I have no need for an ActiveX grid so I lack your motivation.
I'm just hoping I can gain a bit of insight into 64bit COM from your work.


[0] Message Index

[*] Previous page

Go to full version