|
Yes it's using DirectSound Version 9. The other's are grayed out.
However it's still my understanding that there is no IID_IDirectSoundBuffer9 etc. It's all still based on DirectSound8. Is this not the case?
The following line in Dsound.h is not grayed:
DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e);
I'm still also confused why the Build Error talks about _IID_IDirectSoundBuffer8 when neither I or my dog ever mentioned anything starting with an underscore.
Currently trying to modify the nearest large vertical surface by craniofacial means.
Thanks again for your responses. Your input is really appreciated.
|
|
|
|
|
The leading underscore is put there by the compiler and the actual value should be found in the Dsound3d.lib file. If you do not have that (and its corresponding DLL) on your system then you need to get a copy of Directx8 libraries; some more info here[^].
|
|
|
|
|
Hello,
i need to copy multiple selection to clipboard from my CListCtrl.
Now is that ctrl+c copy only the first selected item from my CListCtrl, but not the rest!
How to catch ctrl+c key's???
thanks for any help!
Arrin!
|
|
|
|
|
You can derive your own CMyListCtrl from CListCtrl and handle the WM_KEYDOWN or WM_CHAR messages. Then loop over the selected rows and accumulate them in a CString variable, appending CR/LF to each row (maybe also putting a TAB between columns). Finally, copy the CString variable to the clipboard.
|
|
|
|
|
Hello,
sorry for late answer, thanks for help!
Your idea works!
Regards
Arrin
|
|
|
|
|
Hi all,
I am implementing a GUI. I need a ListControl or GridControl that it allows to add any other controls on it.
Example: i want to add a ProgressBar into a cell, like FireFox's Download Manager
or i want to create a gallery control to display the image item, like the good sale web page.
|
|
|
|
|
|
Additionally, check out The Ultimate Grid Home Page[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
I just have those questions about those code snippets from the C++ GUI Programming with Qt 4 book:
GoToCellDialog::GoToCellDialog(QWidget *parent):QDialog(parent)
Does that mean we are inheriting QDialog(parent)? Or, what exactly does this mean?
setupUi(this);
Here, this code snippet is part of the gotocelldialog.cpp file, which is the implementation of gotocelldialog.h header file. What do we mean by this in this context? What are we trying to setup? And, what kind of setup will that be?
Thanks.
modified on Friday, April 15, 2011 4:11 AM
|
|
|
|
|
GoToCellDialog::GoToCellDialog(QWidget *parent) : QDialog(parent)
This is a constructor making use of the initialiser list (the part following : ) to intialise its base/parent.
GoToCellDialog probably is declared something like:
class GoToCellDialog : QDialog { ... };
The initialiser list is a way for constructors to initialise member variables and also call the parent constructor.
The code above would be 'equivalent' to:
GoToCellDialog::GoToCellDialog(QWidget *parent)
{
QDialog(parent);
...
}
What setupUi does I'm note sure, beyond what it's name says: setting up the UI.
|
|
|
|
|
Thanks for your reply. In the setupUi part, I specifically just want to now what this refers to.
modified on Thursday, April 14, 2011 8:03 AM
|
|
|
|
|
This is the pointer to the object you are currently 'in'.
Take for instance this program:
class A
{
int a;
int func()
{
return this->a;
return a;
}
};
class B : A
{
int b;
int funcB()
{
return this->b;
return b;
return this->a;
return a;
}
}
int main()
{
}
class C
{
int c;
static sc;
static int funcC()
{
return sc;
return this->sc;
return this->c;
}
}
So, to summarise: 'this' is a pointer in a class to itself (with itself is meant: the current instance).
|
|
|
|
|
Thanks for your reply and nice example.
The point I want to ask about here is when you mention "instance of a class". Like when you said "this refers to an instance of of A", and the you use return this->a; . But, why is a considered an instance of class "A"? Doesn't instance mean an object of class "A"? In other words, of type "A"? And, here, "a" is of type int .
Can you just clarify this point?
Thanks.
|
|
|
|
|
What I was referring to is that "the 'this' keyword refers to an instance of class A".
Sort of like A* this . When you then want the value of int a for that instance, you dereference the pointer and access a: this->a .
But because the compiler is smart, it'll also understand what you want if you simply write 'a' and omit the 'this->' part.
The reason I used a bit more confusing way of saying it (maybe), is that I wanted to make clear distinction between the class A and an instance of class A.
This distinction particularly comes into play when statics are involved (the telling difference is that there is no 'this' in that case, because you're not talking about instances of A when you're inside a static function using static variables).
Hope this makes it more clear. If not, feel free to ask more questions
|
|
|
|
|
Abder_Rahman wrote: ...I specifically just want to now what this refers to.
It's simply the current instance of the class.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
I have an Automation excel class with follow method :
CString CXLAutomation::GetCellValueCString(int nColumn, int nRow)
{
CString szValue =_T("");
if(NULL == m_pdispWorksheet)return szValue;
VARIANTARG vargRng, vargValue;
ClearAllArgs();
AddArgumentDouble(NULL, 0, nColumn);
AddArgumentDouble(NULL, 0, nRow);
if(! ExlInvoke(m_pdispWorksheet, L"Cells",&vargRng, DISPATCH_PROPERTYGET, DISP_FREEARGS))return szValue;
if(! ExlInvoke(vargRng.pdispVal, L"Value", &vargValue, DISPATCH_PROPERTYGET, 0))return szValue;
VARTYPE Type = vargValue.vt;
switch(Type)
{
case VT_UI1:
{
TCHAR nChr = vargValue.bVal;
szValue = nChr;
}
break;
case VT_I4:
{
long nVal = vargValue.lVal;
szValue.Format("%i", nVal);
}
break;
case VT_R4:
{
float fVal = vargValue.fltVal;
szValue.Format("%f", fVal);
}
break;
case VT_R8:
{
double dVal = vargValue.dblVal;
szValue.Format("%f", dVal);
}
break;
case VT_BSTR:
{
BSTR b = vargValue.bstrVal;
szValue = b;
}
break;
case VT_BYREF|VT_UI1:
{
unsigned char* pChr = vargValue.pbVal;
szValue = (TCHAR)*pChr;
}
break;
case VT_BYREF|VT_BSTR:
{
BSTR* pb = vargValue.pbstrVal;
szValue = *pb;
}
break;
case 0:
{
szValue = _T("");
}
break;
}
return szValue;
}
but haven't VT_DATE and VT_DATE | VT_BYREF case ... can you give me an help hand ?
I can show you what I try , but didn't working ...
Thank you .
P.S. I search to google , but I didn't find something appropiate ...
|
|
|
|
|
Initialize (i.e. construct) a COleDateTime object with vargValue.date and then use COleDateTime 's Format method, see COleDateTime documentation[^].
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]
|
|
|
|
|
Ok , I will try , but how VT_DATE | VT_BYREF case ?
|
|
|
|
|
What about:
COleDateTime dt(*(vargValue.pdate));
?
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]
|
|
|
|
|
Great ! Now does function well.
Thanks a lot !!!
I don't know how to test last case (VT_DATE | VT_BYREF).
|
|
|
|
|
Similar to VT_R8, except that you know the range of values. It's fairly easy to convert back and forth from Excel 2003's date time serial noting the leap year error in 1900. If using Excel 2007 or 2010, you need to know what date format is being used in Excel.
|
|
|
|
|
Hello Friends
Here is the Scenario:
#ifndef _A_H
#define _A_H
class TEST
{
int num;
void fun();
}
TEST* _pObj = new TEST();
_pObj->num++;
I want to access num in this cpp file also
How can I use the same Object in cpp file.
I tried by adding header file. And where do I declare and initialize the TEST class object pointer so that i can use it here
Thanks & Regards
Yogesh
|
|
|
|
|
You can do this by declaring TEST* _pObj as a global pointer in A.cpp.
In SAMPLE.cpp make the declaration extern TEST* _pObj globally.
This way you will be able to access the same object from both the files.
However, I think this is where you need a singleton class.
This way you will be able to access the one and only object of the class from any CPP file in which you include the A.h file.
Here are a couple of articles on singleton -
C++ Design Pattern: What is a Singleton class?[^]
Singleton Pattern & its implementation with C++[^]
|
|
|
|
|
Thx For Your Reply And I think creating Singleton is the right way to access.
But If i have SAMPLE.h then is there any way to access TEST class variable and without declaring Global Object pointer?
Regards
Yogesh
modified on Thursday, April 14, 2011 8:03 AM
|
|
|
|
|
if you have a class that's the owner/parent of both of those, he can pass the pointers to one another.
|
|
|
|