|
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
|
|
|
|
|
For Creation of the COM object try the following code
::CoInitialize(NULL);
IToolBar *pTest;
HRESULT hr=::CoCreateInstance(CLSID_Test,NULL,CLSCTX_INPROC_SERVER,IID_ITest,(void**)&pTest);
if(FAILED(hr))
return 0;
pTest->MsgBox();
pTest->Release();
pTest=NULL;
::CoUninitialize();
Knock out 'T' from CAN'T ,
You 'CAN' if you think you 'CAN'
|
|
|
|
|
WE ARE ATTACTING PIC TO A BLACK BOX TO TAKE CERTAIN READINGS.WE ARE ALREADY UTILYSING OUR PC TO SEND PRIORITY COMDS TO ANOTHER PIC. WE WANT TO ATTATCH A PEN DRIVE ON PICS COM PORT AND STORE READINGS TAKEN FROM BLACK BOX. CAN SOMEONE PL PROVIDE US WITH SUITABLE PROGRAM
SHERGILL
|
|
|
|
|
Never SHOUT in forums. It's considered rude and also hard to read.
Look here[^] for posting guidelines.
Also this forum is about COM, as in Component Object Model, not COMmunications ports.
If you need a terminal program I suggest TeraTerm[^] which usually covers the needs.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Shh!
Aside from being loud, this is confusing; you can't generally plug a pen drive into a com port, it goes into a USB host.
Or did you mean that your PIC is sending data to a PC com port and you want to store that to a file on a pen drive plugged into the PC?
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: you can't generally plug a pen drive into a com port, it goes into a USB host
Naah, you're assuming a lot here.
I know I used a barcode reader that had the shape of a pen that connected to the serial port about 12 years ago, he might have meant a "pen" like that.
Also the PIC16F877 doesn't have any USB ports, but it is equipped with a UART.
You'll find some more info about the MCU here[^].
This guy is completely off topic for this forum since he apparently misunderstood what COM means, but I suspect he needs some kind of terminal program.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Thanks Roger. As it happens, I have a couple of serial programmers for PIC devices, so the link to microchip was kind of redundant for me.
OTOH, a lot of other people might not have, so you've just educated a few
Most barcode wands from when I was a lad* were serial ones, except for the ones which were keyboard wedges. I don't think this USB malarkey will ever really catch on.
Steve S
Developer for hire
*No, I'm not admitting how many decades ago that is
|
|
|
|
|
Steve S wrote: No, I'm not admitting how many decades ago that is
Time flies, doesn't it?
BTW, sorry for telling you things you already knew. Apparently you're not the only one assuming things here... :->
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
It certainly does; of course, my eldest son is old enough to drink in California, and my daughter is old enough to vote in UK elections, so I shouldn't be surprised by anything any more!
No, it was a reasonable assumption.
I wonder if CP ought to run a poll on "Do you know anything about microcontrollers, and do you own a programming device for any of them?"
I never cease to be amazed by what people (including me, of course) don't know. I am given to understand that there are still people who believe that here in the UK we have a democracy and a free press...
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: It certainly does; of course, my eldest son is old enough to drink in California, and my daughter is old enough to vote in UK elections
Mmm, I know the feeling.
My step-daughter has recently made her choice for secondary upper school. Phweee!
A small comfort is the fact that she's my step-daughter. But anyway...
Steve S wrote: No, it was a reasonable assumption
Actually I was involved in developing the software for a large system with PIC17C756 MCUs.
That was a real challenge since this MCU only have 902 bytes of RAM and there were approximately 80 of them. Long days and nights.
But it was fun.
Steve S wrote: there are still people who believe that here in the UK we have a democracy and a free press...
Yeah, and here in Sweden we officially have virtually none that are unemployed and the small amount of people that cannot be hidden in the system are decreasing...
All the best
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
hey big guy
i know that pen drive goes into a usb port.ever heard off connectors that can be attatched to pic to to connect a pen drive. if you r still not getting it i will send a snap just to make u wise
|
|
|
|
|
hello friends following code is used to show outlook express send mail dialog box. But i am unable to attach a file.
can someone tell me how to do this?
code::::::::::::::::
_NameSpacePtr pNameSpace;
MAPIFolderPtr pOutbox;
_ItemsPtr pOutboxItems;
_MailItemPtr pNewMail;
CComPtr<attachments> pAtach;
RecipientsPtr pRecipients;
RecipientPtr pRecipient;
HRESULT hr = NULL;
_ApplicationPtr m_pApp("Outlook.Application");
CComPtr <_Inspectors> pInspectors;
m_pApp->get_Inspectors(&pInspectors);
m_pApp->get_Session(&pNameSpace);
pNameSpace->GetDefaultFolder(olFolderInbox,&pOutbox);
pOutbox->get_Items(&pOutboxItems);
VARIANT Type;
m_pApp->CreateItem(olMailItem,(IDispatch**)&pNewMail);
CComPtr <_Inspector> pInspector;
hr = pInspectors->Add(pNewMail, &pInspector);
if(FAILED(hr))
return ;
hr = pInspector->Activate();
if(FAILED(hr))
return ;
hr = pInspector->Display();
if(FAILED(hr))
return ;
|
|
|
|