I'm trying to post a technical question and it's being rejected as containing inappropriate material!!!
It relates to using the PI AF UI SDK from VBA.
Traced the problems to one word C-O-M???
For some while I have been building a C-O-M wrapper library of (my) application specific calls to AF properties / methods that I use from Excel. I started from the AFWrapper download
Until today I'd not attempted to make use of any AF UI modules. But times change and I attempt yet greater challenges. So now I have a C-O-M call to display a form containing the
AFDatabasePicker. Well I say it does this but in fact it only works when called from my test harness within Visual Studio, i.e. no need for C-O-M. When I call the method from Excel VBA
(from within a VBA form!) I receive the a runtime error informing me that SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created. Fine, but
this is called in the line before the form is instantiated.
Being a novice in such matters I'm unsure whether the problem arises because I'm attempting to call the database picker form after calling a VBA form or something else. I'm quickly
tried calling my GetAFDatabase method from non-form code and get Automation Error.
I've searched SetCompatibleTextRenderingDefault and while there are comments about its occurence I've yet to find anything that looks an appropriate solution.
So does anyone know how I might solve this problem? It occurs to be that someone somewhere must surely be including AF SDK UI within C-O-M or instantiating controls from VBA in other
ways. After all there is a database picker in the Excel AF Builder C-O-M Add-In.
I've tried writing more and including some screens of the error and my code but it seems that the system thinks I'm attempting to post inappropriate content!!!!
I do not know how to call these managed controls from VBA, but AF Builder is a VSTO add-in for Excel which is able to call .NET managed code directly instead of needing to use a wrapper.
Sorry for a late reply. I am providing it more for future readers. Yes, PI Square has a filter that blocks the C-O-M word. This is a security measure to prevent not-so-nice people from posting links to malicious sites, many which end with DOT C-O-M.
Retrieving data ...