bpoppa said:
Please excuse my ignorance, I am a noob when it comes to progress. I have gotten a few com objects working, but this one is hurting.
Not at all. I couldn't work it out either - I thought you were just trying to reference non ocx com objects, or weren't aware of the need to register - your 'not registered' comment - and weren't aware of creating a connection to them, but I've just reread your post, and I see you were just having the same problems I have had since. Anyway, here's what I was going to say:
I've spent some considerable time looking at this, as it is new to me too, and I found it an interesting (if exasparating) subject. I've used OCX's and DLLs in the normal way, but not often.
The easy way to reference components, as I'm sure you are aware, is to register them, then drop them on a window.
You can access an automation com object which you can't drop on a window as described in "External Programming Interfaces". The standard example is connecting to Excel, but an example related to your question is as follows:
Code:
DEFINE VARIABLE chWinNTSystemInfo AS COM-HANDLE.
/* create a new WinNTSystemInfo object */
CREATE "WinNTSystemInfo" chWinNTSystemInfo.
/* User details under which the WinNTSystemInfo object is created */
MESSAGE chWinNTSystemInfo:PDC SKIP
chWinNTSystemInfo:DomainName SKIP
chWinNTSystemInfo:ComputerName SKIP
chWinNTSystemInfo:UserName
VIEW-AS ALERT-BOX INFO BUTTONS OK.
/* Clean up */
RELEASE OBJECT chWinNTSystemInfo NO-ERROR.
Unfortunately, I don't know how to reference non-automation objects through the normal methods displayed in the COM object viewer, because an automation instance cannot be created, and this information doesn't seem to be documented in the manuals or the knowledge base. I can conjecture two ways which I won't have time to test - hopefully you can:
1. Use normal, ugly DLL calls (EXTERNAL procedure option).
2. Get a reference to the object through another COM/DLL call first - for instance, ADsGetObject/ADsOpenObject - which might return a COM handle you could then use in the normal way. I don't know if you can do this.
The only other thing I can think of, is that maybe the actives dll is a .Net control, which may explain the lack of access, and the fact it isn’t picked up by Choose Control dialog :
KB P70093
Title: ".Net forms control not shown in 'choose control' dialog"
http://tinyurl.com/8qnma
But in that case, why can you access parts of it but not others?
So for progress programmers more experienced in this area:
COM 101 Questions:
1. Why are some registered dlls selectable by OCX picker in the palette, but not others? Visible interface? Complete automation objects?
2. [Jim's question] How do you reference a non-automation com object from the 4GL (using the object:method syntax shown in the COM viewer, not DLL calls) - ie how do you get a handle to it in the first place? Does what I am asking even make sense, or am I completely missing the point – ie. if it is non-automation you can only use it as a library?
The instance for reference in this particular case is IADsGroup in c:\windows\system32\activeds.dll (activeds.tlb in the COM viewer).