|
Robert Ernst wrote: I've tried placing the enum in the .idl file, but the type still doesn't show up in the DLL, based on browsing with the Object Viewer
The following code is generated by the Application wizard of the ATL COM Componenet.
I am simply added the enum inside the code is works fine.
I have tested under VB6.0 and VC++6.0 Object Browser
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(7CB363A8-69EB-48BE-9E20-BD1B5CC87F76),
dual,
helpstring("Itest Interface"),
pointer_default(unique)
]
interface Itest : IDispatch
{
};
[
uuid(8D40959D-E348-4220-971A-61CA27F53C45),
version(1.0),
helpstring("test11 1.0 Type Library")
]
library TEST11Lib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(8F71F9BF-8982-4804-A22C-FA3A7E7C225C),
helpstring("test Class")
]
coclass test
{
[default] interface Itest;
};
typedef enum tagTestEnum
{
Bad=0,
Good=1
}TestEnum;
};
Hope this code helps you
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
BINGO!! That was it.
My enum definition wasn't inside the library TEST11Lib {} declaration.
Once I placed it inside the library <libname> {} block it worked.
Thanks so much for your help!
Robert Ernst
codeproject@theernsts.org
|
|
|
|
|
I suppose that an EXCEPINFO structure filled by IDispatch::Invoke should be cleared after use. Do I have to do this manually, or is there an API function for this?
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
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
|
|
|
|