|
Hi all,
My goal is to make a tool that is attached to Internet Explorer
and sensing certain events (such as when the user types in something,
the user requests a new URL, the URL address ...)
and providing one's own buttons for certain functions
and processing based on these information.
Though I have been programming in Java and C++ a lot, they were mostly
in Unix/Linux environment.
And to accomplish my goal, I really don't know where to start.
Could anyone tell me where to look for,
which part of windows programming I need to dig into,
what book to read?
If my message is not very relevant to this specific board,
please forgive me for my ignorance.
I would much appreciate your guidance!
|
|
|
|
|
creamcat21 wrote:
My goal is to make a tool that is attached to Internet Explorer
and sensing certain events (such as when the user types in something,
the user requests a new URL, the URL address ...)
for Above Try to search for BHO in MSDN,you can find a sample sourec code for that.
here BHO stands for Browser Helper Object
creamcat21 wrote:
and providing one's own buttons for certain functions
and processing based on these information.
for that there is very good example of IE oolbar in IE programming Section at CP. sorry i don't remeber it name
anyway i think you have to make extra effort to find both
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Is there a way to use a COM+ component from VBScript without registering the component in component services? I have a COM+ component I created using C# (ServicedComponent) that calls out to other .NET assemblies that are not serviced components. If there isn't a way to use the component without registering it, then how can I register just the COM component and allow it to still access the .NET assemblies that is uses?
Any ideas?
Thanks.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
|
can someone kindly point me to a small example of a local COM server (exe) and a client who is accessing this local server? that will be extremely helpful!
Thanks!
|
|
|
|
|
|
Thanks Michael,
but that looks like a ATL article, I guess I wanted a COM article??
Thanks again for the quick response!
|
|
|
|
|
liyang yu wrote:
but that looks like a ATL article, I guess I wanted a COM article??
ATL is the best and in my opinion the easiest way to learn COM.
If you want to learn the COM basics the old fashioned way, then I recommend the book "Essential COM" by Don Box. Or do a google for "Don Box" and read some of his on-line stuff.
Michael
CP Blog [^]
|
|
|
|
|
Hi All,
Just a little problem to bother you all.
I am using one component developed in VC. Component creation, events generation etc is just working fine except that sometimes the events generated by the component is not received by the client.
This happens very rarely and the problem persists even after restarting the client app. At this point of time, clients developed in Vb or VC are not able to receive events generated by the component, even though the components are created successfully. The only way out at this point of time is to restart the server app.
I would appreciate if you could help me asap as I am really stuck with this problem.
Regards,
Sudeep
Sudeep Kukreti
|
|
|
|
|
Hello All,
In my .idl I have the following declarations.
typedef struct AXCS_DYNAXRPARA_T_tag
{
sh_dyna_xrpar_t1 data1;
sh_dyna_xrpar_t2 data2[NO_DYNA_PULSES_MAX];
}AXCS_DYNAXRPARA_T;
sh_dyna_xrpar_t1 and sh_dyna_xrpar_t2 are defined in another .idl file.
Now
when I import the generated .tlb into another file I get compilation
errors
since the .tlh file is getting generated the following way.
struct sh_dyna_xrpar_t1_tag
{
struct acs_obj_header_t_tag header;
unsigned short xrparn;
unsigned short index;
short obj_count;
short no_mask_img;
unsigned char version_shdynaxrpar;
unsigned char dummy1;
short no_dyna_pulses;
};
struct AXCS_DYNAXRPARA_T_tag
{
struct sh_dyna_xrpar_t1_tag data1;
struct sh_dyna_xrpar_t2_tag data2[40];
};
struct sh_dyna_xrpar_t2_tag
{
long xrv;
long xrua;
long xrpt;
};
As you can see, sh_dyna_xrpar_t2_tag is getting declared after struct
AXCS_DYNAXRPARA_T_tag declaration. Why so?? The compilation error I am
getting is
error C2079: 'data2' uses undefined struct 'sh_dyna_xrpar_t2_tag'
Why is the compiler getting confused. How can I correct the above.
Using .h and _i.c is working for me. I want to make the above work with
#import .tlb file.
Regards
Rajdeep
|
|
|
|
|
Hello All,
In my .idl I have the following declarations.
typedef struct AXCS_DYNAXRPARA_T_tag
{
sh_dyna_xrpar_t1 data1;
sh_dyna_xrpar_t2 data2[NO_DYNA_PULSES_MAX];
}AXCS_DYNAXRPARA_T;
sh_dyna_xrpar_t1 and sh_dyna_xrpar_t2 are defined in another .idl file. Now when I import the generated .tlb into another file I get compilation errors since the .tlh file is getting generated the following way.
struct sh_dyna_xrpar_t1_tag
{
struct acs_obj_header_t_tag header;
unsigned short xrparn;
unsigned short index;
short obj_count;
short no_mask_img;
unsigned char version_shdynaxrpar;
unsigned char dummy1;
short no_dyna_pulses;
};
struct AXCS_DYNAXRPARA_T_tag
{
struct sh_dyna_xrpar_t1_tag data1;
struct sh_dyna_xrpar_t2_tag data2[40];
};
struct sh_dyna_xrpar_t2_tag
{
long xrv;
long xrua;
long xrpt;
};
As you can see, sh_dyna_xrpar_t2_tag is getting declared after struct AXCS_DYNAXRPARA_T_tag declaration. Why so?? The compilation error I am getting is
error C2079: 'data2' uses undefined struct 'sh_dyna_xrpar_t2_tag'
Why is the compiler getting confused. How can I correct the above.
Using .h and _i.c is working for me. I want to make the above work with
#import .tlb file.
Regards
Rajdeep
|
|
|
|
|
I am developing a simple local COM server, after I finished building this server(compiled, ran), then I used the OLE/COM object viewer to check it (I am using VC6.00, and this OLE/COM object viewer is a tool provided in the IDE of VC6.0), I opened up the "All Objects", I can see the one that is inside my newly created local COM server, but when I clicked the "+" sign to open it more up, it says the following:
GetObject() failed,
The system cannot find the path speicifed, $80070003
Anyone knows what is this and what is reason??
thanks!
|
|
|
|
|
Did you remove the DLL file after it was registered? Take a look at the registry key HKEY_CLASSES_ROOT\CLSID\{your class' GUID}\InprocServer32 (assuming it's a DLL server). The default value of that key should be the path to your DLL. If it isn't, bingo, there's your problem. If the value is correct, then I can't really tell.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
|
|
|
|
|
Thanks! In fact, I am using a EXE (local COM server) server, and the registry key looks like following:
HKEY_CLASSES_ROOT\CLSID\{myClassGUID}\LocalServer32 = somePath
so this part should be fine...
I appreciate your input very much though.
liyang
|
|
|
|
|
Could it be that your COM server depends on a DLL (probably home made) which OLE/COM Viewer can't find? I can't remember if that fault produces the "file not found" error or "device not ready". In any case, the error code given is not intuitive.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
|
|
|
|
|
not really. this is a very simple example, in fact it is a small lab example from this "Developer's Workshop to COM/ATL 3.0" book, and the author's own lab code also produces this problem. sigh..., and I cannot find his contact info.
|
|
|
|
|
Hi all,
how can I create a COM in VC++.NET, which project template should I choose ?
Thanks
Patrick
|
|
|
|
|
Hello,
I develop a COM Object wint IConnectionPoint. I have a method "Advise" with the line:
HRESULT hr = CoMarshalInterThreadInterfaceInStream(IID__IInterface_OutilsEvents, p, &m_StreamArray[m_nStreamIndex] );
It's ok with windows 2000 but when I try it with Windows XP, I have an error in this line:
"Interface not registered"
Why?
Thanks
Sanouk
|
|
|
|
|
And is it registered? You can investigate by using OLE/COM object viewer if the interface is registered or not.
|
|
|
|
|
I am writing a very simple local COM server (exe), which has a Car class, a CarClassFactory , also a simple idl , everything goes well until the WinMain() file which provides the housing for the coclass and class factory, vC6.00 keeps saying the following:
Deleting intermediate files and output files for project 'CarCOMExe - Win32 Debug'.
--------------------Configuration: CarCOMExe - Win32 Debug--------------------
Creating Type Library...
Processing F:\COM\CarCOMExe\CarCOMExeTypeInfo.idl
CarCOMExeTypeInfo.idl
Processing F:\Microsoft Visual Development\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl
oaidl.idl
Processing F:\Microsoft Visual Development\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl
objidl.idl
Processing F:\Microsoft Visual Development\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl
unknwn.idl
Processing F:\Microsoft Visual Development\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl
wtypes.idl
Compiling...
StdAfx.cpp
Compiling...
Car.cpp
CarClassFactory.cpp
CarCOMExe.cpp
f:\com\carcomexe\carclassfactory.h(13) : error C2504: 'IClassFactory' : base class undefined
f:\com\carcomexe\carclassfactory.h(19) : error C2061: syntax error : identifier 'REFIID'
f:\com\carcomexe\carclassfactory.h(25) : error C2061: syntax error : identifier 'LPUNKNOWN'
F:\COM\CarCOMExe\CarCOMExe.cpp(32) : error C2065: 'CoInitialize' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(36) : error C2065: 'ITypeLib' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(36) : error C2065: 'pTLib' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(36) : error C2106: '=' : left operand must be l-value
F:\COM\CarCOMExe\CarCOMExe.cpp(37) : error C2065: 'LoadTypeLibEx' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(37) : error C2065: 'REGKIND_REGISTER' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(38) : error C2227: left of '->Release' must point to class/struct/union
F:\COM\CarCOMExe\CarCOMExe.cpp(48) : error C2065: 'CoRegisterClassObject' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(48) : error C2065: 'IClassFactory' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(48) : error C2059: syntax error : ')'
F:\COM\CarCOMExe\CarCOMExe.cpp(61) : error C2065: 'CoRevokeClassObject' : undeclared identifier
F:\COM\CarCOMExe\CarCOMExe.cpp(65) : error C2065: 'CoUninitialize' : undeclared identifier
locks.cpp
Generating Code...
Error executing cl.exe.
Creating browse info file...
CoCarEXE.exe - 15 error(s), 0 warning(s)
as you can sees, it keeps saying that IClassFactory is undefined, but the CarClassFactory.cpp compiles well. CarClassFactory.h is very simple:
#define CarClassFactory_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <windows.h>
class CarClassFactory : public IClassFactory
{
public:
CarClassFactory();
virtual ~CarClassFactory();
STDMETHODIMP QueryInterface(REFIID riid,void** pIFace);
STDMETHODIMP_(ULONG)AddRef();
STDMETHODIMP_(ULONG)Release();
STDMETHODIMP LockServer(BOOL fLock);
STDMETHODIMP CreateInstance(LPUNKNOWN pUnkOuter,REFIID riid,void** ppv);
private:
ULONG m_refCount;
};
#endif
and CarCOMExe.cpp is as follows:
#include "stdafx.h"
#include "CarCOMExeTypeInfo_i.c"
#include "CarClassFactory.h"
#include <string.h>
DWORD g_allLocks;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
CoInitialize(NULL);
ITypeLib* pTLib = NULL;
LoadTypeLibEx(L"CarCOMExeTypeInfo.tlb", REGKIND_REGISTER, &pTLib);
pTLib->Release();
if(strstr(lpCmdLine, "/Embedding") || strstr(lpCmdLine, "-Embedding"))
{
CarClassFactory carClassFactory;
DWORD regID = 0;
CoRegisterClassObject(CLSID_Car, (IClassFactory*)&carClassFactory,
CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, ®ID);
MSG ms;
while(GetMessage(&ms, 0, 0, 0))
{
TranslateMessage(&ms);
DispatchMessage(&ms);
}
CoRevokeClassObject(regID);
}
CoUninitialize();
MessageBox(NULL, "Server is dying", "EXE Message!", MB_OK | MB_SETFOREGROUND);
return 0;
}
Really frustrated, can some one give me some help?
Thanks!!
|
|
|
|
|
Have you #included the following file into your program?
#include <windows.h>
-John
|
|
|
|
|
|
Yes,I did. In fact, I did the following:
#include "stdafx.h"
which includes windows.h .
|
|
|
|
|
It took me a day to figure this out:
I am using VC 6.00, and my
stdafx.h looks like this:<br />
<br />
<pre>
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
</pre><br />
<br />
you need to get rid of <pre>#define WIN32_LEAN_AND_MEAN</pre> to make a simple local COM server work!!<br />
<br />
Thanks!
|
|
|
|
|
Are u using ATL???
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|