here is the thing i am using PostMessage() to post several messages to a dialog box from several location this works just fine but when i am holding the dialog - e.g. dragging it - the dialog doesn't feel that a message is being sent i am using PreTranslateMessage() method to filter message so what is wrong with posting message to a dialog that is being hold - dragged - or if there is anything wrong, what is the solution for that thanks alot u guys
singersinger
Posts
-
PostMessage() doesn't work while dragging a dialog -
how to use project files inside another projecthi huys, may i ask, how to use project files inside another project thing is my application is part of a large project and now it is time to plug it into that project now i have two projects 1- my application 2- the big project all i need to do is to let the big project use my code some how so i could be able to make a button in the big project that finally create my application dialog and DoModal() it so am i gonna put all my source, hearder and resource files in the big project, or there is another simple way thnx 4 ur time and concern
-
why "default Beep" windows sound is playedyea this help now the problem solved thnx alot 4 ur help
-
why "default Beep" windows sound is playedin a dialog have some buttons and a treeCtrl i am overriding the function PreTranslateMessage to get the pressed key and do some processing depending on this key the problem is : whenever i press any key the default BEEP windows sound is played why is that and how can i stop it thnx 4 ur time and concern.
-
how to get the length (duration) of a wave filehey my dear code project members, i am having a problem trying to know the length of a wave file i tried mciSendCommand(wDeviceID,MCI_STATUS,MCI_TRACK | MCI_STATUS_LENGTH ,(DWORD)(LPVOID) &mciStatusParms); actually i don't know how to initialize the MCI_STATUS_PARMS "mciStatusParms" to get the length (duration) of the wave file so is this the right way and how can i get it work if it is not, wat is the right way to get the length of a wave file thnx alot 4 ur time and concern
-
calling a class member function in a seperate threadhello everybody !! my new problem is that i have a class that contain a some functions and some variables i want to execute one of these functions in a separate thread using AfxBeginThread(...); and FYI this function uses some member variables of the class to do it's work any idea ??? thnx 4 ur time and concern a.hemdan
-
executing a member function in a separate threadhello everybody !! my new problem is that i have a class that contain a some functions and some variables i want to execute one of these functions in a separate thread using AfxBeginThread(...); and FYI this function uses some member variables of the class to do it's work any idea ??? thnx 4 ur time and concern a.hemdan
-
CButton - Statesyou can write this in your void CTabOne::OnBnClickedRelayButton() function
CString text; m_cRelayButton.GetWindowText(text); if(text == "OFF") { m_cRelayButton.SetState(TRUE); m_cRelayButton.SetWindowText(_T("ON")); } if(text == "ON") { mm_cRelayButton.SetState(FALSE); m_cRelayButton.SetWindowText(_T("OFF")); }
i think this should do hope that it would help a.hemdan -
problem with converting CString to intnow i have a CString variable contain an integer value i wanna convert the CString to int so i used atoi() function
CString strNumber = "00123" int nNumber = atoi(strNumber);
then nNumber will contain (123)and it ignore the Zeros so what if i need these Zeros, what should i do also if i wroteint x = 0110;
x will result into (72) could anybody explain that thnx 4 ur time and concern -
passing param to the thread functionmaybe i am posting the wrong words, so to keep it simple i have a function that causes the application to wait till it finishes it's work, so normally you would make it a thread function and call it using AfxBeginThread to let the application continue working after calling it am i right in this ?? if i am right, this function uses some member variables that are declared in the class but the thread function can't see the member variables of the class am i right ?? if i am, i want to pass this member variable to the thread function so that it could understand it and work with it "while this varibale not a rgular data type, it is a typedef from a combination of types" can anybody help me with this for any other information do not hesitate to reply thnx alot 4 ur time and concern.
-
passing param to the thread functionyes it is included, but as u know the thread function is not a part of the class so it can't see the headers so it don't know what is CList exactly is problem right ?? i also tried to make the variable static and access it inside the thread function but it come up with an unresolved external error F Y I, this time was working perfeclty in a member function of the class but with the thread function, i don't know the problem
-
passing param to the thread functionthe problem is that i have a thread function
UINT threadfun(LPVOID param) { CList list = (CList)param; }
and i want to pass param to this function using AfxBeginThreadAfxBeginThread(threadfun,(WPARAM)m_List);
where "m_List" is from a type defined variabletypedef CTypedPtrList CList;
the compiler generate this error: 1- 'CList' : undeclared identifier 2- syntax error : missing ';' before identifier 'list' 3- 'list' : undeclared identifier i know he can not see this type "CList" inside the function but what is the solution of this , and how can i make it work thnx alot 4 ur time and concern. -
Problem with "PlaySound()" Function????that's not wat i want:doh: i want if it si running synchronously ---> to be able to stop the file playing:wtf: OR if it is running asynchronously ---> to detremine when the file finish playing:wtf: that's it;) i already able to know that the file finish playing when it is synchronously called cuz the function doesn't return untill it finish playing
-
Problem with "PlaySound()" Function????i am using the PlaySound function -Platform SDK: Windows Multimedia- to play .wav files, the problem is i need to know when this function finish playing the sound file and F.Y.I. when (fdwSound) parameter is set to SND_ASYNC "asynchronously", the function return immediately after beginning the sound. also when (fdwSound) parameter is set to SND_SYNC "Synchronous", the function wait till it end the file playing and then return i want to know : 1 - when the function finished playing the file if the (fdwSound)param. is SND_ASYNC 2 - OR how can i stop playing the file if the (fdwSound)param. is SND_SYNC thnx alot 4 ur time and concern !! it is good to be here
-
Access violation problemYes guys i was wrong i was passing the pointer to the constructor without initializing it this is wierd, how did i forget to initialize a pointer. thnx 4 u help it was really useful. :=)
-
Access violation problemthe thing is that this p_channel is assigned a value in the construction of the class, meaning that the constructor is responsible for initializing this pointer so when i call p_channel->"whatever" it is supposed that it is already initialized
-
File input/output helpu can use fopen method to open a file like this
FILE* pFile = fopen("file.txt", "a");
where "file.txt" is the file name and "a" is the mode (Opens for writing at the end of the file (appending)) u can learn more if u look for this function in the MSDN help use fprintf to write to the filefprintf(pFile, "%s\n",szString);
where szString is any Character string !! note: dont forget to close the filefclose(pFile);
-
Access violation problemhello, i have a 2 classes each have a couple of functions and variable the problem is: when i want to access a variable from class B inside a function in class A it come up with Unhandled Exception says: unhandled exception in "program name": 0xC0000005: Access Violation
class A { //////// B* p_channel; ///////// inline BOOL StartIVR(){ p_channel->m_started = TRUE; // error occur here} /////// } class B { ///////// BOOL m_started ; /////// }
also any other access to any member in class B will result with the same exception plz if anybody have any idea abt what's goin' on with this code, feel free to tell me :=) thnx alot for ur time and concern -
how to convert from WPARAM or LPARAM to CStringthnx alot 4 ur fast reply this code solved the problem thanks agian :rose:;)
-
how to convert from WPARAM or LPARAM to CStringi want to post a thread message that contain a CString variable like this:
PostThreadMessage(m_pThread->m_nThreadID,WM_MSG,0,(LPARAM)sString.GetBuffer(sString.GetLength()));
and then handle the msg at the Thread side to process this CString variable like this:CString s = (LPTSTR)pMsg->lParam; AfxMessageBox(s);
the code compile without errors but the data displayed in the Message box is not the same CString variable that have been sent so i wanna know wat is wrong with this code thnx 4 ur time and concern