|
Because there is no change in the selection.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
As superman rightly said, clicking the same thing again and again is not changing the selection. Sending you the TVN_SELCHANGED message would be a bug.
You can use the NM_CLICK notification if you want to detect every click on the tree, but you'll need to do some work to work out which item is being clicked on.
(Hint, TVM_HITTEST).
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I used it but I am getting null in hItem.
void CXShellTreeCtrl::OnNMClick(NMHDR *pNMHDR, LRESULT *pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
UINT uFlags;
HTREEITEM hItem=HitTest(pNMTreeView->ptDrag,&uFlags);
*pResult = 0;
}
|
|
|
|
|
Look closer at the documentation for NM_CLICK. It does not send a NM_TREEVIEW, it just send a NMHDR, so you can't just cast it...
Here's my handler for a NM_RCLICK notification from a tree control.
void CMyClass::OnDeviceRClick ( NMHDR* pNMHDR, LRESULT *lResult)
{
*lResult = 1;
DWORD dw = ::GetMessagePos ();
POINTS pts = MAKEPOINTS (dw);
CPoint ptScreen (pts.x, pts.y), ptTree;
ptTree = ptScreen;
m_MyTree.ScreenToClient (&ptTree);
HTREEITEM hItem = m_MyTree.HitTest (ptTree);
if (!hItem)
return;
...
I hope that helps.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hello every one,
I'm trying to build a programe using C++ (Compiling it by using MinGW + Command-line, so no GUI is required) that do the following;
first; store files in one binary file, each file composed of metadeta, file deta. The file data is encrypted using a symmetric encryption algorithm. The algorithm is specified in the metadata.
the metadeta contains
File ID
File name
Original file size
Size of the encrypted data
File creation date
File last modification date
Encryption algorithm
Encryption key, which is encrypted using the user public key. The
public key encryption used is RSA with 1024 bit key length.
Checksum, which is computed using the hash function on the file
content. The hash algorithm used is SHA1.
- now when we add a file to the binary one we should do the following;
1. Provide the binary file, the file to be added, the encryption key and the public key
2. Encrypt the file using the encryption key
3. Encrypt the encryption key using the public key
4. Calculate the checksum of the file
5. Check if the file is already added to the binary file; if yes, delete it.
6. Add the metadata to the binary file
7. Add the encrypted file to the binary file
- then when we want to decrypt a file we should do the following;
1. Provide the binary file, the file ID to be extracted, the private key, the path where to extract the file
2. Check the file ID exists in the binary file. If not, return an error
3. Get the file metadata and the file encrypted text.
4. Decrypt the encryption key using the private key
5. Use the encryption key to decrypt the file encrypted text
6. Save the file in the specified path
SO would you please help me with building this programe ? and if there is any code that doing the previous, would you please send it to me?
Thanks in advance
|
|
|
|
|
sorry we dont build solutions for people - if you want that, go to rentacoder.. if you have an issue with a specific piece of code/sdk post it and ask nicely and you may find someone to help ....
I'd suggest you google crypto++ for instance for a toolbox/sdk - then you'll have to work through the examples etc to put it together - there are even some here on CP - there are commercial offerings out there as well that may help .. http://www.di-mgt.com.au/index.html[^] for instance
'g'
|
|
|
|
|
moody123 wrote: SO would you please help me with building this programe ?
Sure. What specifically did you need help with?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
At a minimum starting point:
class CBinaryFile
{
public:
CBinaryFile();
~CBinaryFile();
Add( LPCSTR lpBinaryFile, LPCSTR lpInputFile, LPCSTR lpEncryptionKey, LPCSTR lpPublicKey );
Extract( LPCSTR lpBinaryFile, LPCSTR lpFileId, LPCSTR lpPrivateKey, LPCSTR lpPath );
private:
std::string m_strBinaryFile;
std::string m_strInputFile;
std::string m_strFileId;
std::string m_strEncryptionKey;
std::string m_strPublicKey;
std::string m_strPrivateKey;
std::string m_strPath;
}; The downside to e-mailing me directly is that you are the only beneficiary. Keep the Q&A here so that all may benefit.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Ok David, sorry
i'm waiting
|
|
|
|
|
moody123 wrote: i'm waiting
For what?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi david,
Sorry but i forgot to ask you about (LPCSTR) what is this?
|
|
|
|
|
moody123 wrote: Sorry but i forgot to ask you about (LPCSTR) what is this?
const char *
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi All,
I have one com+ exe and one .net service is importing its function to begin the process, now how can i debug my exe, i mean to set a breakpoint or what whenever the service call my exe?
I tried with attach to process but i didnt see any process running.So please give me the way....
Thanks A Ton
Ash_VCPP
|
|
|
|
|
Have you tried Debug.Assert(false) in start of the service. Similarly you can place ASSERT(false) in those COM exes when that segment executed a modal dialog box would appear, you can load that in visual studio.
Regards,
Mushtaque Nizamani
|
|
|
|
|
Hi,
When i installed Rational clearcasetool and restarted system..and when im trying to build my vc++ application in VS 2005 im able to see the below error..
error result returned from 'cl.exe'.
Please help me out..
|
|
|
|
|
cl.exe is the compiler. make the window bigger, or scroll up, and find your missing semicolons.
|
|
|
|
|
Hi friend,
I would like to share several variables between two different processes.
I share a variable between two instances of one application using "#pragma section", I don't know whether I can use "#pragma section" to share variables between two processes or not.
However, please help me how can I share a variable between two different processes?
Thanks in advance.
|
|
|
|
|
If you need to communicate between two different applications, you can have a look at the IPC section[^] on codeproject (IPC=Inter-process communication).
If you want some advice about which technology to use, then you will need to describe what you want to do with more details. Why do you need to share those variables ?
|
|
|
|
|
Hi,
Since I have two applications, the first one is the writer and the second one is the reader and I want to share a memory between them instead of transferring through Messages.
I want to know how to share a memory between these two processes.
Is IPC (Inter-Process Communication) sufficient for me?
Thanks.
|
|
|
|
|
IPC is a generic term regrouping several techniques: sockets, memory-mapped files (shared memory), messages, ...
In your case, what do you want to do exactly ? Is the value of the variable changing ?
|
|
|
|
|
Yes, the data in the variables are changed every 1 second and another application needs to read the recently changed values.
|
|
|
|
|
If the application which should read the data has a message queue (win32 or MFC application for instance), you can use the WM_COPYDATA message. A tutorial here[^]
|
|
|
|
|
|
Hello,
I am using a CAnimateCtrl to show an animation during some lengthy operations (multiple calls to CreateProcess), but the problem is that my animation does not play, because the thread is obviously stuck with CreateProcess. So I need to run the animation in a seperate thread, but am not sure which is the best and shortest way to do this. Is there any good example how this can be achieved?
|
|
|
|