|
same thing i did but the problem is with my massagebox
m_Thd->SuspendThread();
if(::MessageBox(h_parentWnd,_T("Do you want to stop scanning process?"), _T("Confirm"), MB_ICONQUESTION|MB_YESNO) == IDYES)
{
//MessageBox()
closefile = FALSE;
m_Thd->ResumeThread();
InterlockedExchange (&bexecution, 0);
Movfileisvalid = FALSE;
successoffile = FALSE;
//bexecution = FALSE;
}
//else
m_Thd->ResumeThread();
i place the massage box in if(condition) this massage box getting inactive state.once i click the cancel the thread will suspended state if its true then i have flag and resume thread to release the memory and to finish the thread .every thing is working fine but the problem is with the message box not getting close with one click i dont know what do please help me out
|
|
|
|
|
Well, if you did what I recommended then I dont understand why is your code full of with suspendthread and resumethread, moreover this code isn't enough for us to point out whats wrong with your code, we need the surroundings of this messagebox code plus the codepiece from the thread that triggers this messagebox. If you have a modal messagebox in your program implemented correctly then it can become inactive only if the activation goes to the window of another application.
|
|
|
|
|
Another sidenote if you are using MFC: If you create gui elements (windows, etc..) from another thread its a problem because MFC installs hooks on newly created gui stuff and registers this-and-that to its internal structures that are not thread safe and you can cause all kind of diseases!
|
|
|
|
|
Hi, dear all,
I need to read a component's description from a libary. but sometimes there are some garbage values at the end of descrtion string tail, I want to remove them.
So after get the description, I want to check character one by one, if the character is not a character input from keyboard, I will remove them.
But how can I do it? thanks!
|
|
|
|
|
Andraw111 wrote: but sometimes there are some garbage values at the end of descrtion string tail, I want to remove them.
- What type of the string is used ?
- Is the garbage offset allways the same ?
- Does the get-methode return the length of its answer as well ?
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
|
Probably not. I think a "description" of an item would include some punctuation and spaces.
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Then is_from_keyboard() below is better suited. It includes punctuation , spaces etc.
#include <iostream>
using namespace std;
int is_from_keyboard(int ch)
{
if ( ch>31 && ch<128) return 1;
else return -1;
}
int main()
{
char ch='z';
if (is_from_keyboard(ch))
cout<<"The ASCII character -> "<<ch<<" ("<<(int)ch<<") <- is from the keyboard. \n\n";
else
cout<<"The ASCII character -> "<<ch<<" ("<<(int)ch<<") <- is NOT from the keyboard. \n\n";
return 0;
}
|
|
|
|
|
void aChinaGarbageTest()
{
ASSERT(31 < _TCHAR('武') && _TCHAR('武') < 128);
}
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Hello everybody,
i am having a combobox (created through resource), and through code, i am updating the combobox with a list. for example, i am filling with "Kir" and "K". if i use CB_SELECTSTRING to select "K", its always selecting "Kir".
if i use "Kj" in place of "K", then the selection between "Kir" and "Kj" is fine.
from msdn definition :
It selects the first list item, if any, that begins with the characters in the specified text.
is there any other method to solve this issue?
iam trying like this.
SendMessage(hList, CB_SELECTSTRING , -1,(LPARAM)(LPCSTR)tt.c_str());
Thanks in Advance,
A. Gopinath.
|
|
|
|
|
Try to use the result of CB_FINDSTRINGEXACT for CB_SETCURSEL
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Hello,
sorry, i forgot to add that, i tried this also.
CB_FINDSTRINGEXACT also returns the same issue.
Thanks,
A. Gopinath.
|
|
|
|
|
It should return a zero-based index...
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Hello,
Yes, you are right, now its working. thanks.
Regards,
A. Gopinath.
|
|
|
|
|
Hi frnds,
anybody knows how to do it?
|
|
|
|
|
A C++ Implementation of the Rijndael Encryption/Decryption method [here].
Article explaining how to decrypt a file in C# using Rjindael Algorithm [here] and [here].
|
|
|
|
|
I construct a CRange object and then call CRange's function get_shapeRange() to get a CShapeRange object.
but it triggers an exception. (but it's OK to call another function get_InlineShapes) I have no idea why it triggers an exception.
does anyone knows why? thanks.
========================================================
By the way, I call this code in a keyboard hook function.
|
|
|
|
|
A question first : Are you using COM Interop?
When an exception is triggered, it is indicative that the function cannot be found.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
Yes, you are right. but what I can't understand is in VBA corresponding code works fun.
VBA code below:
selection.range.shaperange works fun
=================================================================================
I'm sorry! in word2010 it works fun. in word2003 not fun. oh, my god!!!
modified 8-Aug-12 21:38pm.
|
|
|
|
|
now it works fun again!!! what have I done!!!!!!
|
|
|
|
|
BianChengNan wrote: does anyone knows why? There is probably a bug in your code. You need to provide a snippet of the code and full details of the exception if you want a better suggestion.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thanks for your tip. code looks like following.
bool isRangeShape(__in CRange& oRange)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CShapeRange oShpRange = oRange.get_ShapeRange();
long lCount = oShpRange.get_Count();
if (lCount > 0)
{
return true;
}
return false;
}
modified 8-Aug-12 21:37pm.
|
|
|
|
|
I don't know why it works fun again. (but I think it should work fun!)
thanks for your help!
|
|
|
|
|
How to Decrypt file in C# that Encrypted in C using same Rijndael Algorithm?
|
|
|
|
|
Using the Rijndael algorithm implemented in C# (Microsoft gently provides it: "Rijndael Class"), of course.
Veni, vidi, vici.
|
|
|
|