|
|
From MSDN (The following in BOLD is what i told in my earlier post, there is certain way you should follow to get access to some interfaces. The following is an example) -
IMarkupServices
Having understood the fundamental concepts of Markup Services, you now are ready to take a closer look at Markup Services interfaces. The best place to start is the IMarkupServices interface. This interface is the starting point for all the MarkupServices, such as IMarkupContainer and IMarkupPointer. The IMarkupServices interface also contains all the methods for performing actual manipulations of elements of the document.
You can perform a QueryInterface operation on a document object for IID_IMarkupServices to obtain IMarkupServices.
On MSDN, read in Overview and Tutorial about IMarkupServices
I hope this helps.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks Sohail,
I _think_ Windows 2000 (with VC++ 6.0) is missing the Registry entries. I have tried the following SDK:
- March 2006 (Lirary Corrupt - Rollback per Fix)
- 1998 or 1999 (VC++ 6.0/MSDN CD)
- October 2002
- February 2003
I am fresh, so I am going to pursue it now.
Jeff
|
|
|
|
|
Hi Sohail,
Thanks. The problem was resolved with the following:
hr = CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
Sohail Kadiwala wrote: On MSDN, read in Overview and Tutorial about IMarkupServices
Been there, done that. I still don't have a 'big picture' due to the following:
- Micosoft's inability to implement a descent Search Engine
- Microsoft's MSDN is 'fractured' - it does not present a big picture
Jeff
|
|
|
|
|
Cool. But if I am not wrong, Coinitialize(NULL) internally calls CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
So If it would have been COINIT_MULTITHREADED, I would think that this solved your problem. Just for curiosity, did you do any other changes?
Yes, Agreed, MSDN search engine is not very good. I always do a Google search with "MSDN" keyword added extra to my search keywords
For many things, MSDN doesn't have enough information. At times, I have experienced that the API or interface or method descriptions and details are not enough
Finally, I am glad that your problem is solved. But I am now interested to read more on the interfaces you are using. I may read about it in MSDN in my spare time.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi Sohail,
Sohail Kadiwala wrote: Coinitialize(NULL) internally calls CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
Correct. However, F11 did not step into the code, so I was being lazy and did not go out on the web and research it... I found it interesting COINIT_MULTITHREADED did not fail immediately (for example, at the first attempt to grab a MSHTML interface).
Sohail Kadiwala wrote: But I am now interested to read more on the interfaces you are using.
I have 3 Samples together now. They are part or a larger project. However, I plan to write an article on HTML Parsing from a Console Application (a few are out there already, but the articles are bare bones and very little is explained).
If you'd like, you can have the source code now. I'd need an email address. Thanks for the comments - lot's of 5's added People who respond should be rewarded.
Jeff
|
|
|
|
|
Thanks for the 5's. People here long for 5's
Well, I would like to have the source code and go through it. But if you are in midst of writing an article, then I would wait. Just notify me when you publish your article.
For any further contacts, my email id is - sohail.kadiwala@gmail.com
Take care.
Happy Holidays
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
No registry entries for:
'IMarkupServices' or '3050f4a0-98b5-11cf-bb82-00aa00bdce0b' (string literal searches, not case sensitive)
I'll try the October 2003 SDK when I finish getting it down.
Jeff
|
|
|
|
|
Hi Sohail,
I haven't tried the IHTMLLocation Interface yet, but the IMarkupServices was resolved by replacing the call to CoInitializeEx() with CoInitialize().
Jeff
|
|
|
|
|
I haven't tried the IHTMLLocation Interface yet, but the IMarkupServices was resolved by replacing the call to CoInitializeEx() with CoInitialize().
Jeff
|
|
|
|
|
hr = CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
|
|
|
|
|
I have an Automation server created in MFC. I have some classes which are creatable by TypeId. Now in one of this class, I want to provide a way to fire events. This is and EXE server and not ActiveX control. I know how to add events in an ActiveX control. Can someone guide me on providing Automation/COM events from a class in MFC.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi All,
This should be the last question on Context Menus...
IContextMenu2 handles the WM_DRAWITEM, which I am trying to use to place an icon (16x116 or 3x13 bitmap) on the Menu. I can't seem to get it to work (fully patched Windows 2000, VC++ 6.0 EE).
Any ideas?
Jeff
|
|
|
|
|
Hi All,
I've used Michael Dunn's article[^] to create two Context Menu handlers. They are housed in separate DLLs. They are basically carbon copies of one another (and the sample which Michael provides) except names. Each uses the same insertion code:
InsertMenu( hmenu, uMenuIndex, MF_BYPOSITION, uidFirstCmd, _T("Menu Item Name") );
However, the items are not placed one after the other ('stacked') as I would expect. As a matter of fact, Windows (at times) places a separator bar between them:
Open with WinZip
Print
----------------
Menu Item 1
----------------
Scan for Viruses
Open With...
Menu Item 2
Winzip
----------------
...
Any ideas to get these fellows to stick together?
Jeff
----------------
|
|
|
|
|
You have no control over what other extensions will do with the menu, nor in what order Explorer will call them. You might be able to influence the order by making your two extensions' ContextMenuHandlers keys have similar names (FooExtension1 and FooExtension2 , for example) but no guarantees.
|
|
|
|
|
Hi Mike,
> nor in what order Explorer will call them
That is more or less my (ignorant) feeling.
> influence the order by making your two extensions'
> ContextMenuHandlers keys have similar names
I tried adding an space (' ') to the names - they get indented on the menu, but not grouped together.
Jeff
|
|
|
|
|
> ContextMenuHandlers keys have similar names...
That was it: in the *.rgs files:
VerifyHash -> CtxVerifyHash
CreateHash -> CtxCreateHash
They are grouped together, partioned by separator bars. Below is for the benefit of others following your articles
Jeff
HKCR
{
NoRemove CLSID
{
ForceRemove {7E745006-XXXX-XXXX-XXXX-E24D4133439C} = s 'CtxVerifyHash Class'
{
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
}
}
NoRemove *
{
NoRemove ShellEx
{
NoRemove ContextMenuHandlers
{
ForceRemove CtxVerifyHash = s '{7E745006-XXXX-XXXX-XXXX-E24D4133439C}'
}
}
}
}
|
|
|
|
|
Hi All,
Can anyone tell me how to return a VARIANT array value from the Activex to the host program , waiting...
Thanks and Regards
Alic
|
|
|
|
|
You need to use SAFEARRAY . I found this article [^] having its usage.
|
|
|
|
|
:-DThanks for your article!
|
|
|
|
|
As said use SAFEARRAY.
In ATL you can use CComSafeArray class. This class provides a wrapper for the SAFEARRAY.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
ok, I will use CComSafeArray, Thanks!;P
|
|
|
|
|
Thanks everybody .
I hope you have a nice day!
Alic
2006-12-15
|
|
|
|
|
Hi there,
Is there a simple way to implement Ctrl-A as select all for all edit controls in a WTL dialog. I guess one way is to use a accelerator table and implement ID_EDIT_SELECT_ALL, but is there a nice way to reroute all edit accelerators to the focused edit control in a dialog window. Is there a better way?
Best regards,
E
|
|
|
|
|
You could write your own edit class that handles the Ctrl-A, and subclass each edit control on your dialog:
Partial class:
class CSelectEdit : public CWindowImpl< CSelectEdit, CEdit >
{
public:
....
BEGIN_MSG_MAP(CSelectEdit)
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
....
END_MSG_MAP()
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if ( GetKeyState(VK_CONTROL) < 0 && wParam == VK_A )
{
SendMessage( EM_SETSEL, 0, -1 );
return 0;
}
bHandled = FALSE;
return 1;
}
};
Then in your dialog class, create a member variable for each edit control:
CSelectEdit m_edit1;
The in your OnInitDialog, subclass each edit control:
m_edit1.SubclassWindow( GetDlgItem( IDC_EDIT1 ) );
Well, that's one way to do it anyway.
- S
50 cups of coffee and you know it's on!
|
|
|
|