|
The problem is:
How to handle dynamically in a C++ (ATL) CLIENT some
ActiveX control collection properties like in VB ?
(Item, Add, Remove, etc.)
Example:
A control is dynamically created from its ProgID.
COMCTL.ListViewCtrl.1 (common listview control)
We have access to its IUnknown & IDispatch pointers.
Automation approach, using ITypeInfo, TYPEATTR, etc., doesn't
seem to permit a correct access to the ListItems property
(ICollectionXXX like,I think)...
I found a PROPGET/PROPPUT ListItems property but I don't known
how to use them: these two functions take one argument and have
no result...
please help me !
|
|
|
|
|
ATL/WTL are way too cool:
In your header add:
1. #import "C:\WINNT\System32\MSCOMCTL.OCX" no_namespace, named_guids
2. IListViewPtr m_myListView; // new member
3. Access like this:
GetDlgControl(IDC_LISTVIEWCTRL1, __uuidof(IListView), (void**)&m_myListView);
IListItemsPtr IListPtr = m_myListView->GetListItems();
ÿVOTD: 1 "Now faith is being sure of what we hope for and certain of what we do not see."
2 "This is what the ancients were commended for" - Hebrews 11:1-2
|
|
|
|
|
Thanks Ernest
BUT... this is not exactly what I'm looking for...
ProgID is unknown at compile time. We have to read the type library at runtime...
So, is there an #import-like command that would do the job at runtime ?
|
|
|
|
|
Ok... I finally implemented a TLB browser and everything works.
But one strange thing: 'GetListItems' method definition changes !
something like:
in the Type Libray -> ListItems GetListItems( )
ITypeInfo from IDispatch -> GetListItems( arg )
Does somebody know why ?
|
|
|
|
|
Hello guys,
i have made a COM object called IJeremy it has a method called SetMsg which takes an IMessage* as an [in] param.
This object fails to compile - it tells me:
error MIDL2025 : syntax error : expecting a type specification near "IMessage"
What is the best way around to get it to work?
Could i sort of #include the IDL files of IMessage?
Thanks for the help,
Jeremy
Jeremy Pullicino
Professional C++ Developer
Amature COM developer
Done any hacking lately?
|
|
|
|
|
You need to define IMessage in the IDL file!
Jeremy Pullicino wrote:
Could i sort of #include the IDL files of IMessage?
yes, you can #import it!
ÿVOTD: 1 "Now faith is being sure of what we hope for and certain of what we do not see."
2 "This is what the ancients were commended for" - Hebrews 11:1-2
|
|
|
|
|
Hi, I have a Automation COM object which has one property, which is of type long. This works, and now I want to create another property, but not of type long, but of type IDispatch. Basically I want to return another COM object from a property. I've tried setting the property type from the IDL to LPDISPATCH and LPUNKNOWN, but I keep getting errors from VBScript.
Does anyone know how to have a property of type 'IDispatch' in a COM Automation Object?
Thanks,
James Pullicino
Drinking In The Sun
Forgot Password?
|
|
|
|
|
Hi!,
I'm far off a COM guru. I need my app to use the IShellLink interface... I have initialized both com (CoInitialize) and OLE (drag & drop works fine already). I followed the tutor I have and did it like
IShellLink* sl;
res = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&sl);
but this fails... Dunno why, none of the documented return values is returned (there are 3 of them).
Many Thanks for much help!
|
|
|
|
|
What OS are you running on? How are you checking the return value?
Todd Smith
|
|
|
|
|
|
We have an application consisting of any type of component available on the Windows platform :
* MFC ocx and dll,
* ATL DLL and EXE servers,
* some VB stuff and
* a MFC startup application.
Using the debug heap from Microsoft we have already found new/delete mem-leaks, but we have currently no choise to find those COM memory leaks.
I have began working on an IMallocSpy implementation to be registered in COM to show the amount of open leaks, but what I don't understand is how I could implement that kind of stuff to display the C-Class-Name, FunctionName and LineNumber where that open memory block will be allocated.
I tried to use the compiler macros __FILE__ and __LINE__ in my IMallocSpy implementation, but that shows - of course - the filename and the line of my IMallocSpy file....
Could somebody help me out ?!
Best regards
Andi
|
|
|
|
|
Take a look at Compuware DevPartner (www.compuware.com[^]). This product contains error detection tools formerly known as BoundsChecker. It's not cheap, but it's worth every penny.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
If you're in a war, instead of throwing a hand grenade at the enemy, throw one of those small pumpkins. Maybe it'll make everyone think how stupid war is, and while they are thinking, you can throw a real grenade at them.
Jack Handey, Deep Thoughts
|
|
|
|
|
Hi, I'm very new to ActiveX and I have just made an ActiveX version of Chris Maunder's CGridCtrl. I am having terrible problems with memory leaks when my application terminates. Has anybody else tried to make an ActiveX version of this class? I've made sure that DestroyWindow() is called in the ActiveX portion.
Is there anything obvious anyone can think of without looking at the code?
Many thanks,
Alan Dugdall
|
|
|
|
|
I have written an ActiveX control (full control) using the MFC AppWizard. I have a property page for it too. I have created a dialog-based app to try this control.
When I change the value of the property using the property page I created (from inside the VC++ dialog editor), the change is not getting reflected in the control. But I get the expected result when I change it in the "All" tab.
I think I have missed out something while creating the control.
My question:
How do I make the value in the property page for a particular property and the same property's value in the "All" tab in VC++ dialog editor tally?
Thanks!
Logic is a systematic method of coming to the wrong conclusion with
confidence.
|
|
|
|
|
how to register a com?
how to unregister the coms that are currently register?
what is the difference between com and com+?
r00d0034@yahoo.com
|
|
|
|
|
If it is a COM dll or OCX, you'll need to use RegSvr32.
If it is a COM Exe then the usual way nameof.exe /RegServer
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
Each time I do a Form or Dialog project I'm surprised that Visual Studio resource editor offers so few features.
For example I would like to be able to resize a control to an exact size or to position it on the window at a precise offset. Well all this is only possible when editing manually the .rc file.
I know that .Net now offers a new kind of UI editing with the Forms but this is only dedicated to .Net technology and runtime - and my need is for C++, just C++.
So, is there somewhere such an editor or do you feel the need of such an editor ?
Yarp
http://www.senosoft.com/
|
|
|
|
|
I have an ATL COM object which generates events using Connection Points, can I receive the events in VBScript?
Sonork 100.15206;PavelK
|
|
|
|
|
See following thread:
"VBScript and COM Inf. with ByRef"
Marco
|
|
|
|
|
I'm just starting with COM and DCOM
I want to develop a program with two parts 1° A controller, 2° a GUI.
The GUI sends commands to the controller and displays info from the controller.
Several persons will use several copys of the same program.
Sometimes maybe I will need access to the controller of another user, running in a remote machine.
I want to have remote access to the controller, I was thinking about to communicate the GUI with the controller using DCOM.
The keypoint is: I dont want two programs "GUI client" and "Controller server", I want the GUI and the controller running on the same program, with the GUI able to switch to a remote controller.
I was trying a very "easy" example:
A MFC Dialog base GUI with two buttons A and B, and a text box.
The GUI tells the controller which button was pressed.
The GUI asks the controller what to display in the text box (what button)
I've got confused with DCOM, I could't write this program.
All the examples I found in the net use two different programs for the server and the client.
Could anyone help me with the general design/structure ?
Could I find a similar example somewhere ?
Is better use CORBA for this approache ?
Thanks a lot
|
|
|
|
|
u mean like the Microsoft Terminal server and Clients like architecture..????????
Renjith-CPian.
|
|
|
|
|
Yes but not so complex, I don't want multiple-sessions control, central server and so on...
Just your GUI able to switch to another running program to have a look what is going on there.
To start with an easy example I would like to:
1° Create a MFC Dialog based project -> OK
2° Add some buttons and text-dialogs -> OK
3° Create a new class called CController -> OK
4° Add ATL/COM support (new ATL object) -> OK
5° Use the COM object between the Dialog and the controller -> FAIL !!!
GUI <---> DCOM <---> CONTROLLER
I am not sure what declarations a need, how to connect the dialog with the interface...
I saw in "Add->new ATL object" there is an object called "dialog", maybe this is the way.
Thanks for reading !
|
|
|
|
|
do you want the Dialog Support for your ATL COM?
WUSIWUG
|
|
|
|
|
please provide the link of different comprehancive examples of com and com+
and a little help how to run it?
r00d0034@yahoo.com
|
|
|
|
|
Get some books to read first, then write some simple code
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|