|
FISH786 wrote: CThreadDemoDlg* pDlg = pData->pObjDlg;
I smell MFC?
FISH786 wrote: hThread_2 = CreateThread(NULL,0,Thread_2,TD2,0,NULL);
And you're calling CreateThread() . First things first[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: FISH786 wrote:
CThreadDemoDlg* pDlg = pData->pObjDlg;
I smell MFC?
FISH786 wrote:
MessageBox("Done","Information",MB_OKCANCEL);
Calling MessageBox() without a window handle looks very MFC-ish to me, so I guess we are right in our assumptions...
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
So, we can confirm the crime.
But, I didn't go that far. I saw the CThreadDemoDlg* on the first few lines and assumed MFC. After all, the user (while sober) cannot come up with a funky name of that sort on his own.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hi,
i got some to store the data in tab. i got 1 propertysheet and 3 propertypage to build the tab..
each page i got the data nid to save when the user press the ''ok'' button.
but when i press ''ok'',it only store the data in current page only and not all the 3 pages.
i have read the msdn,it say when u press ''ok'',it will call ''killactive'' function, but when i switch between page 1 to page 2 it already call ''killactive''..zzzz
|
|
|
|
|
Try manually calling UpdateData for each property page when the OK button is clicked.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
i find out the solution already. Just add the OnOK() function in each propertypage.
When the user click the 'OK', it will call all the OnOK in each propertypage.
|
|
|
|
|
I have a BYTE array that contains a mix of ANSI and binary data. I'm wanting to convert the LPBYTE to LPSTR so that I can use the CString functions to pull substrings of either ANSI or binary data out of the BYTE array. I know that explicit casts can be hazardous, so I tried this:
int _tmain(int argc, _TCHAR* argv[])
{
unsigned char uc = 255;
cout << "unsigned char uc = " << (int) uc << "\n";
char c = (char) uc;
cout << "char c = (char) uc = " << (int) c << "\n";
uc = (unsigned char) c;
cout << "(unsigned char) c = " << (int) uc << "\n";
}<HR>
OUTPUT:
unsigned char uc = 255
char c = (char) uc = -1
(unsigned char) c = 255
I'm not 100% that this little test tells me it's safe to convert binary data in a BYTE array to a CHAR array and back...
Can you gurus help me out, again, please?
|
|
|
|
|
Yes, you can cast LPBYTE to LPSTR without really worrying too much.
Rather than use CString, though, I'd probably use either STL algorithms (because LPBYTE and LPSTR can both be treated as STL iterators) or Boost algorithms[^] (which are actually a lot easier to use than the documentation can make it appear), because they will act on your BYTE array, whereas a CString manages its own buffer.
Here's an example of how to find a substring in a BYTE buffer (I've used unsigned char* because I'm testing on OS X, not Windows, so I don't have a BYTE type!):
#include <algorithm>
#include <iostream>
int main()
{
unsigned char buffer[] = { 1, 2, 3, 'H', 'e', 'l', 'l', 'o', 34, 12 };
unsigned char* bufferEnd = buffer + sizeof(buffer);
char lookFor[] = "Hello";
char* lookForEnd = lookFor + strlen(lookFor);
unsigned char* where = std::search(buffer, bufferEnd, (unsigned char*)lookFor, (unsigned char*)lookForEnd);
std::cout << std::distance(buffer, where) << std::endl;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Any chance, anyone has code to maintain the format:
(###) ###-####
for a CEdit? There are some masked edit controls, but I
cant get them to blend in with what I have. Im just looking
for something small to let me maintain the above phone
format.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina
|
|
|
|
|
DanYELL wrote: Any chance, anyone has code to maintain the format:
(###) ###-####
for a CEdit? There are some masked edit controls...
Such as this one.
"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
|
|
|
|
|
Useless.
Masked Edit conrol is Native With Shell...
|
|
|
|
|
Yeah, but Im looking for just the important
code that would take the contents of a CEdit and
make it stay in the format:
(###) ###-####
I already have a class which makes it hot when I
scroll over it and I dont want to try to combine
that class with another class. Im trying to
keep this simple.
Any chance you have something where if I handle
OnChangeEdit() and I can then call this function
that will maintain that phone number structure?
|
|
|
|
|
DanYELL wrote: I already have a class which makes it hot when I scroll over it...
Makes it hot?
"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
|
|
|
|
|
Makes the edit box border glow red. Its very cool.
|
|
|
|
|
Doesn't sound all that involved. Can't you just mix the two together?
"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
|
|
|
|
|
How can I list the users yhat have accounts on an Windows system?
In VC++6, please?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Have you tried NetUserEnum() ?
"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
|
|
|
|
|
No. I will. Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
It's an old Win32 FAQ (several methods, from Net to COM)
See on Win32 grp;
|
|
|
|
|
I have searched for a while but I couldn't find anything useful. Thanks anyway!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: I have searched for a while...
Why? That reply was the epitome of useless. The least he could have done was narrow it down.
"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
|
|
|
|
|
Don't be so cruel. I'm pleased to receive an answer.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
If all you require for pleasure is an answer, I could have said, "The weather is warm today." What kilt provided you was about as helpful. Check his post history. He's just consuming space.
"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
|
|
|
|
|
> I have searched for a while but I couldn't find anything useful
There are at least 150 code samples (professional, from MS internal) for 20 years !!!
|
|
|
|