|
Heh, turns out it was my fancy-schmancy customizations!
If you do the hosting (something like this: http://www.codeproject.com/KB/COM/cwebpage.aspx[^] ) and add support for a custom IDocHostUIHandler implementation you MUST return anything other than S_OK from the your TranslateAccelerator function implementation, otherwise things don't work right. Which is mentioned in the docs for this interface, it just didn't register with me. This of course is in ADDITION to doing something like the above to make sure the TranslateAccelerator gets properly called in the first place.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Hi all!
I would like to serialize/deserialize a std::vector of objects of a class into some buffer of a stream or of some other buffer. Can you address me about how to do this with the highest performance possible?
If I had an ARRAY of these instances..I would switch to a std::vector using this code:
CMyClass d[20];
// fill the array!
std::vector<CMyClass> v(d,d+sizof(d)/(d[0]));
What in case I use deserialization from a stream?
Is there a way to let the std::vector copy or use itself access the buffer
of a stream?
I would like to avoid the istream::read line below to go faster..do you know some way or address some nice super STL feature?
CMyClass d[20]; // buffer is created continuosly
istream::read( d, 20 ); // copy data from the buffer ( IS AVOIDABLE? )
std::vector<CMyClass> v( d,d+sizof(d)/(d[0])); // get the std::vector
Kind Regards
ManuStone
|
|
|
|
|
I am working presently in one project in my company, where I have to create a window using MFC in which I should be able to control each and every viewport independently in that output window (it is just like tiling all the sub-windows, but it shouldn’t contain the title name on every sub-window). Also I should be able to divide that window into as many viewports or sub-windows as I want and at any time. Here, splitter windows concept doesn’t work, because after I get the output window, I cannot change the number of view ports I want and also I cannot have control over the different panes of that window. So, how can I approach this problem. Can I get this with simple MFC? or I should go with any advanced concepts of Visual C++. I am working on Microsoft Visual Studio 2005. So, kindly help me as soon as possible.
K.V. Rama Krishna
|
|
|
|
|
Venkata Rama Krishna K wrote: Can I get this with simple MFC? or I should go with any advanced concepts of Visual C++
This isn't really a framework or language issue. It's just basic Windows.
You can create all the tile windows (as children of a window) and arrange
them any way you want to. Use the appropriate styles on the tile windows
so there's no title bar on them.
The basics of the windows is relatively simple with MFC....you're going to need
to actually write some code to do the layout
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
<br />
extern vector<int> v;
</int>
I want to get the number list included 5, 6
|
|
|
|
|
Can you rephrase your question?
Saurabh
|
|
|
|
|
Regards,
Vijay.
|
|
|
|
|
This should work
extern vector vData;
std::map<int, int> mapCount;
for(std::vector<int>::const_iterator it = vData.begin(); it != vData.end(); it++)
{
mapCount[*it]++;
}
std::vector<int> vFound;
for(std::map<int, int>::const_iterator itmap = mapCount.begin(); itmap != mapCount.end(); itmap++)
{
if(itmap->second >= 2 &&
itmap->second <= 5)
{
vFound.push_back(itmap->first);
}
}
codito ergo sum
modified on Thursday, April 24, 2008 1:24 PM
|
|
|
|
|
Wow, you must be genius. How did you figured that one
-Saurabh
|
|
|
|
|
Ah, 'Young One',
This is the merit of years of studying in the field of deciphering
the cryptic description of a new task that my boss give to me.
codito ergo sum
|
|
|
|
|
Thank you!
your code is I need.
|
|
|
|
|
I have retrieved data from an ASP page in XML format and parse it using MSXML. Now if i want do a reverse step i.e. if i want to send data back to ASP page then how would i accomplish it.
Thanks & Regards,
Hemang
|
|
|
|
|
What does the following code snippet (particularly THIS_FILE[]=__FILE__)signify ?
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
Note : The above code could be found in .cpp files.
|
|
|
|
|
These lines of code overload the new operator so that, when the program terminates, you can have a dump of the memory leaks and in which file (and line) they were allocated.
|
|
|
|
|
Any idea on where exactly __FILE__ is defined ?
|
|
|
|
|
It is a predefined macro. See here[^].
|
|
|
|
|
Thanks. Appreciate your effort.
|
|
|
|
|
Hello,
When we write an Activex using VC++ what are the data types we should use? In one sample code I saw VARIANT, BSTR datatypes used mostly. y we should use this datatypes?
Is there any specific datatypes that we are supossed to use along with Activex? Kindly clarify.
Regards,
LG
lgatcodeproject
|
|
|
|
|
lgatcodeproject wrote: . y we should use this datatypes?
They are automation data types, see, for instance [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
VARIANT and BSTR get used because they are compatible with 'automation'. What this means in practice is the interfaces can be called from languages like Visual Basic which only have automatic marshalling and can be called from C++ without writing any marshalling code. BSTR is essentially the same as VBs internal String class so it can make using the control from VB easy enough that even a VB programmer might manage it.
What type you use in your interface when creating ActiveX controls really depends on what clients you need to support.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Thanks for the reply. If my client is in C sharp that what types I am supossed to use?
Regards,
LG
lgatcodeproject
|
|
|
|
|
You need to use BSTR only. And Client can use datatype compatible to it. for C# String class can be used. Intellisense will tell you about datatype need to be used by client.
|
|
|
|
|
If I were you I'd ask a C# programmer, perhaps on the C# forum, I have NO idea, sorry.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Thanks for the concern.
Regards,
LG
lgatcodeproject
|
|
|
|
|
Can anybody tell me what are the diferent types of classes in C++
|
|
|
|