|
hi,
thanks for reply,
i've managed with SetAt instead of remove and then setatgrow....
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi ive got app with Static splitter window. On each pane there is a listctrl (classic file explorer). When i first start my app i cant get any item focused even if i use SetActivePane and SetItemState. The same problem i have when i try to change view with tab key. The pane is active (or i quess so) but no list member is activated till i mouse click on it.
Can u help me plz ? Thanks in advance.
|
|
|
|
|
im making a mp3 player and i want to get the end o the music to pass to the next music in the list
im actually doing this:
while(MCIWndGetPosition(m_Video) == MCIWndGetEnd(m_Video))
{
::MessageBox(m_Video,"PING","PING",MB_OK);
}
but when the end position ends it doesnt return the testing message box
please somebody help me resolving this issue
Regards
AI_Warrior
Portugal;P
|
|
|
|
|
lol?
what you have here means that the program will loop THROUGH the message box until the end is reached.
once the message box shows, the execution stops here!
if you want to do it that way, it has to look like:
while( player_online )
{
play_next_track();
while( MCIWndGetPosition(m_Video) != MCIWndGetEnd(m_Video) )
Sleep( 1 );
}
but i don't know if this is the optimal way... i propose to use an existing mp3 player, until you've learned how it works the best way!
Don't try it, just do it!
|
|
|
|
|
Hi, how could I send a click through SendMessae or PostMessage ?? I want to use it with a parent window, this way:
CWnd* pWnd = GetParent()
pWnd->SendMessage(/* I don't know where I must send this and how */);
Thanks in advance.
MaestroProgramador.Com
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
Click what, a button?
I case of button:
pWnd->SendMessage(WM_COMMAND,MAKEWORD(::GetDlgCtrlID(wndButton),BN_CLICKED),(LPARAM)wndButton);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
For example, a listctrl is parent of a progress bar into it. I want when click on the progress bar to send the clic to the clistctrl that created it, that way. I would like to want how to send the click and where... I mean, where (HWND...).
Thanks in advance.
Rafael Fernández López.
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
|
Thanks mike for replying my message but what I wanted to know (and still don't know) is how to post the message.
<br />
CWnd* pWnd = GetParent();<br />
<br />
pWnd->SendMessage();<br />
Thanks everyone !!
Rafael Fernández López.
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
|
Yes, that's what I want to do, but I don't know the syntax of SendMessage. Could you type an example please ?
Thank you.
Rafael Fernández López.
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
From MSDN:
CWnd::SendMessage<br />
LRESULT SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );<br />
...<br />
Sends the specified message to this window. The SendMessage member function calls the window procedure directly and does not return until that window procedure has processed the message.
So in your case it would be
GetParent->SendMessage(WM_LBUTTONDOWN, vkeystatus, MAKELPARAM(x,y) );
GetParent->SendMessage(WM_LBUTTONUP, vkeystatus, MAKELPARAM(x,y) );
HTH
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
Thank you Jonas Larsson, Mike and Greg for your help. It was very useful.
Rafael Fernández López.
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
Hi guys,
I think this is an embarassingly dumb question but it's causing me grief so I thought I'd ask for help.
I have 2 list boxes in a modal dialog. I know how to fill them using AddString() just find but this relies on having created the dialog with Create() then accessing. When I create the dialog using DoModal() how/where/when do I use AddString()?
Any help much appreciated.
S
|
|
|
|
|
Hi,
since it is a Modal Dialog initialize the List Ctrl in the OnInitDialog() method.....
something like this:
BOOL CYourDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_FirstList.AddString(...);
m_SecondList.AddString(...);
...
...
}
hope this helps ya
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Cheers Yaron ... thanks a lot man, it worked first time.
|
|
|
|
|
i have a query: i use a dialog to take in user input for a rect dimensions but i tested it using AfxMessagebox and encounter assertion error, may i know where is the problem? i have a variable m_length of float type.
void Dialog :: OnOK
{
UpdateData(TRUE);
float length=m_length;
AfxMessageBox(length);
}
|
|
|
|
|
Hi,
this could occur due to several problems:
1) look in the DDX method of the class that the m_length is defined there.
if it is not than the UpdataData(TRUE) will not be valid for m_length.
2) use format string for the float variable as follows:
CString szLength;
szLength.Format(_T("%d"),m_length);
AfxMessageBox(length);
hope this helps ya
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
the DDX method shows:
DDX_Text(pDX, IDC_LENGTH, m_length);
does that mean that the UpDateData(TRUE) is unable to take in the float m_length? i need my member variables to be float preferably because i am using it for OpenGL rendering and as i encountered problems putting my variables into OpenGl that why i was testing to check whether my function can take in the float values.... is there a better way?
|
|
|
|
|
ok, i see the problem now...
open the class wizard (CTRL+W) and go to the definition of IDC_LENGTH and delete the m_str_length member. add a new member called m_length which will be not from CString type but from float type. then you should see an entry in the DDX as follows:
DDX_Text(pDX, IDC_LENGTH, m_length);
now the update data will hold the number within the m_length...and all u have to do is convert it to string and display it....
hope this helps ya
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
erm okie thanx but actually i made a typo error in my earlier message, it is really DDX_Text(pDX, IDC_LENGTH, m_length) already.. so that means AfxMessageBox cannot display a float directly? need to convert to String?
|
|
|
|
|
yes, just do it like this:
UpdateData(TRUE);
CString sz;
sz.Format(_T("%f"),m_length);
AfxMessageBox(sz);
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
coda_x wrote:
so that means AfxMessageBox cannot display a float directly?
Correct. Check the docs and the function prototypes.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
You cannot use AfxMessageBox with a float variable. You need a CString with the float variable this way:
<br />
void Dialog :: OnOK<br />
{ <br />
UpdateData(TRUE);<br />
float length=m_length;<br />
CString my_string;<br />
<br />
my_string.Format("%f", length);<br />
<br />
AfxMessageBox(my_string);<br />
<br />
}<br />
That's all, hope it helped.
Rafael Fernández López.
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
Hi all,
I have a problem.
I am reading a string from a vector :
CString szLine = m_vec[1];
int iLen = szLine.GetLength();
now i try to convert it to wide char (unicode) :
wchar_t* pwcSymbol = new wchar_t(iLen + 1);
MultiByteToWideChar(CP_ACP,MB_COMPOSITE,szLine,iLen,pwcSymbol,iLen);
then i just perfrom delete to the wchar_t* :
delete pwcSymbol;
i get an exception......
I read in the MSDN that the out buffer length (the 5th parameter in the MultiByteToWideChar) suppose to be more that the length of the multibyte string..... i am not sure what that means???
can any1 help?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|