|
It has nothing to do with it. COM object does not implement them through vtlb, so it is the same thing as this example:
struct _tearoffObj{};
struct _A
{
void GetObj(void** pObj)
{
*pObj = new _tearoffObj();
}
}
_A does not implement _tearoffObj.
So the statement "_pi = pIn;" is 100% correct.
soptest
|
|
|
|
|
soptest wrote:
So the statement "_pi = pIn;" is 100% correct.
Sorry, that wont work.
If CoClass A implements 20 interfaces(10 interface via vtbl and 10 via tear off), you cannot get to the tear offs by assignment, you must use a QI. Same thing for aggregation.
In the world of COM, getting from one interface to another requires you to use QI. It is possible to ignore that rule and typecast, but that is asking for trouble and very poor COM practice.
|
|
|
|
|
Blah blah blah. When your COM object provides tearoff interface/s that object is not based on that interface. Vtbl is dynamicaly created for that tearoff object.
*** STOP: 0x0000001E (0xC0000005,0x8016A950,0x00000001,0x00000086)
KMODE_EXCEPTION_NOT_HANDLED*** Address 8016a950 has base at 80100000 - ntoskrnl.exe
CPUID:x86 5.6.2 irql:1f SYSVER 0xf0000565
Dll Base DateStmp - Name Dll Base DateStmp - Name
80100000 337546bf - ntoskrnl.exe 80010000 33247f88 - hal.dll
80001000 334d3a53 - atapi.sys 80007000 33248043 - SCSIPORT.SYS
801d7000 336016a2 - Disk.sys 801db000 336015af - CLASS2.SYS
801df000 3356d637 - Ntfs.sys 80237000 344eeb44 - Siwvid.sys
8056e000 344eebdc - NTice.sys f1f48000 31ec6c8d - Floppy.SYS
f1f58000 31ec6ca1 - Cdrom.SYS f228c000 31ec6c99 - Null.SYS
f208c000 31ed868b - KSecDD.SYS f2290000 335e60cf - Beep.SYS
f1f88000 335bc82a - i8042prt.sys f2094000 3324806f - mouclass.sys
f209c000 31ec6c94 - kbdclass.sys f229e000 3373c39d - ctrl2cap.SYS
f1fa0000 33248011 - VIDEOPRT.SYS fe1a4000 349a9c93 - mga64.sys
f20cc000 31ec6c6d - vga.sys f1eb0000 332480dd - Msfs.SYS
f1d50000 332480d0 - Npfs.SYS fe164000 3356da41 - NDIS.SYS
f2124000 3593d4f4 - bluesave.SYS fe141000 335bd30e - Fastfat.SYS
a0000000 336157ac - win32k.sys fe0c2000 349a9cdd - mga64.dll
f1ce0000 332483b0 - Cdfs.SYS fdca2000 31ec6e6c - TDI.SYS
fdc59000 31ed0754 - nbf.sys fdc35000 337390ef - tcpip.sys
fdc18000 3362a53a - netbt.sys f1f68000 33644efb - ibmfent.sys
f1d70000 334d3add - afd.sys f2008000 33248371 - netbios.sys
f207c000 31ec6c9b - Parport.SYS fdc14000 31ec6c9b - Parallel.SYS
f2136000 31ec6c9d - ParVdm.SYS f1dd0000 332480ab - Serial.SYS
fdbaf000 3339777c - rdr.sys fdb9e000 332483b5 - mup.sys
fdaec000 3360f103 - srv.sys
Address dword dump Build [1381] - Name
f206fba4 8016a950 8016a950 00000001 00000086 00000086 00000086 - ntoskrnl.exe
f206fbd0 80115d86 80115d86 00000000 ff87a400 ff87a3f0 ff810408 - ntoskrnl.exe
f206fbec 8019d98f 8019d98f ffffffff 80139a54 80143378 00000000 - ntoskrnl.exe
f206fbf4 80139a54 80139a54 80143378 00000000 230edb30 3c8ca3b0 - ntoskrnl.exe
f206fbf8 80143378 80143378 00000000 230edb30 3c8ca3b0 26448761 - ntoskrnl.exe
f206fc10 8011bd6a 8011bd6a ff676980 ffffffff 34f9ad10 00000000 - ntoskrnl.exe
f206fc38 8011bcce 8011bcce ff676980 ffffffff 34f9ad10 00000000 - ntoskrnl.exe
f206fc60 8016a94e 8016a94e f206fee8 00000000 00000086 f206fe70 - ntoskrnl.exe
f206fc74 8016a950 8016a950 00000008 00000346 f206fe48 00000010 - ntoskrnl.exe
f206fc88 801163e3 801163e3 ff876f58 ff676980 ffffffff 00000000 - ntoskrnl.exe
f206fca4 f1f88825 f1f88825 ff876f58 ff676980 ffffffff ff876f38 - i8042prt.sys
f206fcc8 80117f93 80117f93 ff6c7328 ff876bf0 00000000 801126af - ntoskrnl.exe
f206fcd8 801126af 801126af 00000246 80112717 ff6c7328 00000103 - ntoskrnl.exe
soptest
|
|
|
|
|
Cute, you frigging moron...
|
|
|
|
|
Thanks for the suggestion. I had thought of doing something similar myself, I am fairly new to ATL / COM programming and I find it all very slow going and the lack of good examples (that I could find anyway) make things even harder, all of the books I have read give only very simple example code....
moan
moan
|
|
|
|
|
Another tip, if you can be sure that all access is within the same apartment (usually this means no inter-thread or inter-process access), add the [local] attribute to your IDL.
I know how you are feeling, the trick is to not give up. The road to COM enlightenment is mainly via hard-knocks
HTH
Vivek
|
|
|
|
|
i have deployed a component in COM+ under windows 2000 server. I have created application proxy to run it from the client PC. The application Proxy works fine if the OS is Windows 2000 professional. Though the installation of application proxy succeeds, in Windows 98 and Windows NT work station, i get an error "ActiveX component cannot create object". Kindly help. Please to ganesh@curans.co.in
|
|
|
|
|
what is the HRESULT?
Check access permissions, use dcomcnfg.exe utility
soptest
|
|
|
|
|
Hi,
Does anyone know how to return the destination path of a file after a drag-drop operation?
I am writing a shell extension using C++/COM. From within the shell extension I load all removable media drives and can view files on the media. When I drag a file from the shell extension to say the desktop, I need to get this destination path? Any ideas....?
Thanks very much
Anonymous
|
|
|
|
|
implement this method in your Drag-and-Drop handler:
IShellExtInit::Initialize(LPSHELLEXTINIT psxi,
LPCITEMIDLIST pidlFolder,
LPDATAOBJECT pdtobj,
HKEY hkeyProgID)
{
char szTargetFolder[MAX_PATH];
if (pidlFolder)
{
SHGetPathFromIDList(pidlFolder, szTargetFolder);
}
}
soptest
|
|
|
|
|
I try to expose an interface using its own coclass in an MFC application with added ATL support.
Unfortunately, it doesn't seem to work in VB. The interface is visible, but it cannot be instantiate.
Do you know what is to be done?
rechi
|
|
|
|
|
what do you mean "interface cannot be instantiate"?
P.S. You must use types recognized by VB. What is the error? Show the IDL of that interface.
soptest
|
|
|
|
|
The problem is now half-solved. It was about registering the interface in the registry. To do this, i've added _Module.RegisterServer(TRUE) in the InitInstance method. It works now, but when creating the object, a new instance of the MFC application is started to act as server, even if another one is already running.
Do you know how to make the running one be the server also?
rechi
|
|
|
|
|
On ATL ActiveX EXE-server, such strategy (when creating the object, a new instance of the application is started) is realized by
<br />
hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE);<br />
instead of
<br />
hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE);<br />
I do not know a MFC-server, but something like this take a place.
With best wishes,
Vita
|
|
|
|
|
Look at COleObjectFactory::m_bMultiInstance and its initialization for your class.
With best wishes,
Vita
|
|
|
|
|
I'm trying to test some programs on win2k whith IE 6.0 who use an activex dll, but on my machine, these programs didn't work. Well, when i tested them on a machine with win98 they worked.
Could you help me?
|
|
|
|
|
Why didn't they work, what ssort of errors or behavior did you see?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thank you for help me, kilowatt.
The error is that all call to functions, objects of dll's aren't done. Seems that IE can't see references to dlls.(Any error are shown)
|
|
|
|
|
Have you tried to create an object or ActiveX control that resides in this DLL in one of your applications without IE 6.0. Try using the ACtiveX control container test tool in visual studio. This is just to make sure that the DLL is registered properly and you can use it outside of IE, because it may not be a problem if IE.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi!
Does Anyone know how can I sign a Dll? Is there a free program to do that for me?
Thanks!
|
|
|
|
|
use signcab.exe to sign controls. Read up more on Internet Component Download at msdn.
|
|
|
|
|
Thank you Amit Dey!
It would be interesting if there was a free program to do that to me. All the information I read was for testing only.
Could anyone help me?
|
|
|
|
|
I guess I have basic knowledge of COM/ATL.. Any suggestions on a good book to learn more COM/ATL (intermediate/Expert level).
Thanks
|
|
|
|
|
Hello, see my answer to Nish
COM ATL BOOK
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
ATL Internals by Brent Rector and Chris Sells if you want to learn ATL.
Essential COM by Don Box if you truely want to understand COM.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|