What is the difference between creating a COM instance through CreateObject versus ActiveXObject? - wsh

This has been touched on here in the second answer but I don't see how it answers the question (nor does the link provided).
What can ActiveXObject do that CreateObject cannot, and vice-versa?

Related

DirectX ID3DXAnimationController concept of an 'event'

I'm currently using the ID3DXAnimationController interface, but have for some time not understood what the concept of an 'event' is that the controller seems to reference.
MSDN and other references just seem to state this as some event running on the current track, without really mentioning what this means.
Would anyone be able to explain? (with concrete examples)
An animation event is one of these types D3DXEVENT_TYPE.
Remember that D3DX9 (along with D3DX10 and D3DX11) are deprecated. See MSDN and Living without D3DX

Why is there no Objective C AddressBook Framework for iOS, and how to best tackle the problems with C in Swift?

This might be really generic and rather about the framework in general than a programming question. But, in the light of Swift, and the tedious and sometimes impossible tasks you have interacting with C APIs, that question is very relevant.
When building a new app for iOS, I discovered that you can really have a hard time working with address book framework. First, there is the uncomfortable pointer passing that you have to do for many CoreFoundation Methods. Secondly, the functions mostly return that ugly Unmanaged objects, where you have to figure out if they are retained or not (ARC is several years old now!). Accessing the properties through their identifiers is terribly cumbersome and far from typesafe. And lastly, since there is no C Function Pointer Support yet, you can´t even call ABAddressBookRegisterExternalChangeCallback(addressBook: ABAddressBook!, callback: ABExternalChangeCallback, context: UnsafeMutablePointer<Void>) because the ABExternalChangeCallback is so far only defined in Objective-C!
Then I found that there is some nice Objective-C Api in the Mac OS Version of AddressBookFramework. How unfair! Isn´t the iOS Frameworks younger? Why do you think Apple did this? And when will they change this in your opinion? Did I miss something, and is there an Objective-C Api for iOS, too?
Any suggestions for how to tackle above problems in the most convenient and beautiful way are welcome, too! For my part, I´m writing a complete wrapper to obscure all the nasty pointer- C-Function- and global constants uglyness. As soon as it´s ready I´ll commit it to StackExchange and maybe Github to let others benefit and discuss my solution.
EDIT: finally managed to upload my wrapper to GitHub. See
https://github.com/SocialbitGmbH/SwiftAddressBook
I agree with you about what iOS provides to access to the address book.
I've posted an answer explaining how I handled the problem, using some functional aspects of swift, and how I dealt with extracting unmanaged objects.
Briefly:
I defined a custom operator to allow me chaining function calls to transform some input data
I implemented 2 generic functions to extract unmanaged objects
posted some code to show how I access to the address book, loop through all contacts, and retrieve some data for each one

Objective C - [super dealloc] old? [duplicate]

This question already has an answer here:
Custom dealloc and ARC (Objective-C)
(1 answer)
Closed 9 years ago.
i have a question about objective c. I bought a book about objective c. I am new in objective c and the book include many tutorials about memory management. I have the mac version 10.7.5. So in the tutorial about dealloc, xcode say me "ARC forbids explicit message send of 'dealloc'". So i search this error in many forums. In these forums many people say that [super dealloc] inherits from NSObject is old and the newer version of system make the memory management automatically. The book comes out 2011.
I hope everyone understand me.
Thank you in advance.
There is a new(ish) system for iOS called ARC which automatically sends release/retain/dealloc etc. messages to your objects. You may read more about it here.
The important thing to note when answering your question is that ARC is optional. You may use it, but you do not have to. (When creating a new XCode project, you either tick the "enable automatic reference counting" button, or you don't.)
So, to answer your question: if you are using ARC in your project, yes, dealloc is no longer necessary. If you're not using ARC, you will still need to manage your own memory. It depends on how you're setting up your project.

Erlang bindings for CUDA or OpenCL

I have found this post on Erlang and CUDA, it is rather old so I would like to learn if something has changed since this question was posted. I would like to know if there is any implementation of CUDA/OPENCL bindings for Erlang?
In general, I investigate if it is possible to scale ERLANG program vertically to GPU using CUDA/OPENCL to process a data stream.
OpenCL is here: https://github.com/tonyrog/cl
(You should use the nif branch if that isn't merged to master yet)
I'd wait for this talk http://erlang-factory.com/conference/SFBay2011/speakers/KevinSmith (they will upload video & slides after the conference)
I gave the talk Yurii mentioned and I'm not sure when the videos will be available. The code I demoed is available here: http://github.com/kevsmith/pteracuda. It's minimal but should illustrate what's possible with CUDA and NIFs. I'm hoping to improve it further once my machine arrives back home from SF.
You should also look at https://github.com/vascokk/NumEr
I've been using bit from both this project and Smith's project.

TAnimate in Windows XP/Vista with themes enabled won't work [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
A coworker has been using a custom AVI to indicate progress during some longer operations for years. It's always worked fine.
Recently he decided to move from Delphi 7 to Delphi 2007, in part to get theme support for his applications. (We've finally got most people, but not all, running on XP.) The animation stopped working. Disabling themes makes it work again.
TAnimate is a wrapper around the Windows Animation Control, created using InitCommonControlsEx(ICC_ANIMATE_CLASS). The MSDN documentation says that "If you are using ComCtl32.dll version 6 the thread is not supported, therefore make sure that your application does not block the UI or the animation will not occur." Obviously, this is the intended behavior.
Does anyone have a suggestion for a workaround or alternative to this problem? The processing he's trying to show progress for doesn't lend itself well to spawning a separate thread, and for obvious reasons Application.ProcessMessages is not a good solution either.
EDIT: I'm awarding Rob Kennedy the correct answer to this question, because a) he provided the "missing link" (pun intended) to Raymond Chen's blog post on this topic, and b) because of course moving things to a separate thread was the proper answer.
The ironic thing here: The operation he was conducting that blocked the TAnimate was an indexing operation for a database engine we use (Advantage Database Server, or ADS). He didn't mention that when he came to me with the problem.
ADS supports a progress callback using the TAdsDataSet.AdsRegisterCallbackFunction and TAdsDataSet.AdsClearCallbackFunction methods. The callback function is provided both the progress (in percent) of the current operation and a way to cancel the operation by means of the function's return value. So the entire question turns out to be moot; the callback function can be used to update a progress bar, which indicates to the user that the app isn't hung.
Raymond Chen has written about this. He doesn't even touch on what I usually think of as the primary reason that a threaded control wouldn't work well, which is that a thread shouldn't draw on a window associated with a different thread.
I encourage your co-worker to revisit whatever it was that made him decide that he couldn't put the task into a separate thread. It's simply not a good idea to block the main UI thread, regardless of whether there's an animation control there to cover up the non-responsiveness.
As an alternative to TThreads, you can use AsyncCalls which provides an easier entry point into multi-threaded processing from a functional viewpoint. Still, the best way to handle this would be to perform the long process in the background to keep the application responsive.

Resources