|
Hello people!
I'd like to study some OLE programming in VC++. I have a basic knowledge of COM and i know so about the concept of OLE itself. I tried to google around for tutorials or documentation but what mostly turns up is either articles describing what OLE is (so no technical details about actually implementing it), articles about how to insert OLE objects into excel/word documents, articles about how to do this programatically in VB.NET, and so on... What i would like to know is how to go about creating my own OLE objects that can be inserted into a word document, or excel or whatever that provides support for OLE. This info must be out there and i am probably just looking for the wrong terms but my knowledge of the whole concept is too limited to actually know what to look for.
So if any of you knows a good place to start, please share, thanks in advance.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
See here[^], I would suggest you take particular note of the statement towards the bottom of the page that states:
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
It's time for a new signature.
|
|
|
|
|
So you mean OLE is actually a thing of the past? Damn, i am older than i thought, then what is used nowadays? Would it be ActiveX?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
modified on Friday, June 25, 2010 9:11 AM
|
|
|
|
|
I'm not too sure, it's not a technology I ever got into, but I think it was superceded by ActiveX. However, if you are wanting to get into new technology I think .NET, WPF etc may be better choices.
It's time for a new signature.
|
|
|
|
|
I think i will check around ActiveX to see if i can use it. Using .NET and WPF is planned for the future...
Thank you for the help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
See if you can find a second hand copy of "Inside OLE2" by Craig Brocksmidt. The details about COM in there are pretty dated but you should be able to spot those. The bulk of the book talks about the interfaces you have to implement to support OLE and is still surprisingly current.
Admittedly every time I read the book these days I wonder how the hell anyone ever thought OLE or COM were good ideas...
Cheers,
Ash
|
|
|
|
|
I thought the implementation of Ole was always a crappy idea...
Once you agree to clans, tribes, governments...you've opted for socialism. The rest is just details.
|
|
|
|
|
Thanks, i'll try.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Aescleal wrote: wonder how the hell anyone ever thought OLE or COM were good ideas...
They were good ideas. COM is about making language independent binary components and done a good job. OLE is admittedly complicated but the there's no simple solution to the problem it was trying to solve (object linking and embedding).
Steve
|
|
|
|
|
A function takes stream as input argument
functionname(LPUNKNOWN pStream)
I have character array and i need to use that function. How should i convert my array to LPUNKNOWN pStream
|
|
|
|
|
Typecast..
char arrc[10];
functionName((LPUNKNOWN) arrc);
|
|
|
|
|
I TRIED THE SAME BUT WHEN I CALL FUNCTION IT GIVES EXCEPTION.
|
|
|
|
|
LPUNKNOWN is a pointer to a IUnknown interface (a COM object). You can't simply cast your string like that...
|
|
|
|
|
LPUNKNOWN is a pointer to a IUnknown interface, which is a COM object. What are you trying to do exactly ? This is not the way you are supposed to work with the function. What is this function exactly ?
|
|
|
|
|
See here[^], I assume that the function requires a STD stream pointer.
It's time for a new signature.
|
|
|
|
|
You could try the following :
{
char chBuffer[] = "1234567890";
COleStreamFile cFile;
if (cFile.CreateMemoryStream()) {
cFile.Write(chBuffer, _countof(chFuffer));
functionname(cFile.Detach());
}
}
virtual void BeHappy() = 0;
|
|
|
|
|
Hi,
I am new bie to Dialog Based,
I have a combobox and i am reading some values from it.
For ex : the values are a,aa,aaa,b,bb,bbb
I have set the properties as DropDown,Sort and verticalScroll.
If i enter the any value in editbox.
For ex if i enter "a" in edit box.
I have to get values in sorted
Ex a,aa,aaa
Any help appreciated
Thanks
Raj
|
|
|
|
|
Use the CBS_SORT style when creating your combo box and the contents will be displayed in sorted order.
It's time for a new signature.
|
|
|
|
|
Hi sir,
I have selected the CBS_SORT,its sorting correctly.
My doubt is if we type manually in the edit box for ex : "a"
In the combbox only the data starting from "a" should be seen in the dropdown Combobox
Ex
a,aa,aa
Not the b,bb,bbb values
I hope you got it now.
Thanks
Raj
|
|
|
|
|
OK, I misunderstood your question. In this case you will need to filter the data in the combobox yourself, I don't know of any built in message that allows you to do this.
It's time for a new signature.
|
|
|
|
|
OK, I misunderstood your question. In this case you will need to filter the data in the combobox yourself, I don't know of any built in message that allows you to do this.<br />
Hi sir
I am not clear with this,"Filter the data in combo box" in the sense.
Whetheir i have to read the data and sort it.
Thanks
Raj
|
|
|
|
|
You can check the suggestion of Anand below, which may be the solution to your problem. Alternatively to do it yourself you will need to implement a catch for the CBN_DROPDOWN notification. You then populate the list items based on the contents of the edit box. There are problems of course when the user then changes the content of the edit box by backspace and retyping.
It's time for a new signature.
|
|
|
|
|
Hi sir,
Thanks for all your help.I have found the solution.
I am reading all the character from combo and storing it in map.
then i am reading the character from combo and Find() in given whole map.
I am tryig this code.
CString strValue;
CString strTemp;
m_CtrlComboID.GetWindowText(strValue);
std::map<CString,CString>::iterator it=m_mapId.begin();
m_CtrlComboID.ResetContent();
for(; it!=m_mapId.end(); it++)
{
strTemp = it->first;
strValue.MakeUpper();
if(strTemp.Find(strValue)==0)
m_PatientID.AddString(strTemp);
}
m_CtrlComboID.SetWindowText(strValue);
m_CtrlComboID.ShowDropDown();
the problem i am facing is,
1)The first string is getting set in the ComboBox.
2)when i type the first character in combo,it is getting the strings
related to the first character.
but i am not able to type in the second character,as the cursor is going in the first position.
The character which i have typed later is going first.
For Ex: First i will type the character as "P",
Second if i type "A" character in combo,its going before "P"
i.e "AP",but i need as "PA".
I am bit confused,
any suggestions
Thanks
Raj
|
|
|
|
|
Sorry, but I don't have MFC so I cannot reproduce the problem on my system. I wonder if any other kind reader has more experience with CComboBox.
It's time for a new signature.
|
|
|
|
|
If i undrstood you correctly, you want an Auto Complete functionality which we see many times in web based applications (In Google Search if we typed "as" then strings starting with "as" will appear in drop down automatically). For this to achieve, refer here[^], see if this is useful any way.
Good Luck.
Thanks,
Anand.
|
|
|
|