|
I've recently written a shell extension that extracts the bitmap preview from AutoCAD drawing files and displays them when viewing folders as web pages. Everything works great except for one thing.
The problem is that when the folder is viewed as Thumbnails, the shell shows the same preview image for *all* DWG files in the folder (whichever one was last selected). At first, even refreshing the thumbnails didn't solve the problem so I modified my implementation of IExtractImage::GetLocation to enable shell caching. That only sort of works. The images are still the same but at least you can refresh them to get the correct preview.
Does anyone know what is causing this problem and how I may prevent it from occuring in the first place?
|
|
|
|
|
I'm working on an activex control that will sit in a webpage. I'm looking to add icons to me TreeView and am having trouble getting an ImageList set up.
So far I've done this:
CoCreateInstance(CLSID_ImageList,
NULL,CLSCTX_INPROC_SERVER,IID_IImageList,(void** &m_ImageList);
CoCreateInstance(CLSID_ListImages,
NULL,CLSCTX_INPROC_SERVER,IID_IImages,(void**)&m_Images);
Since I see that an ImageList needs the Image collection put into it, but then the Image Collection needs Images put into it and I have no idea how to set that up.
Anyone have any tips or links?
-Jack Mott
jackm@scalablesoftware.com
|
|
|
|
|
I cannot add a second interface (derived from IDispatch). I have a feeling I am doing something fundamentally wrong (like maybe it can't be done?).
Here is the code:
// TestDisp.idl : IDL source for TestDisp.dll
//
// This file will be processed by the MIDL tool to
// produce the type library (TestDisp.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(050877DD-6973-11D5-BF78-0050DA22A717),
dual,
helpstring("IObj1 Interface"),
pointer_default(unique)
]
interface IObj1 : IDispatch
{
[id(1), helpstring("method FirstMethod")] HRESULT FirstMethod(BSTR Junk);
};
//Added:
[
object,
uuid(050877DD-6973-11D5-BF78-0050DA22A718),
dual,
helpstring("IObj2 Interface"),
pointer_default(unique)
]
//Added:
interface IObj2 : IDispatch
{
[helpstring("method Method2")] HRESULT Method2(BSTR Crud);
};
[
uuid(050877D0-6973-11D5-BF78-0050DA22A717),
version(1.0),
helpstring("TestDisp 1.0 Type Library")
]
library TESTDISPLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(050877DE-6973-11D5-BF78-0050DA22A717),
helpstring("Obj1 Class")
]
coclass Obj1
{
[default] interface IObj1;
interface IObj2; //Added
};
};
// Obj1.h : Declaration of the CObj1
#ifndef __OBJ1_H_
#define __OBJ1_H_
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CObj1
//< AND > Characters changed to [ and ], since I can't figure
//out how to get them to display in a web page properly!
class ATL_NO_VTABLE CObj1 :
public CComObjectRootEx[CComSingleThreadModel],
public CComCoClass[CObj1, &CLSID_Obj1],
public IDispatchImpl[IObj1, &IID_IObj1, &LIBID_TESTDISPLib],
public IDispatchImpl[IObj2, &IID_IObj2, &LIBID_TESTDISPLib] //Added (this creates the error)
{
public:
CObj1()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_OBJ1)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CObj1)
COM_INTERFACE_ENTRY(IObj1)
COM_INTERFACE_ENTRY(IObj2) //Added
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
// IObj1
public:
STDMETHOD(FirstMethod)(BSTR Junk);
};
#endif //__OBJ1_H_
Here is the error I get:
testdisp\obj1.h(28) : error C2594: 'static_cast' : ambiguous conversions from 'class CObj1 *' to 'struct IDispatch *'
|
|
|
|
|
Hi Dave,
You are deriving a new class from two other classes that both
implement IDispatch, therefore the compiler does not know which
one to use.
You can select which one should be implemented in your new class
in your COM_MAP by using COM_INTERFACE_ENTRY2 instead of COM_INTERFACE_ENTRY:
COM_INTERFACE_ENTRY(IObj1)
COM_INTERFACE_ENTRY2(IDispatch, IObj2)
//COM_INTERFACE_ENTRY(IDispatch) // Removed
See the COM_INTERFACE_ENTRY2 docs.
Hope this helps (and it is the correct answer
Alwin Beukers
|
|
|
|
|
Hi,
I'm writing a control to return a Picture Object for use with Visual Basic, but I'm having problems figuring out how to return the IPictureDisp in ATL. I have the IPictureDisp object but I don't know how to return the reference.
Can anyone offer suggestions or pointers to some example code on how to return the Picture Object? Any help/comments appreciated.
Thanks!
-RB
Rick@eBoyer.Net
|
|
|
|
|
See
http://www.vbpj.com/upload/free/features/vbpj/1999/04apr99/vp0499/vp0499.asp
Bjarke Viksoe
My code at: http://www.viksoe.dk
|
|
|
|
|
ActiveX control (COleControl) as property in other ActiveX control?
|
|
|
|
|
Hi,
I have a problem in defining a structure inside a type library in COM.Compiler is not able to generate UUID for the structure.Could anyone please help me?
Thank You.
Yamuna.E.
|
|
|
|
|
Why I need the UDP ?
i want to create something (Like OCX or DLL) to let the server send a message to the client(s) inform them to refresh ,redirect ,there is new email, XXX is logged on.
how i'm thinking to solve this problem?
create client OCX (without using the WinSock.OCX) to wait and manage the server message. and create an DLL on the server that will send the message to the Client OCX. (i think this is a good solution ?! do you think that ????!! )
What i want ?
i do not know how to write a code deal with UDP ?!
if you have another idea ?? i'll be pleased to you if you send it to me
Note : I’m talking about intranet.
Can any one there help me ? or give and any article(s) that could help ?!
web programmer.
|
|
|
|
|
Distinguish btween COM And DCOM.
Can u explain me how to use DCOM
Wat is the difference btween registering a DLL in IIS Server as Component and make use it in ASP and Registering the same DLL in MTS and make use of it in ASP.
|
|
|
|
|
I have created a procedure in my ATL Component which returns IDispatch *
In VB Client Its also allocated to an object but at the end of function i got an error
Help me
|
|
|
|
|
Hi,
I am building OCX which uses other OCX files. I pack those in one CAB file, which should be distributed over intranet.
Each time I add a new functionality to my OCX file I change file version from 2.0.0.4 to 2.0.0.5 for example.
I include this version change in my INF file however, once i downloaded my control (2.0.0.4) on remote machine it is being loaded (the one with no 2.0.0.4 - even though i have 2.0.0.5 in a cab) every time i call this control but with HIGHER version number 2.0.0.5.
I tried to change my cab file name, and i place a new cab with newer control in deifferent directory. It does not work. I need to delete once installed control version say 2.0.0.4 from c:\winnt\downloaded program files in order to download and install newer version 2.0.0.5
Where is there a mistake ? I cannot expect client to clear registry in order to install newer version of control.
I would appreaciate any help.
thank you
Bartek
|
|
|
|
|
How can I pass an IDispatch pointer into C++? My C++ method is expecting a <vector> of smart pointers (std::vector<xxptr<object>> ) to C++ objects. Since I am using a VB front-end, I pass a set of IDispatch pointers to ATL via the variant type.
Now, I am stuck with a set of IDispatch pointers to the objects and I don't know how to pass them into C++.
Any ideas?
thanks,
-shamus
|
|
|
|
|
What do you mean pass them to C++?
What do you plan to acheive with your objects?
|
|
|
|
|
You can use IDispatch* ,LPDISPATCH or IDispatchPtr (smart pointer created from import)
to pass IDispatch pointers to your C++ methods.
Kindest regards
Holger Persch
|
|
|
|
|
I have created a procedure in my ATL Component which returns IDispatch *
In VB Client Its also allocated to an object but at the end of VB function i got an error in VB
Help me
|
|
|
|
|
How can i use existing COM components , for eg if i want a text component then how should
i go about doing it ? are there any components whose interfaces can be used directly ?
parag
|
|
|
|
|
How can I load Activex component from .ocx file? I don't want to use
insert new object dialog. Do I have to make some changes to component
itself? Thanks for help allready
|
|
|
|
|
Just #import the typelib and go about creating component the usual way with CoCreateInstance()
Hush..Hush.. thought I heard you calling my name now...
|
|
|
|
|
I built a COM object and installed it in MTS. I'm referencing to it in an ASP page and in that page I need to loop through its properties without hardcoding them. With ADO object I can do this
DIM prop
FOR EACH prop IN <object name="">.properties
...
NEXT
But when I tried this with the COM object that I've built, the ".properties" is not a option.
So is there a way to loop into the collection of properties with a custom COM object ? Do I have to toggle an option or to add a reference in the object ?
Pat
|
|
|
|
|
Is properties a property or method that you've added to the COM object! if not take a look on MSDN for TLBINF32.DLL it's a COm object that will let you iterate through an object properties/methods.
Joe.B.
|
|
|
|
|
Hi all !
Explain this question who is able to
16. You design a COM component for use by many user interface applications in your company. One of the interface methods for the component defines a parameter for an IP address as a string in the format nnn.nnn.nnn.nnn. The component's type library defines this parameter as both an input and an output parameter.
When the interface method is called, the component validates the IP address. If the current user is forbidden to access that address, then the component should change the parameter to the string 0.0.0.0 and display this string within the application.
Which type of COM component should you design?
A. data-aware class
B. distributed COM server component
C. out-of-process COM server component
D. ActiveX user interface Control
Thanks.
|
|
|
|
|
Hi ......
I have a composite control with some buttons on it, I want them
to react on me pressing enter. I tried to overload the pretranslatormethod and
catch it, but the funny thing is that it only works randomly, sometimes it works and
sometimes it doesnt. Have you come across anything like that before ? I cant solve it
/Pierre
|
|
|
|
|
Hi ......
I have a composite control with some buttons on it, I want them
to react on me pressing enter. I tried to overload the pretranslatormethod and
catch it, but the funny thing is that it only works randomly, sometimes it works and
sometimes it doesnt. Have you come across anything like that before ? I cant solve it
/Pierre
|
|
|
|
|
Hi,
VB stores some data about connections points it exports in the linked thread's TLS, thus when I try to callback an event, I get an Acces Violation. I found a code snippet by microsoft, but it doesn't seem to work in all cases, and event worse, didn't allow me to transfer interfaces ...
Thank you
|
|
|
|