|
i have a query that i have made a plugin(toolbar) that actually works in Outlook but the problem is that the Toolbar(plugin)also appear in the Microsoft Word and also in MS Excel i want that this toolbar plugin should only be seen and accessable in the Outlook so if anyone know the solution kindly help me in this matter
thanks in advance
|
|
|
|
|
you must write your registry information of plugin only in HK_LOCAKMACHINE\software\microsft\office\outlook\addin,
|
|
|
|
|
thanks for the information. i have done that as you told me but that doesnot work as at the beginning it doesnot show the plugin in MSOffice but when i open the outlook and then after that when i open the MS Office the plugin appeard in that application so can you told me how to handle this.
thanks in advance
|
|
|
|
|
Hi all
I'm a newbe with STL and templates.
I did my template class and I would like to create a function for writing it to output stream. I supposed that this last should be also a template function like the code below, but it doesn't work.
template<class T>
class CNeuron{
public:
CNeuron( const T obj ) {list_of_obj.push_back( obj );}
~CNeuron(){list_of_obj.pop_back();}
friend ostream& operator<<(ostream& os, CNeuron<T>& obj);
private:
vector<T> list_of_obj;
};
template <class T>
ostream& operator<<(ostream& os, CNeuron<T>& obj)
{ os << obj.list_of_obj[0] << endl;
return os; }
If I write a function specialized like the one below with string it works ,but NOT using other types(also simple like int):I've got linking error.
Why this happens?
Should I write a specialized function for each type?
ostream& operator<<(ostream& os, CNeuron<string>& obj)
{ os << obj.list_of_obj[0] << endl;
return os; }
void Main()
{
CNeuron<string> n("ciccio");
cout << n << endl;
CNeuron<int> n2(20);
cout << n2 << endl; //Linking Error
}
Regards
ManuStone
|
|
|
|
|
manustone wrote: friend ostream& operator<<(ostream& os, CNeuron<t>& obj);
You are missing its definition. Thats why getting linking error.
manustone wrote: last should be also a template function like the code below, but it doesn't work.
Do you get any compiler error, you should, with code given here.
|
|
|
|
|
Hi Passad
thanks for your response but if I try with
friend ostream& operator<<(ostream& os,CNeuron& obj);
as you suggested it doesn't work! But trying with
friend ostream& operator<<(ostream& os,class CNeuron& obj);
it tells me that CNeuron<T>::list_of_obj is not accessible because it is private.
If I make it publich everything is ok.
Do you know why it tells me that it is private even if it is friend? It seems that I'm using 2 different functions.
This is the code I used for the function. Since it is a class template I'm forced to use the T notation.
template <class T>
ostream& operator<<(ostream& os,CNeuron<T>& obj)
{
os << obj.list_of_obj[0] << endl;
os << obj.list_of_obj[1] << endl;
os << obj.list_of_obj[2] << endl;
os << obj.list_of_obj[3] << endl;
return os;
}
|
|
|
|
|
manustone wrote: template <class T>
ostream& operator<>(ostream& os,CNeuron<T>& obj)
{
os <> obj.list_of_obj[0] <> endl;
os <> obj.list_of_obj[1] <> endl;
os <> obj.list_of_obj[2] <> endl;
os <> obj.list_of_obj[3] <> endl;
return os;
}
This will not compile if T is string .
I can run your original code with these changes, But that will not solve your purpose.
template<class T>
class CNeuron{
public:
CNeuron( const T obj ) {list_of_obj.push_back( obj );}
~CNeuron()
{
list_of_obj.pop_back();
}
friend ostream& operator <<(ostream& os, CNeuron<T>& obj)
{
see for over loaded operator << for class T,
in your case T is string, not having operator <<.
return os;
};
private:
vector<T> list_of_obj;
};
void main()
{
Neuron<string> n("ciccio");
cout << n << endl;
CNeuron<int> n2(20);
cout << n2 << endl;
}
|
|
|
|
|
You are right!!!
Get rid of my first comment becasue it's true: I was using 2 different function.
If I put inside the class the same signature everything turns ok.
For my class I need to use this:
template <class T>
friend ostream& operator<<(ostream& os,CNeuron<T>& obj);
and the result is a wonderful super templatized function for streaming out!!!
Many thanks for your help!!!
regards
ManuStone
|
|
|
|
|
|
hi all
I'm newbe to STL and function templates.
I wrote this simple function and I expected to print a result to screen, but instead I've got an error. Why does this happen?
template<class T>
T Minimum(T a, T b)
{
cout << "Minimum by T" << endl;
return (a < b);
}
void main()
{
string a("StrA");
string b("StrB");
cout << Minimum( a,b ) << endl;
};
Regards
manuStone
|
|
|
|
|
The return type of Minimum() should be bool , no?
|
|
|
|
|
You should look at the error. Min/Max functions tend to return the min/max value evaluated while less/more return a boolean comparison of the two values.
template<class T><br />
bool Minimum(T a, T b)<br />
{<br />
cout << "Minimum by T" << endl;<br />
return (a < b);<br />
}
or
template<class T><br />
T Minimum(T a, T b)<br />
{<br />
cout << "Minimum by T" << endl;<br />
return (a < b) ? a : b ;<br />
}
m.bergman
-- For Bruce Schneier, quanta only have one state : afraid.
|
|
|
|
|
Many Thanks for your resposne
ManuStone
|
|
|
|
|
I have a custom tool bar which is inherited form WTL toolbar. In my tool bar I have a custom OnPrePaint paint function where I give custom texture for the background of the toolbar.
class CCustemToolBar : public CWindowImpl<ccustemtoolbar,ctoolbarctrl>,
public CCustomDraw<ccustemtoolbar>
It works fine. No problem.
Now I added Slider to bar. It shows perfect. Now if I resize me window the toolbar also updates and the Slider disappears. To sea the Slider I have to bring my mouse on the indicator (Just by guess) and it redraws it, but it does not draw the indicator sliding line. In other words after redrawing the toolbar the Slider does not update. I just run out the ideas what to do, even I tried not to paint that Slider window, which produces a black rang tangle. Any idea? You help will be very much appreciated.
Best regards,
Agha Khan
Agha Khan
|
|
|
|
|
I have a COM/ATL out-of-proc server whose main object is a singleton. I will call this Object A. Object A is called by other out-of-proc servers, but they are on the same machine so I am not worried about DCOM, etc. Object A uses a third party library (another set of COM objects) which generally works well but has a couple of known problems which can crash the Object A server (the problem can be reproduced). I have isolated this library into its own out-of-proc server to protect the Object A server. The library of the new server contains an object (I will call it Object B) which gets a reference to Object A. Object A releases its reference to Object B, but Object B maintains its own reference until its work is done. When the work by Object B is done, it notifies Object A, releases Object A and then releases itself. When all other servers are done and release Object A, then Object A is released and goes away normally.
If in the middle of its work, Object B crashes, it takes down its own server but the server which owns Object A is unharmed... except, that it still thinks there is another server out there which has a reference to it, so it won't shut down when all other out-of-proc servers have released their references.
Object A also maintains a watch on the Object B process so it knows if the Object B process has crashed.
Efforts to decrement the interface count on Object A when Object B crashes were not helpful and could have caused other problems (the reference count in Object A does not appear to be affected by Object B... I am assuming an internal reference count and an external referece count... but if so, where is the external reference count stored and can it be decremented???).
Ultimately, I need to get Object A back to the state it had before it created Object B.
I am also posting this in the COM forum.
Thanks.
m.bergman
-- For Bruce Schneier, quanta only have one state : afraid.
|
|
|
|
|
Hi
I am getting Access violation whenever I Query for IWMSBufferAllocator in my custom plugin.
Here is code
<br />
IWMSBufferAllocator *pBufAllocator = NULL;<br />
<br />
if(m_spClassFactory)<br />
{<br />
hr = m_spClassFactory->QueryInterface(IID_IWMSBufferAllocator,(void**)&pBufAllocator);<br />
if(FAILED(hr))<br />
return hr;<br />
}<br />
Debug output gives these lines
Access violation reading location 0xfffffffffffffff.
The thread 'Win64 Thread' (0x338) has exited with code 0 (0x0).
First-chance exception at 0x78d67d0d in WMServer.exe: 0x80010105: The server threw an exception.
m_spClassFactory seems good. Its not a null or invlaid pointer. I have also tried with code like MSDN where
hr = m_spClassFactory->QueryInterface(IID_IWMSBufferAllocator,(void**)&pBufAllocator);
is used as
hr = m_spClassFactory->QueryInterface(&pBufAllocator);
Can someone help? There is no other doc available.
-----------------------------
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi All,
I'm embarrased to ask this one, but for the life of me, I don't see what I am doing wrong...
I've gone as far as making the default ctor private, removing all ctors, removing all copy ctors, explicit ctors, etc. I've even changed the declaration fro char* s to char s[] .
Jeff
#include "stdafx.h"
#include <string>
#include "SecureString.h"
int _tmain(int argc, _TCHAR* argv[])
{
std::string s1 = "Hello World";
SecureString ss1 = "Hello World";
return 0;
}
#include <string>
#include <locale>
class SecureString : public std::basic_string< char,
std::char_traits<char>, CryptoPP::SecByteBlock >
{
public:
SercureString( char* s ) { operator=( s ); }
SecureString& operator=( char* s )
{ assign( s ); return *this; }
~SecureString( );
operator const byte*() { return reinterpret_cast<const byte*>( this->data() ); }
private:
SecureString();
};
|
|
|
|
|
Jeffrey Walton wrote: SercureString( char* s ) { operator=( s ); }
This c'tor should remove error message. Though, I'm confused with its definition in your code.
|
|
|
|
|
Hi Prasad,
Thanks, but no joy...
I've since tried forcing the "\TP" switch, breaking out the *.h file into a 'h' and 'cpp' file, etc. I also made it a basic class (no inheritance). I've got the damn thing reduced to a class with 1 ctor - the char*. It's also broken for me (or more correctly, I'm doing something wrong) with VS 8.0 - previous was 7.0.
I alsoe get missing return type with ctor: SercureString( const char* s ); .
Is the name "SecureString" used by VS? Earlier this week I installed the DDK. Could this be it???
Jeff
#pragma once
class SecureString
{
public:
SercureString( const char* s );
~SecureString( );
private:
SecureString();
};
SecureString::SecureString( const char* s )
{
}
|
|
|
|
|
Jeffrey Walton wrote: I alsoe get missing return type with ctor: SercureString( const char* s );.
Nice to see that your problem got solved. But, your class name was SecureString , not SercureString , wasn't that ?
You tried to declare your c'tor with wrong name. Thats why error regarding missing return type was there.
|
|
|
|
|
Hi Prasad,
prasad_som wrote: Nice to see that your problem got solved.
Yes - finally.
prasad_som wrote: your class name was SecureString, not SercureString,
I thought I cleaned up the typo this morning...
Jeff
|
|
|
|
|
Changing "SecureString" to "SecString" resolved the issue...
|
|
|
|
|
Change SecureString(char* s) to SecureString(const char* s) - there's no reason to not have the param be const . Then make the same change in the corresponding operator=
|
|
|
|
|
Hi Mike,
Thanks, but no joy...
I've since tried forcing the "\TP" switch, breaking out the *.h file into a 'h' and 'cpp' file, etc. I also made it a basic class (no inheritance). I've got the damn thing reduced to a class with 1 ctor - the char*. It's also broken for me (or more correctly, I'm doing something wrong) with VS 8.0 - previous was 7.0.
I alsoe get missing return type with ctor: SercureString( const char* s ); .
Is the name "SecureString" used by VS? Earlier this week I installed the DDK. Could this be it???
Jeff
#pragma once
class SecureString
{
public:
SercureString( const char* s );
~SecureString( );
private:
SecureString();
};
SecureString::SecureString( const char* s )
{
}
|
|
|
|
|
Changing "SecureString" to "SecString" resolved the issue.
I wish I would have tried it before removing the DDK...
Thanks for the help.
Jeff
|
|
|
|