|
Thanx bud...do you have a C# snippet? Doesn't have to be C# though...I'll take whatever you may have. Thanx again.
|
|
|
|
|
Sorry, i dont have time to make a C# sample but check within namespace Microsoft.Win32, you will find classes for Registry and RegistryKey, check info on these and you probably can code something quick.
|
|
|
|
|
Yea...I've actually done a lot with the items that MS.Win32 exposes. I was just looking for the quick way out.
Thanks for your help sir.
|
|
|
|
|
Hi i have actually posted this question in ATL section
I have recieve a few tlb from a vendor . in these tlb there is only interfaces with no coclass at all.
Can any body teach me how to use this interface or point me to a sample
thanks
PS: sorry for double posting, need it urgently
|
|
|
|
|
I've been looking at methods of implementing realtime file monitoring. I have looked at validtec's API hooking SDK, which is not ideal for my purposes.
Alfa's File monitor COM component is superb...
My question is:
Does anybody know of any other alternatives?
Just another copy and paste artist
|
|
|
|
|
You can use this window api FindFirstChangeNotification
it is easy to use, fast and low cpu consumption
|
|
|
|
|
Thank you,
That is fantastic and perfect!
Just another typist
|
|
|
|
|
I have a dialog that hosts an IE ActiveX component. My OnDocumentComplete looks like this:
bool CMyClass::ParseDoc(CComPtr[IHTMLDocument2] pDoc){...};
bool CMyClass::ParseDoc(CComPtr[IXMLDOMDocument] pDoc){...};
void __stdcall CMyClass::OnDocumentComplete(IDispatch* pDisp, VARIANT* URL)
{
if (m_pBrowser == (IWebBrowser2*)pDisp)
{
CComPtr<IDispatch> pDispatch;
m_pBrowser->get_Document(&pDispatch);
CComQIPtr[IHTMLDocument2] pHTMLDoc;
CComQIPtr[IXMLDOMDocument] pXMLDoc;
if ((pHTMLDoc = pDispatch) && ParseDoc(pHTMLDoc))
{
...
}
if ((pXMLDoc = pDispatch) && ParseDoc(pXMLDoc))
{
...
}
pDispatch.Release();
}
}
The problem is, even when the document is an XML document, the QueryInterface for IHTMLDocument works, but the QI for IXMLDOMDocument fails. This seems like the way to do it, but I guess not. How can I proccess the document without knowing wether it's going to be HTML or XML?
Thank you.
|
|
|
|
|
Hi there,
I believe it's because IE does not load XML into an XMLDOMDocument, it treats it the same as though it was HTML. The reason why it displays differently is because it loads a pre-defined XSLT (res://msxml.dll/DEFAULTSS.xsl) that transforms the XML contents into the XML view you normally see in IE.
My advise would be to grab the IHTMLDocument2, get the body->innerText that will give you the contents and either look for "<?" or look for <html> then load the contents into your own IXMLDOMDocument (through loadXML).
The best way would be to get hold of the content type set for the document, however the mimeType property on the IHTMLDocument2 interface always returned "ASP.NET Web Page" on my test web server, whether it was HTML or XML being sent back.
Hope this helps,
Andy
|
|
|
|
|
Thanks Andy, I wish there was a cleaner way to do it, but I think this will work for me.
|
|
|
|
|
Hi,
I've a pretty basic question on ActiveX control.
I've an activeX control developed using Microsoft Visual C++ 6.0 based on ATL framework. I have the first version shipped to the customers already.
Now, I've a newer version of the component, and I'm trying to up the version so that users would get the latest copy downloaded automatically when they visit the site.
Can someone tell me how I increase the version number ?, please. I use the OBJECT tag in my HTML page to refer to the control. Would increasing the version number take care of downloading the latest version even if an older version is present on the client machine ?
-Thanks/Sudha
|
|
|
|
|
I have a COM EXECUTABLEserver made in Delphi 6 and a client made in Visual C++ MFC. I can make a client that uses the connection points in Delphi, but not in Visual C++.
I noticed that the cookie in the Advise function is 1. Does anybody have a sample of this kind of project?
ahmad
|
|
|
|
|
Hi ahmad,
To implement connection points in MFC create a class derived of CCmdTarget, e.g:
class CMyEvent : public CCmdTarget
{
DECLARE_DYNCREATE(CMyEvent)
CMyEvent();
public:
public:
public:
virtual void OnFinalRelease();
protected:
virtual ~CMyEvent();
DECLARE_MESSAGE_MAP()
afx_msg void AnEvent1(short param1);
afx_msg void AnEvent2(short param1);
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()
};
and for implementation...
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CMyEvent, CCmdTarget)
CMyEvent::CMyEvent()
{
EnableAutomation();
}
CMyEvent::~CMyEvent()
{
}
void CMyEvent::OnFinalRelease()
{
CCmdTarget::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(CMyEvent, CCmdTarget)
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CMyEvent, CCmdTarget)
DISP_FUNCTION(CMyEvent, "AnEvent1", AnEvent1, VT_EMPTY, VTS_I2)
DISP_FUNCTION(CMyEvent, "AnEvent2", AnEvent2, VT_EMPTY, VTS_I2)
END_DISPATCH_MAP()
static const IID IID_IMyEvents =
{0x71294e8f,0x16b0,0x11d4,{0x81,0x37,0x00,0xc0,0x4f,0x43,0x6d,0x97}};
BEGIN_INTERFACE_MAP(CMyEvent, CCmdTarget)
INTERFACE_PART(CMyEvent, IID_IMyEvents, Dispatch)
END_INTERFACE_MAP()
void CMyEvent::AnEvent1(short param1)
{
}
void CMyEvent::AnEvent2(short param1)
{
}
(Look on MSDN for DISP_FUNCTION macro to see all the different param types)
Once you have the implementation of the connection points, then create an instance and query the object for the container Interface. Once you have that use FindConnectionPoint passing the IID of the connection point you are interested in, call GetIDispatch(FALSE) on your instance, and pass this through the connection points Advise method.
Don't forget to Unadvise passing the cookie when you are all done.
Hope this has helped,
Andy
|
|
|
|
|
Some of you may start naming me The Dll-hell-Man.
I really have to get my problem solved!!!
What may be wrong when
m_ptr.CreateInstance("MyDll.Class")
returns "Invalid class string"
I've looked in the registry and find a string "MyDll.Class".
The realy strange thing is that calling MyDlldll works perfect on my deveoping CPU but when running it on another CPU after regisering MyDll.dll I got the
"Invalid class string"
message.
Please - Make my Day - APe
_____________________________
...and justice for all
APe
|
|
|
|
|
Did the registration work properly on the other computer?
Try running Oleview.exe (it's in the tools directory in the Visual Studio program directory), and see if you can find and instantiate the COM class from there.
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
OK I'll try that.
Is the "Oleview.exe" about the same program as "Dependency Walker"?
Tackar - Jörgen
_____________________________
...and justice for all
APe
|
|
|
|
|
d00_ape wrote:
Is the "Oleview.exe" about the same program as "Dependency Walker"?
Nope. It's basically a browser for all COM components in the system. It allows you to inspect them, their type libraries (if any) and instantiate them. It's a very handy program.
d00_ape wrote:
Tackar - Jörgen
Varsågod!
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi .
I faced with very wired thing.
I made my component in VC7 and when compiling one all flow in right way(component compiled and linked with out error),then invoked regsvr32 and it rised error : Specific module not found and show exact path on my output .dll
file, at this time this file exist in mentioned path.
Ok this trouble num.1
Indeed i register component from command string and all fine,one registered without trouble.
Now i make test in console application , and try to create this component by CoCreateInstance function(pass as first parameter well CLSID of this component )but one returned error:
Class not registered.
I launch OLE\COM viewver and see this component exist there
and had good TypeLib information,then i launch regedit and search there my classId, but the are nothing found .
How this possible??? I supposed OLE\COM viewver pick up information from register...
HELP me to clarify this situation.
THANK
|
|
|
|
|
I can deal with those tables with just 1 BLOB field. But I failed when dealing with those tables with more than 1 BLOB fields. Error occurs when the IRowset::GetData function is called.
After searching the keyword, DBPROP_MULTIPLESTORAGEOBJECTS, in MSDN, I found some articles about it. But I still cannot resolve the problem under the reference of those articles.
I tried to find an example that opens table with multiple storage objects, but I failed again.
|
|
|
|
|
Hi,
How to create a User Define Collection?
Mark
|
|
|
|
|
|
HI ,
I need to implement custom print in mshtml i.e iam using my print dialog . I need to know the page range and margins setting. The Exec command takes OLECMDID_PRINT takes these setting in its third parameter.Can anyone tell me how to get it?I need to implement removeFormatting also, i used Olecmdid_removeformat does't work for some element such as span.
Thanx in advance
|
|
|
|
|
Hi,
Has anyone developed a custom metadata editor using C#.net or vb.net. if yes, i have a question.
I am trying to develop a custom metadata editor using C#.net. i am using ArcGis 8.3 and Visual studio .net 2003.
when i am trying to execute my custom metadata editor in ArcCatalog it says "Object reference not set to an instance of an object". i don't know where i am going wrong..
I appreciate your help in this regard..
example is given on http://arcobjectsonline.esri.com
Thanks,
abhi
|
|
|
|
|
What does my code do?
<br />
#import "MyDll.dll"<br />
….<br />
CoInitialize(NULL);<br />
<br />
if(SUCCEEDED(m_IPtr.CreateInstance("MyDll.Stuff")) )
{<br />
}<br />
else<br />
{<br />
}<br />
...and justice for all
APe
|
|
|
|
|
I don't think its quite that simple.
You are venturing into the realms of COM (of which I am still a student), and not just any common DLL.
Unlike LoadLibrary() that loads a regular dll into your address space, and therefore enabling you to execute its functions; 'instantiating' a component interface, which is what your sample does, does not involve the same concept.
at least thats what I think what you are asking!
I Dream of Absolute Zero
|
|
|
|