|
In the latest version of VS, EXCEPINFO structure is replaced with EXCEPINFO class.
So i don't think we need to manually clear that.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
nicenaidu wrote: So i don't think we need to manually clear that.
Except that I'm doing it through the straight C++ IDispatch class . No fancy ATL classes or .NET wrappers are going to help me here.
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
Hi Guyz,
Can anybody explain me the difference between Early and Late Binding ??
Please give me Examples in VC++ .
Thanks in advance.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
In context to OLE Automation(Since this is the COM lobby)
Late binding is :
Binding the object library in code at run-time
Av's of late binding
1)The main advantage is that code which uses late binding is more certain to be version-independent
Early binding is :
exposing the object model during design-time, as opposed to during run-time.
Av's of early binding
1)Your code will run considerably faster, because it can all be compiled up front. With late binding, the code relating to an application you declared as an object has to, in effect, be compiled as it runs.
2)Because your code can all be compiled up front, debugging is far easier – select Debug + Compile, and the compiler will be able to spot syntax errors which would have been missed had you used late binding.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Early binding means binding at compile time
The functions are selected and linked at compile time
for e.g Function overloading and Operator overloading
Late Binding means binding at Run time
The selection of the function to be call is at run time
For e.g Virtual functions
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Thanks buddies.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
While trying to convert the Html file to image file
Approach is after getting IHtmlDocument2 interface pointer that is passed to the function CCreateImage ,in that we need the IHtmlElementRender interface pointer which is not getting there ? Already included mshtml.h file.
Thanking You
Regards
Shikha
Shikha
Netstudio Pune
|
|
|
|
|
Are you using studio 6.0 ?
because i am not found the prototype of the IHtmlElementRender interface in the header mshtml.h
try using the mshtml.h header provided with vs2003 platformSDK
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
|
I am using a web browser control in my application. I am using IHTMLElementRender interface at some place to convert the HTML file to image. I am getting the error IHTMLElementRender not defined. Which files I need to include for its defination?
|
|
|
|
|
following files needed
Mshtml.h, Mshtml.idl
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Thanks for urgent reply.
I already included the Mshtml.h, but still getting the rooro.
How to include the "Mshtml.idl" ?
is just #include <mshtml.idl> in a file which uses IHTMLElementRender is sufficient?
|
|
|
|
|
Try to import the mshtml.dll file as following
#import "dllpath\mshtml.dll" raw_interfaces_only, raw_native_types, no_namespace, named_guids
ignore .idl file
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
The definition of the IHTMLElementRender interface is provided with PlatformSDK of the VS2003.
You can use mshtml.h header file of PlatformSDK
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
-- modified at 6:06 Thursday 18th May, 2006
|
|
|
|
|
Hi,
I have the COM object "MyObj" which is inheriting from Interface "IX". This I can simply add "ATL simple object" through wizard.
My qestion is I want to add one more Interface "IY" to the same object.
This is posible thorugh wizard or do I need to add all the stuff manually ??
Thanks & Regards,
Siva
|
|
|
|
|
I think you simply add the new ATLclass from New Class Wizards
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Hi Laxman,
Thanks for your reply,
think you are not clear with the question,
I dont want to add new class for my new Interface. I will just explain with example.
My ATL class is "TestATLClassIX" which is inheriting IX and on same class I want to implemnet inter face "IY". I dont want to create a new class and derive from IY , again it goes to other ATL object.
class TestATLClassIX : public IX, public IY
{
}
This is posible through wizard ??
Thanks,
Siva
|
|
|
|
|
Yes,
Right click on the class
select implement interface
and select your typelib from the list if it is not present into the list then browse and select the path where it present
that's enough.
hope it is correct now.;)
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Hi,
Thanks for your info.
Again if I right click and select "Implement interface" option it is asking Type Library info. I don't have any type libray stuff.
But my question is very simple.
Just I create a simple ATL object using wizard ( Simple object option ) let say it as "CMyATLObj"
for this I gave interface "IMyATLObj". Now my component is ready.
Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object.
Bottom line is my ATL object is going to inherit from two interfaces.
is ther any way to do this by wizard or I need to edit all the files manually.
Thanks,
Siva
|
|
|
|
|
See the following Links
Help me[^]
Siva Sankar Koyi wrote: Just I want to add new Interface "IMyATLObj2" and implementaiton I want to porive in same object.
Do you want to add the existing interface ???
if yes ,then for every com object .tlb file is generated that file is the Typelibrary
steps to implement interface:
implement interface->click typelib->select the library name/browse from file. -> ok -> select the interfaces from the list->ok
done.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
You mean You want just a class which supports two interfaces rite?
Loka Samastha Sukhino Bhavanthu..!!!
( May all beings be happy and free )
|
|
|
|
|
Yes..I want my component should be support two interfaces, can I do with wizard..in ATL..
Thanks,
Siva
|
|
|
|
|
Hi Siva,
To do that, you can add a class like what you normally do. Thereafter is the tricky part, to remove the class and leave the interface around.
To do that, in the idl file remove the code below for your second class.
[
uuid(8D1E05B3-F610-4450-984E-4DCC4D2442E5),
helpstring("SubClass1 Class")
]
coclass SubClass1
{
[default] interface ISubClass1;
};
In your second class's header file, remove the 2 lines below. The second line will remove unnecessary register entry.
public CComCoClass<csubclass1, &clsid_subclass1="">,
DECLARE_REGISTRY_RESOURCEID(IDR_SUBCLASS1)
In the main cpp file, remove this line
OBJECT_ENTRY(CLSID_SubClass1, CSubClass1)
If I do not remember wrongly that will be it, 2 interface in one COM object. I had done this in one of my DLL and it works.
But if I do not remember wrongly again, you will not be able to see your second interface in VB or .Net whichever the client u are using. What I did, I had to pass the interface out.
Hence I will see the interface like this in VB.
dim a as FirstClass
a.SecondClass.method()
Hope I got your question right as I had also spend a lot of time on something like that.
|
|
|
|
|
Hello all:
I create a com object like follows:
IATLDiceHelpPtr pATLDiceHelp;
HRESULT hr = pATLDiceHelp.CreateInstance(__uuidof(IATLDiceHelp));
if(pATLDiceHelp)
{
pATLDiceHelp->MsgBox(); // here can not execute
pATLDiceHelp->Release();
}
when executethis code,the variable hr is -2147221164;
can everyone tell me why it is failure? and how to fixed it?Thanks a lot!
more information:
interface definition:
[
object,
uuid(C4892EC8-E170-426C-AB99-7E3B403B0324),
dual,
helpstring("IATLDiceHelp Interface"),
pointer_default(unique)
]
interface IATLDiceHelp : IDispatch
{
[id(1), helpstring("method MessageBox")] HRESULT MsgBox();
};
|
|
|
|
|
From "winerror.h":
#define REGDB_E_CLASSNOTREG _HRESULT_TYPEDEF_(0x80040154L)
Note that -2147221164 is 0x80040154 in hex; always quote HRESULTS in hex, not decimal.
REGDB_E_CLASSNOTREG means that the class you tried create an instance of is not registered.
Steve
|
|
|
|