|
xivShin wrote: for char str[] , how can i assign it to a variable b?
char* b = str;
But remember that b is merely a pointer to the same string. If you want a copy then you need to use strcpy() or some derivative.
MVP 2010 - are they mad?
|
|
|
|
|
Hello,
i need to show text underlined in CListCtrl when someone goes with the mouse over them, the text is always URL Adress,
and when the mouse is over a other cell it should be a just normal text!
My solution is not good, because the row is bigger then before and it dont restore the text to previos style when i move the mouse to other cell!
(I try with CDC, CFont, LOGFONT, CRect etc.!)
I hope that is understandable what i mean!?
Is there any way to do this!
(i think i see here a sample with this, but i cant find it!)
Thanx for any help!
Arrin
|
|
|
|
|
Try CListCtrl::SetExtendedStyle()
refer: http://msdn.microsoft.com/en-us/library/bb774732(VS.85).aspx
|
|
|
|
|
Hi,
I am trying to run a .bat file through command prompt using code via ShellExecute but not able to do so.
ShellExecute(NULL,_T("open"),_T("cmd.exe"),_T("b.bat iiso.img"),szDefaultDir,SW_SHOW);
I am getting command prompt but not able to execute command (bat file)?
|
|
|
|
|
I think you may need the "/C" option to get cmd to run the batch file thus:
ShellExecute(NULL,_T("open"),_T("cmd.exe"),_T("/C b.bat iiso.img"),szDefaultDir,SW_SHOW);
MVP 2010 - are they mad?
|
|
|
|
|
Thank you, How to do in hidden mode?
|
|
|
|
|
I think its a bit messy doing that this way .. but you can START a seperate process as hidden from within the CMD session though .. so I think the command becomes
/C START /B b.bat iiso.img
note the 'START /B'. If you go to a cmd session and do a 'help start' you'll see what I mean.
The different way is to have an exe that does a createprocess and sets hidden etc on the window. There a utility here (below) and doubtless others around that may help
http://www.ntwind.com/software/utilities/hstart.html[^]
hth
'g'
|
|
|
|
|
john5632 wrote: How to do in hidden mode?
I presume by using the SW_HIDE flag as the lastparameter.
MVP 2010 - are they mad?
|
|
|
|
|
I use the CBalloonMsg class from codeproject to display balloons, but I can't find a way to make it appear above its tracking point. The class uses the TTM_TRACKPOSITION message to position the balloon, but this message only takes one argument, which is the tracking point. How can I specify the rectangle of the body of the balloon?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I have a problem with my mfc application.
In the application I open an usb output device, prepare a data block for playback
and then send the data with waveOutWrite. Afterwards I unprepare the data block and
then I close the usb device.
Under Windows XP my program works properly but under Windows 7 it fails.
When I watch the usb interface with an analyzer I see that under WinXP the prepared data
block is sent but under Win7 there are only sent zero bytes and not the data block.
Why does my application not work under Win7?
I am thankful for your answers.
|
|
|
|
|
Does waveOutWrite fails (did you check the return value)?
Could you please post the relevant code?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
waveOutWrite does not fail.
Here is the relevant code:
OpenDevice_out();
PrepareBuffers_out();
mRes=waveOutWrite(m_hWaveOut, m_stWHDR_out, sizeof(WAVEHDR));
if(mRes!=MMSYSERR_NOERROR)
{
StoreError(mRes,FALSE,"File: %s ,Line Number:%d",__FILE__,__LINE__);
throw m_csErrorText;
}
UnPrepareBuffers_out();
waveOutClose(m_hWaveOut);
waveOutPause(m_hWaveOut);
waveOutReset(m_hWaveOut);
|
|
|
|
|
I found the same symptoms with Windows 7 x64 and a Creative Labs X-Fi Surround card. waveOutWrite to the card was not audible, from both 32 and 64 bit executables.
You might like to look at http://www.pctipsbox.com/voip-apps-can-hang-on-windows-7 which confirms that there is a known problem with Windows 7.
As regards a solution, I notice that some sound does come through if the wave buffer is long enough. My original(inaudible) buffer was 2ms long - a single click. But if extended to 2 seconds, the sound (or at least the end of it) is audible. Time for some experiments ...
|
|
|
|
|
... I'm in luck for once. What seems to be happening is that Win7 is truncating the end of the buffer. In my case, it's the last 20 milliseconds or so. So by extending the buffer with 30ms of silence, I can get the result I want. No way, of course, of knowing if this will work with other cards, or even will always work with this card.
Another observation is that the buffer truncation didn't happen when I simultaneously played audio though the USB card from a separate application. As it happens, the application was a DirectSound C# signal generator, set to be silent.
Hope this helps.
|
|
|
|
|
Hi,
How to split a String(CString obj) in MFC based on some tokens like spaces. is there any method for this?
Thanks in advance.
Regards,
srinu
hi
|
|
|
|
|
Yes, you can use Find, ReverseFind, Left, Middle, Right and other methodes...
Just search a bit and choose what you want. Here[^] you have the msdn members list.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
thanks dude
hi
|
|
|
|
|
You are welcome
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|
|
Im using Setwindowpos of one dialog in another class.
if i use Setwindowpos,it shows arror.
I dont know how to get dialog handle.
My dailog class is CToolTab and id is IDD_TOOLBAR
I used
GetDlgItem(IDD_TOOLBAR)->SetWinowPos(.....
But fails.
Pls help me.
Anu
|
|
|
|
|
One possibility could be (calling the function inside your dialog, maybe when showing up):
CSomeDialog::SomeMethod()
{
HANDLE p_Dlg = GetDlgItem((HANDLE)this, IDC_YOURDIALOG);
}
afterwards you can give the handle to be used in other place.
Forget it. I choose false example from the net. Thanks for correction Stephen
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
modified on Thursday, January 21, 2010 4:43 AM
|
|
|
|
|
Nelek wrote: CSomeDialog::SomeMethod()
{
HANDLE p_Dlg = GetDlgItem((HANDLE)this, IDC_YOURDIALOG);
//...
}
This code is flawed:
GetDlgItem 's first parameter is a HWND , not a HANDLE . Your code will give a compiler error.- Even is the code was modified to look like the following, it would still be wrong:
HWND p_Dlg = GetDlgItem((HWND)this, IDC_YOURDIALOG);
Using what in this case is essentially a reinterpret_cast doesn't make a pointer a HWND . The cast just tells the compiler that although it knows a pointer isn't a HWND and would normally not normally compile code that incorrectly assumes it is, that in this case it should just shut-up and plough on.
Steve
|
|
|
|
|
Hmmm, thanks for the info.
I'll wrap the answer.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
if u have pointer of dialog, then
CWnd *pWnd=NULL;
HWND hWnd= m_pDlg->GetSafeHwnd();
pWnd=FromHandle(hWnd);
Regards,
Srinivas
|
|
|
|