|
Thahks a lot!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hello,
I have a 5.1 audio card and i want play a different song on each speaker.
Actually, I Create a directsound buffer, load my wav and i play it but It is played by all speakers.
I have no idea how to play my directsound buffer in one sepaker.
Thanks......
|
|
|
|
|
The 5+1 channels of Dolby 5.1 are a different sort of thing altogether to the Channels in direct sound. To control the Dolby channels directly you would have to use a low level API targetted at your sound card or write your own card driver. Depending on how your sound hardware is implemented it may not even be possible then.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
can anybody tell me.how to transfer data from one dialog to another....
thx in advance
SKDOBHAL
|
|
|
|
|
please read this[^] article for a first step in the mood...
|
|
|
|
|
In second dialog, add static text to dlg. In class wizard, give member variable name to static text, for example, m_str.
In Dialog 1, put this piece of code where u wnat.
CMyDialog2 dlg2;
dlg2.m_str= m_str2;
dlg2.DoModal();
try this..
|
|
|
|
|
Hi all,
I'm using mex command to compile (from Matlab) c++ source
code.
I need to write some data on serial port and I use
CSerialPort v1.03 class (you all know it! )
I use the following comand line:
mex -g MioFile.cpp cmvision.cpp serialport.cpp StdAfx.cpp
(mex only calls Microsoft compiler)
and the compiler answers:
c:\Programmi\MATLAB71\work\CamVision\serialport.h(31) :
error C2504: "CException": base class undefined
c:\Programmi\MATLAB71\work\CamVision\serialport.h(39) :
error C2061: syntax error: identifyer "CDumpContext"
c:\Programmi\MATLAB71\work\CamVision\serialport.h(42) :
error C2146: syntax error: ";" missing before
identifyer "GetErrorMessage"
c:\Programmi\MATLAB71\work\CamVision\serialport.h(42) :
error C2501: "CSerialException::CString": ..........
......and some other stuff!
I guess the compiler doesn't find afx.h, but....
......I don't understand! Someone can help me? How can i use correctly MFC from command line?
You can say, "why do you use Matlab?": I'm writing a dll and I need Matlab preprocessor...but this is not the problem...so if you prefer, forget Matlab and just think to the command line!
I use Microsoft .NET 2003
Thanks!
Stein.
|
|
|
|
|
you need to include a stdafx.h where is MFC stuff is included.
Greetings from Germany
|
|
|
|
|
Thanks for the answer....
so...I have stdafx.h in the same dir where I have all the files you see in the command line: is this wrong?
My stdafx.h has only 4 lines, these:
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxmt.h> // MFC multithreading
...and afxwin.h include afx.h which contains the implementation of CExcepion class...
Greatings from Italy!
|
|
|
|
|
Sorry this is ok!
Thanks for the answer....
so...I have stdafx.h in the same dir where I have all the files you see in the command line: is this wrong?
My stdafx.h has only 4 lines, these:
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxmt.h> // MFC multithreading
...and afxwin.h include afx.h which contains the implementation of CExcepion class...
Greatings from Italy!
|
|
|
|
|
I deleted and restarted my Visual C++ 2008 project typecase_vc (which is a translation of my good old faithful Borland 4.5 C++ project / program Typecase (including all source forms, at http://www.buckrogers.demon.co.uk/software/typecase.zip , Windows's Character Map but its screen display is much bigger and clearer)).
I fought my way through a barrage of incompatibility errors (mostly caused apparently by Visual C++ having three sorts of char* pointers, LPCWSTR and LPWSTR and char*) and I have at last got a typecase_vc.exe . On running that typecase_vc.exe, I found that the resulting typecase_vc program window displayed substantially the same as on the Borland 4.5 C++ version; but:
(1) At the left of the top edge the program name appeared in Chinese characters.
(2) The menu did not display.
(3) When the program displayed characters at the bottom of its window, each flashed as an ordinary character for a moment and then changed to a Chinese character.
When I tried to edit its resource file typecase_vc.rc, I got a small window with a message "Resource Editing is not supported on the Visual C++ Express SKU", and I had to use Notepad separately to set typecase_vc.rc to be the same text as in my Borland 4.5 C+++ version. What is happening? Is the free download of Visual C++ 2008 a "crippleware" and I must buy the full version of Visual C++ 2008 to get all the facilities? Where can I buy the full version of Visual C++ 2008 from? What price? Will it come properly in a box with a CD and manuals printed on paper? (I am in England.)
Where can I get the MSDN Library from?
Where can I get full help (preferably on my PC or on a printed book, not on the web) on all the Windows C++ functions (i.e. MessageBox(), SetFont(), etc etc etc etc, including all new functions?) I have some old printed books of that sort, but they are for versions about 10 years old, and do not have the new functions, nor such things as the difference between the three abovementioned sorts of pointers-to-character.
modified on Thursday, December 13, 2007 7:08:26 AM
|
|
|
|
|
I can help on the characters if nothing else as I'm still on VS2005. You've obviously missed the last decade or so so I'll tell you about something called UNICODE (www.unicode.org) which is a standard for representing characters across lots of languages. This obviously requires more than 8 bits or the 7 of old ASCII so new C++ types are required. We now have wchar_t typdef(ed) to WCHAR and sometimes defined underneath as unsigned short and LPWSTR which is a wchar_t* with LPCWSTR for const wchar_t*. These all refer to 16 bit UNICODE characters and strings.
All the old char, unsinged char, char*, LPSTR, LPCSTR stuff is the same as it ever was. To make things fun there is also TCHAR, LPTSTR, LPCTSTR which are defined as the the wchar_t equivalents if your project #defines UNICODE and _UNICODE (Use both because MS screwed up) and are defined to the char equivalents otherwise. You'll need to #include <tchar.h> as likely as not to make this magic work.
If you think this is all somewhat arcane just wait till you start getting deprecation warnings for not use Safe string functions.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
The string types are sometimes tricky, they are macros with different values for Multibyte or Unicode. The online docs at msdn.com are a rich source of information.
If you want to buy VS, you need to choose one of the many different versions. There are also special prices for students. (Im not a salesman)
Greetings from Germany
|
|
|
|
|
KarstenK wrote: The string types are sometimes tricky, they are macros with different values for Multibyte or Unicode. The online docs at msdn.com are a rich source of information.
If you want to buy VS, you need to choose one of the many different versions. There are also special prices for students.
Probably he already knows about.
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.
|
|
|
|
|
Anthony Appleyard wrote: Where can I get the MSDN Library from?
The library is available on line at msdn.microsoft.com, but access is slow. When you buy VC++, you usually get a version of MSDN with it, and you can also subscribe to it and get up to date versions of the library every three months.
Also, if VC2008 doesn't support resource editing, it is definitely cripple ware.
Nathan
|
|
|
|
|
I am using a tab control. I want to change the background colour of the tab control. I selected the ownerdrawfixed in the properties of the tab control. but still the execution does not come to OnDrawItem function
S.Yamini
|
|
|
|
|
What are you trying to do it?
Greetings.
--------
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
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
I am trying to change the background colour of the tab control. I will be able to it in drawitem method but the execution does not come to draw item method even if i select ownerdrawfixed in the properties of the tab control.
|
|
|
|
|
Where are you handling WM_DRAWITEM?
What about overriding CTabCtrl::DrawItem() in your tab control class?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The execution does not come to drawitem method. Why
|
|
|
|
|
The following code works for me...
Note you have to have a tab control subclassed by an object of your
CTabCtrl-derived class, otherwise DrawItem() will never get called...
class CMyTabCtrl : public CTabCtrl
{
public:
CMyTabCtrl() : CTabCtrl() {}
virtual void DrawItem(LPDRAWITEMSTRUCT );
};
void CMyTabCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
if (0 == lpDrawItemStruct->itemID)
dc.DrawText(_T("Tab 1"), &lpDrawItemStruct->rcItem, DT_CENTER);
else
dc.DrawText(_T("Tab 2"), &lpDrawItemStruct->rcItem, DT_CENTER);
dc.Detach();
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for ur help
I created a dialog based application.
I selected a tab control and moved to my dialog .
I have created an MFC class named CMyTabCtrl derived from CTabCtrl.
I added ur code to it.
I created a member variable in the dialog class for the tab control using class wizard which is
CMyTabCtrl m_Tab
I have selected the owner draw fixed properties
But still the drawitem of CMyTabCtrl does not called.
Please implement this and if u r getting let me know what u did.
|
|
|
|
|
I did the same - I used a DDX_Control() call in DoDataExchange() to
subclass the control...
void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB1, m_Tab); <-- make sure you use the right ID!!!
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have done that. But still does not work
Can u send me ur sample project.
|
|
|
|
|
It's a VS2008 project - is that OK?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|