|
Hello!
My Problem is, that the Tabbed Rebar is as long as my Main Window. But I want that the tabbed rebar has a with of x=200 and height of y=100. How can I do that manuelle?
here is the link to the example:
http://www.codeproject.com/docking/TabedReBar.asp
thank you in advanced
|
|
|
|
|
I am developing a project using UDP protocol. How i can record sound and play from the server through my client machine. Please do reply asap.
** A Fighter Never Loses !!!!
|
|
|
|
|
there are quite a few example projects here on CP.com, use the search fnuction
modified 12-Sep-18 21:01pm.
|
|
|
|
|
i need tools which can read resource info of exe (or/and dll) files.
if more than one on the internet, please comment the "best" one you think for me.
thx
includeh10
|
|
|
|
|
|
I called FindFirstFile with the search mask "*.m3u" and it finds a file with extension ".mp3~" (i.e. with a tilda at the end)
Is this a bug in FindFirstFile, or am I doing something wrong?
|
|
|
|
|
No I don't think so,Could you show me your coding for that here !!!
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
WIN32_FIND_DATA findFileData;
HANDLE hSearch;
wxString strMask, strHit, strDiff;
strMask = "F:\\mp3\\Downloaded\\AC DC\\*.mp3";
hSearch = ::FindFirstFile(strMask, &findFileData);
while (hSearch != INVALID_HANDLE_VALUE)
{
strHit = findFileData.cFileName;
}
::FindClose(hSearch);
this will return a hit for any file with extension .mp3~ in said directory
|
|
|
|
|
|
It's the string class from the wxWidgets library
|
|
|
|
|
try to debug the it what exactly extension it has taken
i run this on my pc with CString its working fine
|
|
|
|
|
It doesn't make any difference what string class you use. The bug is in FindFirstFile.
|
|
|
|
|
Please I'd like to know the syntax in using WM_GETTEXT() , for use in retreiving text from an edit box. Where should this syntax be used?
|
|
|
|
|
it you know the ID of the Edit Box use
GetDlgItemText api
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Many (actually most) Windows API calls that operate on windows work by sending the target window a message. WM_GETTEXT is the message sent to retrieve a window's text. Both these code fragments will get the edit control's text:
char szText [TEXTLEN];
HWND hWndEdit = window handle of edit control;
::GetWindowText (hWndEdit, szText, TEXTLEN - 1);
char szText [TEXTLEN];
HWND hWndEdit = window handle of edit control;
::SendMessage (hWndEdit, WM_GETTEXT,
(WPARAM) TEXTLEN - 1,
(LPARAM) szText);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Hi guys,
i am new to multithreading in MFC. I have gone through many of the examples posted on CodeProject, but i am still not satisfied.
What i want to know is that, suppose i have my window, and i want to create a thread which, say, takes care of all the keyboard inputs, another thread which takes care of all the mouse inputs.
So far whatever examples and tutorials i have gone through first create a new window using a thread and then control all the operations. I want my parent window to have a thread to do all those stuff.
Can anyone help me out.
Thanx in advance!
AslFunky
|
|
|
|
|
With MFC, all GUI interactions must take place on the UI thread; this is inherent to the MFC architecture. You can, however, have separate worker threads that do the actual work associated with keyboard and mouse actions. The UI thread detects a keyboard and/or mouse action and starts a worker thread. The worker thread does its thing, and the posts messages back to the UI thread as necessary.
AslFunky wrote:
i want to create a thread which, say, takes care of all the keyboard inputs, another thread which takes care of all the mouse inputs
This statement sounds like you want to make a general change in how Windows applications work. I think you would be better off learning how to use the Windows input model, rather than trying to subvert it.
Software Zen: delete this;
|
|
|
|
|
Hi thanx for replying,;)
Is it necessary to do my stuff in a worker thread?
Actually i am a little nervous in creating a worker thread. i always have one confusion, how will i assign any job to a function which is not a member of my class. I mean, how will this function
UINT threadproc(void* para)
be able to access the members of my class when it is not a member of my class.
Can you please elaborate on this point.
Thanx in advance.
AslFunky
|
|
|
|
|
AslFunky wrote:
Is it necessary to do my stuff in a worker thread?
That depends on what you need to do. If the process takes a lot of time, you don't want to block the user interface while the process runs. That sort of thing is something you can put in a worker thread.
AslFunky wrote:
I mean, how will this function
UINT threadproc(void* para)
be able to access the members of my class when it is not a member of my class.
I always use something like the following:
class Stuff {
static UINT ThreadStart(LPVOID parameter);
UINT Thread();
};
UINT Stuff::ThreadStart(LPVOID parameter)
{
Stuff *_this = (Stuff *)parameter;
return _this->Thread();
}
UINT Stuff::Thread()
{
}
AfxBeginThread(ThreadStart,(LPVOID)this); The static member function matches the prototype required by AfxBeginThread() . You use the parameter to pass a pointer to an instance of your class. In my example, I passed the this pointer, which means I'm starting the thread from another member function of the class. The function that does the actual work of the thread is called Thread() , and since it is a member function, it can access other members of the Stuff class.
Software Zen: delete this;
|
|
|
|
|
Hi.
The easist way is use
AfxBeginThread (threadproc,hwnd,threadpriority)
threadproc : threadfunction with form
UINT threadproc(void* para)
{
//here do any thing
return true
}
hwnd:this is the para parameter on threadproc function
threadpriority:may be
1-THREAD_PRIORITY_NORMAL
2-THREAD_PRIORITY_LOWEST
.
AfxBeginThread return CWinThread object this object can be use to suspend and kill the thread
u can use many thread with the above story
If this not help u contact me on faroq_tam2004@yahoo.com
to get sample MFC program describe MFC MThreading
bye.
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
How would one retreive data input from the keyboard into a dialog box, which the compiler would process at run-time? I thought that making an instance of the class object which contains the data would be enough; but this doesn't cut it. See the following code:
<br />
void unbound(double *unbd, int nSize)<br />
{<br />
enum{nSize = 100};<br />
double A[nSize],B[nSize],k0[nSize],k1[nSize],s[nSize],expi[nSize],a[nSize],b[nSize];<br />
<br />
void bessk0(double *x,double *k0,int nSize);<br />
void bessk1(double *x,double *k1, int nSize);<br />
void ei(double *x, double *expi, int nSize);<br />
<br />
double x=0;<br />
<br />
s[0] = 1;<br />
a[0] = x*sqrt(s[0]);<br />
b[0] = 2*sqrt(s[0]);<br />
<br />
bessk0(a,k0,nSize);<br />
bessk1(a,k1,nSize);<br />
ei(b,expi,nSize);<br />
<br />
A[0] = k0[0]/(x*sqrt(s[0])*k1[0]);<br />
B[0] = (1-exp(-2*sqrt(s[0])))/(2*sqrt(s[0]));<br />
<br />
unbd[0]=0.5*(A[0]-B[0]-expi[0]);<br />
<br />
for (int t=1;t<nSize;t++)<br />
{<br />
CKuchukDlg MyClass; <br />
x = 2;
<br />
s[t] = 2*t*PI;<br />
a[t] = x*sqrt(s[t]);<br />
b[t] = 2*sqrt(s[t]);<br />
<br />
bessk0(a,k0,nSize);<br />
bessk1(a,k1,nSize);<br />
ei(b,expi,nSize);<br />
<br />
A[t] = k0[t]/(x*sqrt(s[t])*k1[t]);<br />
B[t] = (1-exp(-2*sqrt(s[t])))/(2*sqrt(s[t]));<br />
<br />
unbd[t]=0.5*(A[t]-B[t]-expi[t]);<br />
}<br />
}
When line **** read x=MyClass.m_dWellRad; the compiler didn't process the variable m_dWellRad at run-time, but simply used x = 0(initialization). When I used x=2, it used the latter variable.
How then can I make the compiler use the value input from keyboard into my dialog box at run-time?
|
|
|
|
|
The statement
CKuchukDlg MyClass; isn't sufficient by itself to display the dialog. You need to do something like this:
CKuchukDlg MyClass;
MyClass.DoModal(); That will display the dialog.
Software Zen: delete this;
|
|
|
|
|
const int MIN_ELEMENTS = 5;<br />
typedef int ArrayType[MIN_ELEMENTS];<br />
typedef int ElementType;<br />
<br />
bool findSum( ArrayType myArray, int n )<br />
{<br />
ElementType firstFiveSum = 0;<br />
bool isSuccess = true;<br />
<br />
if( n < MIN_ELEMENTS )<br />
{<br />
isSuccess = false;<br />
}<br />
else<br />
{<br />
for( int index = 0; MIN_ELEMENTS > index; ++index )<br />
{<br />
if( !( myArray[index] < 0 ) )<br />
{<br />
firstFiveSum += myArray[index];<br />
}<br />
else<br />
{<br />
isSuccess = false;<br />
firstFiveSum = 0;<br />
break;<br />
}<br />
}<br />
}<br />
<br />
std::cout << firstFiveSum << "\n";<br />
<br />
return isSuccess;<br />
}<br />
<br />
int main()<br />
{<br />
const int FIRST_ARRAY_SIZE = 7;<br />
const int SECOND_ARRAY_SIZE = 3;<br />
<br />
ArrayType myFirstArray[FIRST_ARRAY_SIZE] = {1,1,1,1,1,1,1};<br />
ArrayType mySecondArray[SECOND_ARRAY_SIZE] = {1,1,1};<br />
<br />
findSum( myFirstArray, FIRST_ARRAY_SIZE );<br />
<br />
return 0;<br />
}
Visual Studio compiler gives an error like;
cannot convert parameter 1 from 'ArrayType [7]' to 'int []'
How can I solve this?
Thanks in advance.
-
When in doubt, push a pawn!
-
|
|
|
|
|