|
Hi again Rob, I hope you don't mind me asking you this directly rather than first posting my question, but...
The IHTMLEditDesign doesn't fire events....that I kind of understand I think...As far as I can tell (now that i've read a little more on the subject) It doesn't have support for IConnectionPoint for outgoing sinks either. Thats why an IHTMLEditDesign requires an edit designer to be a COM object and instead of using sinks you notify the IHTMLEditDesign of a designers existence using AddDesigner() and remove designer so you can dynamically add or remove addon functionality from any IWebBrowser2 ...like if you used a sink you would use the Advise() function instead?
Am I correct in thinking this way?
The single example from MSDN i've been playing with had me confused for a while because I believe (inless I seen or understood wrong) it registers itself/application as a COM server...and the code snippet you provided previosuly doesn't suggest this is nessecary...
Thanks alot
How do I print my voice mail?
|
|
|
|
|
It's the other way around. You create an IHTMLEditDesigner object somehow (it need not be a COM object in the sense of being createable via CoCreateInstance ). You then notify the document object (via the AddDesigner() method) that it should pass editor events to your object. It's just a souped up way of setting a callback.
In my code I implemented the designer as a c++ class derived from IHTMLEditDesigner because those are the rules (AddDesigner() wants to see something derived from IHTMLEditDesigner ). But the instance of the class that I pass to the document object (incidentally I use IHTMLDocument2 rather than IWebBrowser2 ) is statically created as a member variable in my view class.
For what it's worth, I think the MSDN samples are needlessly complex.
Rob Manderson
Colin Davies wrote: I'm sure Americans could use more of it, and thus reduce the world supply faster. This of course would be good, because the faster we run out globally, the less chance of pollution there will be. (Talking about the price of petrol) The Soapbox, March 5 2004
|
|
|
|
|
Hi all
This whole day i suffer to catch bug in my program and still
hadn't solution.
I had some method which turn out array of bytes in VARIANT
VARIANT GetVTFromByteArray(LPBYTE pBuf,long bufSize)
{
/*
First i create SAFEARRAY and sometimes it failed (not all time )
*/
SAFEARRAY* pSA = NULL;
SAFEARRAYBOUND saBound = {bufSize,0};
pSA = SafeArrayCreate(VT_UI1,1,&saBound);
ASSERT(pSA);
//pSA return not NULL ;go forth
long z;
HRESULT hr = SafeArrayGetUBound(pSA,1,&z);
/*
String above its just a test whats all fine BUT
this routine sometime return mee 0x80070057 'The parameter not incorect' what very weired to me.
Anytime this workout fine its weired too much .
*/
....
....
}
Where trouble here???Please give me opinion if you got one.
Thanks a lot.
|
|
|
|
|
I am working with an InProc OLE Server that was created in Visual C++ v6.0 with the ATL COM Appwizard.
I created a new Composite Control and simply tried to add the MSFlexGrid ActiveX control. The Flex Grid is added and displays fine when the Composite Control is instantiated through the ActiveX Control Test Container (or other application).
The problem comes when trying to access the members of the Flex Grid. The CWnd::InvokeHelper method ASSERTs at the following line:
ASSERT(m_pCtrlSite != NULL); // not an OLE control (not yet, at least)
Here's the body of the InitInstance method of my DLLs App class:
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState());<br />
AfxEnableControlContainer();<br />
_Module.Init(ObjectMap, m_hInstance, &LIBID_TESTCOMASCONTAINERLib);<br />
return CWinApp::InitInstance();<br />
}<br />
Here's the body of the Composite Control's Message Handler for WM_INITDIALOG:
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState());<br />
m_wThis.Attach(*m_phWndCD);<br />
m_ctlFlexGrid.SubclassDlgItem(IDC_MSFLEXGRID1, &m_wThis);<br />
<br />
m_ctlFlexGrid.SetRows(5);<br />
<br />
return 0;<br />
}<br />
The SetRows method is what calls InvokeHelper. According to the MSDN documentation (e.g "...These types of controls are called composite controls because they are able to host other controls (native Windows controls and ActiveX controls)....") a composite control should be able to contain an ActiveX control.
What am I missing here? Do I need an additional AfxEnableControlContainer() call somewhere in my Composite Control's implementation? Do I simply have the style settings wrong in the Dialog Resource?
Any help or guidance is appreciated... Thanks.
|
|
|
|
|
I'm developing an ActiveX component, which is used on web pages. When user enters a page page, the ActiveX is loaded and when the user moves to another page, the activeX component terminates.
However when user goes to another page, I must be able to transfer some data from the current instance of the ActiveX component to the next instance of it.
I'm currently using cookies for this, but that is not a good solution for various reasons. What other ways are there to transfer the data? Is there some windows interface (servic) which I can use to temporarly store data, so that the data can then later be picked up by another ActiveX instance.
|
|
|
|
|
Why can't you use local file? Temporary folder maybe good place...
You can also overload OnFinalRelease or add extra LoadLibrary, so instance of your control or module will continue to stay in memory, even after IE Document Releases it...
Also, as I recall CoFreeUnusedLibraries implemented by MSFT has a delay unload time of about 10 minutes -- so you can just use that -- your module stays in memory for 10 minutes, even after last instance of your control is realeased. So, you can use that by storing shared data as a static data or member of CWinApp class...
Also, you can implement your own DllCanUnloadNow(void) -- just return S_FALSE -- that will guarantee that your module will stay in memory forever...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
The static member idea seems like a good choice (tested, and seems to work). I'll still have to test the other ideas.
But, thank you...
|
|
|
|
|
i tried by typing comtool in matlab command window, but the matlab com builder window did not appear. the version of matlab which i m using is 5.3. can someone help me about this problem.
bhavsar vishal
pgdem, be
iiem-india
|
|
|
|
|
Hi there,
I have created a COM component using C++ which is already installed on my system and is being used by few applications.
I want to know what issues i'll have to consider if I wish to have this same DLL with a different name on my system.
I mean if I rename this DLL and install it , apart from changing the CLSID , ProgId what all things I'll need to change in this DLL if I wish to have both my DLL's to be registered on my system.
Any thoughts?
Thank You.
Have a nice day!
modified 21-Apr-21 21:01pm.
|
|
|
|
|
If you want side-by-side, then you need to regenerate all the UUIDs in the IDL file, change the progids and interface names (don't forget the information in the RGS file).
Why would you want both?
If you want to change behaviour, just add a new interface that derives from the old one (for backward compatibility, and the fact that interfaces are considered immutable once 'published').
Steve S
|
|
|
|
|
Thanx.
Actually I am a new to COM technology... by this question I wanted to get some of my doubts clear.
I totally agree with what you said regarding "change behaviour".
Now I think i got to know what i wanted.
Actually had thought about what u said but wanted to confirm from someone more experienced and am now satisfied after your answer.
Thank you once again.
Have a nice day!
modified 21-Apr-21 21:01pm.
|
|
|
|
|
hi,
I have a COM in VB. How do I use it in C++
thanks
|
|
|
|
|
You can use the Class Wizzard and import from a Type Library. This should generate the appropriate classes for you in C++ that will inherit from COleDispatchDriver . You will need to make sure you call CreateDispatch when you create an instance of the object in C++. Check MSDN for more details.
- Nick Parker My Blog | My Articles
|
|
|
|
|
hi!
I have developed a DCOM component server with ATL but now, how can i registeter it on a client?
Thanks in advance.
|
|
|
|
|
hi!
I know yet how to register the DLL. If there is somebody with this problem this is a very little tuto:
On the server machine
1.- register the server program:
c:\> remoteServer -regserver
where remoteServer is the name of the EXE server.
2.- register the proxy/stub DLL:
c:\> REGSVR32 remoteServerps.dll
On the cliente machine
1.- Copy RemoteServerps.dll on the client machine
2.- Register the proxy/stub DLL:
c:\> REGSVR32 remoteServerps.dll
ok, with these steps my DCOM application runs ok but i'm not sure if is this the best way to do the registration. Are there any other possibilities ?
thank you in advance!!
|
|
|
|
|
Hi
1.Register your component under the component services (MTS)
2.Use the export operation in order to create proxy\stub setup file
3.Install the file in the client machine
|
|
|
|
|
Hello !!
I want to convert an object I designed as a custom control in Visual C++ in a ActiveX version. This object is a chart that can display high speed data.
I succesfully converted the control but the problem is for adding new points: I don't want to redraw the complete control (this takes toooooo much time) so I want to get the dc of the control, use a transparent background and plot the line (or point). But this doesn't work if I call the COleControl::GetDC member function (default parameters).
How can I get a dc whenver I want ?? (so, not when OnDraw is called).
And if someaone could send me some example of ActiveX controls this would be great: this is the first time I design ActiveX and this project is REALLY urgent
Thanks a lot for any help (any clue, hints, ... are really welcome )
|
|
|
|
|
Ok !
I've found the solution !
In fact, I added a Method to add these points and I tested the control in the ActiveX control test container. I was invoking the method inside the application. But this seems to work differently... Don't know why
For example if I call this inside my control on a mouse down message,everything works fine...
Why ????
|
|
|
|
|
I'm considering building an MMC (Microsoft Management Console) snap-in. The only information I've found for doing so is the Feb 2003 Platform SDK, where the C++ examples are still from VS6. The VB6 designer for MMC is long gone, and the ATL wizard for MMC was removed from VS.NET (I've heard rumors it was buggy). Which leaves me with the old guts and glory style of raw C++ COM programming. Given the examples in the SDK, that kind of adventure is OK provided there's a real future for MMC.
Does anybody know if Longhorn will still use MMC? Will ATL get a new MMC wizard in Whidbey? Any rumors from Microsoft? Are there any good newsgroups for MMC?
Any hints will help me here - Thanks,
Richard
|
|
|
|
|
It's still in the PDC build of "Longhorn". I doubt Microsoft would abandon it yet, though. It still serves a good purpose and uses the ubiquitous tree that everyone loves.
I know they recently acquired a new project for remote server maintenance, but this doesn't seem to overlap with problems solved with MMC.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How would I go about converting a dragged stream object, into a dropped file object? The stream would be a stream of bytes dropped into the windows shell (explorer / desktop etc).
I get the impression I would need to implement my own DataObject that implements IDataObject, and load it with the appropriate STGMEDIUM and FORMATETC structs representing a stream.
Then, when dropped, a new file object needs to be created exposing some storage interface (IPersistStorage, or IStorage?), and then this needs to be given the IStream interface of the stream that is being dropped into it. Following that, i'm assuming windows shell can handle it.
How close am I?
(Note: The drop source is a wrapped managed C# interface, i can create a new stream object implementing the IStream interface, and read in my serialized bytes to it. The problem above is where i go from there.)
Cheers
Cata
|
|
|
|
|
Again, you're making this much too hard. The implementation of the IDataObject is nothing more than a way to encapsulate all the information about an object being dragged (or copied to the clipboard).
The STGMEDIUM and FORMATETC structs describe how the data is contained, and what the data is, respectively. You provide either an IStorage (not IPropertyStorage , which is very different) or an IStream implementation in the STGMEDIUM , as well as setting the tymed field to the associated enum type. Set the clipboard format in the FORMATETC struct. Pack your data and these structs into your IDataObject implementation and call DoDragDrop with that, your IDataSource implementation (which you can easily create from a .NET
Control</cod> since I know that's what you're after), also specifying your allowed effects.<br />
<br />
When a possible drop target gets the drag over event, it looks at the <codE>FORMATETC and allowed effects to see whether or not it can except it. It may also look at the STGMEDIUM to see if it can accept data passed along in those formats (the shell should handle all of them just fine). It then alerts the drag that it can accept them. If a user drops the data, the drop target gets the storage object from STGMEDIUM and handles it appropriately. If it's a filename, it would copy, move, or link them (depending on the effects). If it was an IStream implementation, it would get information about the stream and Read till done. If it was locked in global memory it copies it out and frees the global memory. So on, so forth.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello ! I use the MFC ActiveX ControlWizzard
I'm really new to ActiveX development. I want to know if it is possible to have another ActiveX in the current ActiveX I'm developping (like a class member of the Ctrl class) ? If yes, how (and when) do I have to create the control ???
I'm a little bit lost
And by the way, if you have some links to good tutorials, they are welcome !
Thanks!
|
|
|
|
|
Yes use the composite controls.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Thanks for the response...
Hum, sorry but can you be more specific ?? I'm really new to this and I really don't know what is composite controls...
Thanks
|
|
|
|