|
Could it be that you also included your application's header in stdafx.h before MainFrm.h? But if all you do in your app's header is to declare a pointer to your mainframe then a simple forward declaration would do, would it not?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Hi Developers,
I am using a list control, in which i have to display a menu on the right click, if i have clicked other than column header. I have used HitTest and based on the retrieved flags I have try this.
Here m_SymList is List Control.
UINT uFlags;
m_SymList.ScreenToClient( &point );
int iIndex = m_SymList.HitTest( point, &uFlags);
if( uFlags & LVHT_ONITEMICON )
{
if( iIndex != -1 )
CreateUserClipBoardMenu( point );
}
Every time If i right click in header, it give a iIndex > 0.
as well as the ccondition if( uFlags & LVHT_ONITEMICON ) is also getting satisfied.
Can anyone help me to solve this issue.
Thanks.
Amrit Agrawal
|
|
|
|
|
Are you handling the HDN_ITEMCLICK notification?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
You could also catch the reflection of LVN_COLUMNCLICK
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnLvnColumnClick)
modified on Thursday, September 8, 2011 9:59 PM
|
|
|
|
|
wchar_t wch = 26342 ; // 26342 is a chinese character
wcout << wch ; // prints nothing
wout.imbue( locale("chinese-simplified" ) ) ;
wcout << wch ; // okay, prints '曦'
cout << '曦' ; //okay, as to cout,without having to set the locale, I can freely output chinese character ? why?
Second question is why setting up locale("chinese-simplified") for wcout that makes chinese character visible? Does the locale provide the font which supports the apprearance of our character?
Another question that confused me long is why can font like "Times New Roman" be used to display our ideograph? It's only 374k in size,which is simply uanble to represent 7000+ pictographs
modified on Thursday, September 8, 2011 10:54 AM
|
|
|
|
|
Hi,
I am diaplying some string using space as delimeter. It as coming aligned in notepad but not in
CRichEditCtrl . Shell I need to set any property for that?
|
|
|
|
|
Yes, you need to have a fixed-width font, like Courier New or Lucida Console. In such fonts, all characters - including space - have the same width, so it's easy to align things. Notepad uses a fixed-width font (it varies which depending on your version of Windows).
Most fonts are variable-width, where the width of a character depends on how much space it needs.
Compare the relative widths of these two strings:
"lililil"
"mumumum"
The yave the same number of characters, but the first will take up a lot less space in a variable-width font.
|
|
|
|
|
|
Hi
We need to encrypt a string and send across to a web service in C# over the internet. The webservice would decrpt the string and process it. How can I ensure that I use common encryption/decryption algorithms on both the client (C++, win32) and server side (C#)
I have tried to build a C++ dll with the enc/dec interfaces and give it to the C# service to call them using marshaling, but I am failing to get the desired result.
Please help
Thanks in advance
|
|
|
|
|
Use a standard algorithm. C#/.NET has a fair few in the System.Security.Cryptography namespace.
On the C++ side you just need to use the same algorithm. Check out Crypto++ for good and free implementations.
There is no need to have the exact same source code used in both C++ and C#, provided you use a well documented and standardised algorithm.
|
|
|
|
|
|
CAPICOM has been deprecated by Microsoft, and is not available on Windows 7. I wouldn't use it myself since it's limited in capability and a bit of a mess to use, if I recall correctly (haven't looked at it for years).
Oh, it says here that "only CAPICOM can decrypt a CAPICOM EncryptedData object" which would rule it out for you, if you need it to interop with C# (unless you wrap it in a DLL and call that from the server - was that what you tried?)
Since they recommend you use .NET crypto for any new development, you might as well create a simple DLL in C# or C++/CLI that exposes the same to the desktop application. (Which is the opposite of what you've tried already, but this way around it's likely easier to test and debug on a desktop.)
|
|
|
|
|
Thanx Orjan
I will try that out
|
|
|
|
|
You could also look at Cryptography API: Next Generation[^] which is the replacement for CAPI. I have no idea how 'good' it is, but I do know that the .NET framework has some CNG implementations of various standard algorithms.
Though, I must admit, it might just be easier to write the C# dll and interop with that.
|
|
|
|
|
Hi,
I am using a client socket to recieve messeges. If I click on stop button, a message is sent to serverwhich tells dont sent more messages but in the meantime server has sent 1000 of messages which I need not to recieve?
I need to flush all messages which has sent by the server after pressing STOP button and recieve only last message i.e server response againest STOP message. How to implement it?
|
|
|
|
|
Set a flag for the client socket: 'discardAllButTheStopAnswer ' would be a good name.
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
[My articles]
|
|
|
|
|
Like C-Pallini is already implying, flushing the messages just means receiving them in your application and then choosing to not do anything with them (discarding), until you reach the STOP message. In other words, after pressing the Stop button you need to at least keep receiving the messages until the STOP message arrives.
|
|
|
|
|
Is is possible to create a dbx file from number of eml file programatically?
|
|
|
|
|
Anything is possible if you know the file format.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
what is result of the formula?
1 & 0x01+1*3
it is zero actually.
I guess it equals 1&(0x01+1*3).
I need a priority table of C operators to know c operators' priority for +-*/&|~%
normally, * and / are executed before + and -.
how about others, do you have a link for this?
|
|
|
|
|
Your guess is right: here you are "C++ Operator Precedence"[^].
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
[My articles]
|
|
|
|
|
Hi all,
I want to store values from a file into a map (which I have selected) with three fields, namely number, name, model. With map can I do that? Since I can use a value pair how can I handle the third parameter.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Pack name , model into a struct or alternatively, into a std::pair .
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
[My articles]
|
|
|
|
|
Of course. That solved my issue.
Thanks!
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You are welcome.
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
[My articles]
|
|
|
|