|
I got the following message in reply:
Thanx for the ideas !I created a worker thread .I am posting message to this worker thread only ! As you said I am passing the pointer to structure as WPARAM of the message !Now, in the ThreadProc of this worker thread I am typecasting the WPARAM of the message to the structure pointer and retrieve the members of the structure !Here only I am receiving the wrong value for some data members(Of the 11
members the last 4 member values are wrong !)What can be the problem ?I had tried with Mutex & critical section.Still the same problem exists !
How can I overcome this problem ?
Regards,
Y.Yamini Devi
|
|
|
|
|
Yamini,
It depends on how you know the members are wrong. If you are using a byte index into the structure and coming up with the wrong values, or if you are looking into memory locations directly, then the problem may be how the structure is defined. If you don't tell the compiler to pack the structure to 1 byte values then when it builds the structure it may pad spaces onto the end of intermediate values to get the 'correct' block sizes. If you have strutures within the defined 'communication' structure, this problem can be compounded. Check that you use the compiler directive "#pragma pack (1)" around your structures to be sure that the compiler is not adding additional empty bytes. Once all the structures are defined you can use "#pragma pack ()" to return the pack value to its previous setting.
Just a thought
Jeff
|
|
|
|
|
Hi, does anyone knows how I can get the handles to all child-windows of the Active or Foreground window? In WINDOWS CE! I know there is an API call EnumChildWindows, which work perfecly on the desktop, but is not supported on CE... (PocketPC)
Is there an other way to do this?
Greetings
Kasper
|
|
|
|
|
Now ,I have a question to cancel the Kana mode of Japanese IME,So I think must get current Kana mode,but how can I get it? use witch IME API to get it ?
Thank you !
|
|
|
|
|
Hello, the codegurus around the world.;)
Taking off and on IME may be easier to change the input type.
That is, if IME is on, the default input type is Kana.
If IME is off, the default input type is the direct input type like A-Z or number.
Check ImmGetContext, ImmGetOpenStatus, and ImmSetOpenStatus API function
and some sample code of IME in MSDN help to take on and off IME.
If you want to get the exact input type, we may have some code and
assgin the exact input type which we want.
But, so far, I have not succeeded this yet.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hello,
I got a major issue with trying to set DATE on files, not TIME, that works flawless. Here's the way I did:
void CDialogAttribs::DoDataExchange(CDataExchange *pDX)
{
...
DDX_DateTimeCtrl(pDX, IDC_ATTR_DATE, m_tmeDate);
// m_tmeDate is a CTime; IDC_ATTR_DATE is a "caleneder" control created in resource
...
}
{
...
CFileStatus fs;
CFile::GetStatus(file, fs);
fs.m_atime. = m_tmeDate;
CFile::SetStatus(m_strFile, fs);
// I KNOW for a fact that m_tmeDate holds valid numbers in month/day/year field
// before doing ::SetStatus..
...
}
ANY TIPS!?
Cheers,
Henrik
...
}
|
|
|
|
|
Hi I'm going to ask Who can I use TolTip in my program.
Thanks a lot.
|
|
|
|
|
you are in codeproject you find sample about that go to
Dialog and Windows Programming , then Tooltips in modal dialog boxes
AHMAD ALWASHALI
|
|
|
|
|
Hi
I'm Use CFileDialog to open file,
But I Want to open Folder Browse dialog.
Help me to do it.
Thanks a lot.
|
|
|
|
|
G'day Iman,
Check out the SHBrowseForFolder function in the docs.
That should get you started.
Steve
|
|
|
|
|
Hi Steve.
I Use the SHBrowseForFolder function But I don't know what Include file is for this function.
Iman Ghasr-e-fakhri
|
|
|
|
|
G'day Iman,
shlobj.h should do the trick.
Steve
|
|
|
|
|
Iman Ghasr-e-fakhri
|
|
|
|
|
Hi Steve
Please mote Help me
Iman Ghasr-e-fakhri
|
|
|
|
|
|
Hi
I want to use CreateProcess Function,
but this function not work true (not execute my .exe file).
Thanks a lot.
|
|
|
|
|
Hi,
I used the function CreateProcess in many applications.I can even start an ATL Service!
The code goes like this .
STARTUPINFO suinfo;
memset(&suinfo,0,sizeof(suinfo));
PROCESS_INFORMATION procinfo;
BOOL result;
for(int i=0;i<10;i++)
{
result=CreateProcess("<path of="" yr="" exe="">","",0,0,FALSE,NORMAL_PRIORITY_CLASS,0,0,&suinfo,&procinfo);
if(result)
{
cout<<"Client process created\n";
}
else
{
cout<<"Failed to create the client process\n";
exit(0);
}
}
This will work !
Y.Yamini Devi
|
|
|
|
|
<<< In the name of GOD >>>
Hi,
I need algorithm about sorting 1 to 9:
This program can give integer array and must sort this array.
for example:
int MyArray[5] = { 8, 0, 1, 4, 9 };
Sorting(MyArray, 5);
.
.
.
void Sorting(int Array[], int nNumber)
{
.
.
.
// MUST PRINT SORT RESULT
// IT MEAN:
// 0
// 1
// 4
// 8
// 9
}
I need this function very fast ...
Thanks for reply.
Hadi Rezaie
|
|
|
|
|
Hi all,
I wrote my function,
I'm so happy ...
Hadi Rezaie
|
|
|
|
|
I know you did it (bubble sort I presume) and I would encourage you to learn these sorts of things, but I would always consider using STL for containers and algorithms, because they are COOL !!
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi all,
I wrote my function,
I'm so happy ...
Hadi Rezaie
|
|
|
|
|
I have an owner drawn combo box where i do drawing in DrawItem function
I am placing a combo box in the resource editor and setting its properties to ownerdrawvariable and has strings. When I do this it works fine but I want to set these from the code because i won't have to remember them all the time.
I did this
void CXXXCombo::PreSubclassWindow()
{
ModifyStyle (0,CBS_OWNERDRAWVARIABLE|CBS_HASSTRINGS);
CComboBox::PreSubclassWindow ();
}
it did not work. Why ? How can i set these from the code by subclassing a combobox
Thanks.
|
|
|
|
|
Ok, now i'm kinda a beginner but, I think you need to use GetStyle and then or(|) the other to style bits on top of the getstyle return.
|
|
|
|
|
Put your ModifyStyle() call in PreCreateWindow() instead.
--Mike--
http://home.inreach.com/mdunn/
The Signature, back by popular demand: Buffy. Pajamas.
|
|
|
|
|
How do I place controls like a CComboBox on a flat CToolBar derived toolbar?
|
|
|
|