|
Thanks to everyone who helped explain this. Thanks especially for the code fragments.
Why couldn't Science, in the long run, serve
As well as one's uncleared lunch-table or
Mme X en Culottes de Matador? James Merrill
|
|
|
|
|
I am having to implement a help key in a Property Sheet. The sheet consists of several pages derived from COlePropertyPage, and one that is an ATL implementation and is derived from IPropertyPageImpl.
I've managed to insert a help button by calling SetHelpInfo from the COlePropertyPage derived pages, but this button is disabled/greyed out when the ATL page is selected.
The property sheet container is not directly within my control as it is created via BEGIN_PROPPAGEIDS. How can I either force a global enable of this Help button, or enable it directly from the ATL page? Or any other imaginative solution would do!
Thanks
Debbie
|
|
|
|
|
I have problem with IWebBrowser2 or IwebBrowserApp.
I use ATL/COM .exe module build a program and
hr = CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (void**)&m_spIE);
To create IWebBrowser2
Later on I can call IWebBrowser2/IwebBrowserApp's Navigate sussefully.
But when I create a thread in my ATL/COM , use that thread
to call IWebBrowser2::Navigate or IwebBrowserApp::Navigate
It pop up error.
If it is IWebBrowser2::Navigate, it pops up Error MessageBox
Said "Run time error"
when I use IWebBrowserApp::Navigate, it don't work without any error messagebox.
When I debug. I found After I call Navigate. It throw out a error
message "0x800401F0: (no name)"..
But if I not call from the new create thread, nothing is wrong.
BTW, I use Visual C++ 5.0 without microsoft SDK.
My computer's IE is IE 6.0 Sp1.
Help...
Thank you
|
|
|
|
|
I have a question that I've found the answer to but still can't figure out.
I've got this class, let's call it "cat". Cat has many methods, but the only one i care about right now is "get_age()" which returns the cat's age as a float. Now I have a vector of these cats and wish to sort that vector by the cat's ages.
cats.sort() by cats.get_age().
I know I have to do something like:
bool apredicate(const cat& a, const cat& b)
{
return &a.get_age < &b.get_age;
}
I am completely confused on how this works (can't get it to work either). Could someone please show be a coded example... maybe then I'll get it
Thank you!
greg
|
|
|
|
|
Greg1421 wrote:
cats.sort() by cats.get_age().
Vectors don't have a sort method, but lists do. To compensate you will need to use the generic STL sort algorithm.
Greg1421 wrote:
return &a.get_age < &b.get_age;
The predicate should call cat::get_age() rather than taking its address.
Make sure that cats::get_age() is declared const, if it isn't the predicate won't compile.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class cat
{
public:
cat(int age)
: age_(age)
{
}
int get_age() const { return age_; }
private:
int age_;
};
bool apredicate(const cat& a, const cat& b)
{
return a.get_age() < b.get_age();
}
int main()
{
vector<cat> v;
v.push_back(cat(0));
v.push_back(cat(2));
v.push_back(cat(1));
v.push_back(cat(4));
v.push_back(cat(3));
v.push_back(cat(9));
sort(v.begin(),v.end(),apredicate);
for(int i = 0; i < v.size(); i++)
{
cout << v.at(i).get_age() << endl;
}
return 0;
}
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I made an ActiveX control. The control haven't input focus for keyboard, but I want to do something when keyboard event occurs. And now the control can't receive the WM_KEYDOWN or WM_CHAR message. What can I do? Please help me?
stanley
|
|
|
|
|
I have implmented a CAxDialogImpl derived dialog, and have defined the caption for the dialog in the resource editor. However, I would like to change the title bar caption dynamically. Though easily done with standard CDialog derived dialogs, this seems to be an effort with CAxDialogImpl derived dialogs. Anyone have any clues?
|
|
|
|
|
|
Well, I would agree that it should, but its not. The SetWindowText() function is returning success, but the caption remains unchanged. Did I mention that I'm creating this ATL based dialog modally?
"Never play drinking games with coffee"
|
|
|
|
|
Example Code
HRESULT MyFunc([in, optional] VARIANT Param1,
[out, optional] VARIANT Param2)
I'm concerned about the client calling sunctions which have optional arguments....my client in cpp raise an error on number of parameters. Any one with time n clue
Swimming in the fish bowl.
|
|
|
|
|
1. I think [out] and [optional] are not compatible
2. C++ client does not translate COM optional argument to C vararg. Instead, for each optional argument you want to skip you have to pass VARIANT of type VT_ERROR with a value of DISP_E_PARAMNOTFOUND
so in you case it would look like
VARIANT vOptional;
vOptional.vt = VT_ERROR;
vOptional.scode = DISP_E_PARAMNOTFOUND;
pMyObj->MyFunc(vOptional, vOptional);
|
|
|
|
|
Example Code
HRESULT MyFunc([in, optional] VARIANT Param1,
[out, optional] VARIANT Param2)
I'm concerned about the client calling sunctions which have optional arguments....my client in cpp raise an error on number of parameters. Any one with time n clue
Wimming in the fish bowl.
|
|
|
|
|
Example Code
HRESULT MyFunc([in, optional] VARIANT Param1,
[out, optional] VARIANT Param2)
I'm concerned about the client calling sunctions which have optional arguments....my client in cpp raise an error on number of parameters. Any one with time n clue
Wimming in the fish bowl.
|
|
|
|
|
Hi,
I have made a collection component, that inherits the functionallity from ICollectionOnSTLImpl ( but no fancy enumerator implemented).
My question is.. how can I use that in my MFC application ?, I'm using fancy smart pointers
<br />
MNEMOSYNELib::IXMLProjectsPtr pIProjects;<br />
<br />
Hr = pIProjects.CreateInstance(__uuidof (MNEMOSYNELib::XMLProjects));<br />
If I call something like "get_count" it fails... but how can I change to the collection interface without having to make a classic query interface, and for which Interface should I ask ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
In my project,I add a ATL object .The wizard add a ***.rgs file to my project.I open the file ,the text like this :
HKCR
{
NoRemove AppID
{
{2C0CA281-E28B-41CA-838C-C7D1BEA311D2} = s 'NewEn'
'NewEn.EXE'
{
val AppID = s {2C0CA281-E28B-41CA-838C-C7D1BEA311D2}
}
}
}
Who can tell me what these words mean?
|
|
|
|
|
Can I add some information into it?
|
|
|
|
|
This is information that is added into the registry to "register" you COM server with Windows.
HKCR = HKEY_CLASSES_ROOT
The rest of the information is assigning an unique identifier to your COM exe server, so whe you make a CreateInstance call it knows which application to load.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
|
I make a group of control .How can I identify them? Should I add a registry entry to registry? How can I do it?Help me.
|
|
|
|
|
The easiest(if not the only) way is to group them in one TypeLib
|
|
|
|
|
Hello,
I wanted to create a new ATL object (you know, right-click on projects classes, "New ATL-Object", the dialog where you normally can select "Simple Object" etc...), but this dialog doesn't contain any items any more! There are no icons like "Simple Object" any more!
Has anyone experienced the same problem? How do I get these items again?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
I thinke you should reinstall your VS 6.0.Gool luck!
|
|
|
|
|
Try "regsvr32 \Microsoft Visual Studio\Common\MSDev98\Bin\IDE\ATLOBJ.DLL".
Could be helpful.
rechi
|
|
|
|
|
Now it works normally again!
Thank you very much!!!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
register atlobj.dll again and try
[ It is possible to represent everything in this universe by using 0 and 1 ]
born to kill TRUE to the code Bad to the bone
Sleep all day. party all night. Never grow old. never die
It's fun to be a Vampire.
|
|
|
|