|
You can define an enum inside a class. There's no need to typedef it - it's a type in it's own right.
|
|
|
|
|
but wont the enum's members (for lack of a better word) still be considered undeclared identifiers outside of the scope of the class?
|
|
|
|
|
Yes, but you can include the class scope operator to reference them from outside the class:
<br />
class square<br />
{<br />
enum squareType{LAND, WATER, BRIDGE};<br />
square(squareType type);<br />
};<br />
<br />
square a(square::LAND);<br />
square b(square::WATER);<br />
<br />
You can see an example of this in the MFC CFile class's open flags - CFile::modeCreate, CFile::modeWrite, etc.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Hi,
I try to kill a dialog(CPropertySheet) in a friendly way
and need to do this from another thread.
I've tried using PostMessage etc...
and EndModalLoop, EndDialog...
But nothing seems to be working for me.
Any tip would be appreciated.
Koo
|
|
|
|
|
hi
Take the handle of your dialog and then pass that handle to the EndDialog(). or you can try out this
Enddialog(1)
cheers
jhon
|
|
|
|
|
no no no, EndDialog() gets as parameter the value the dialog would return...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Sending messages to the PropertySheet does work. But you need its pointer of course.
pSheet->SendMessage(WM_CLOSE,0,0);
and
pSheet->SendMessage(WM_COMMAND,IDOK,0);
It seems to work fine.
this is this.
|
|
|
|
|
Thanks! The WM_COMMAND message did the job!
"There is an empty room full of people who think you are creative"
|
|
|
|
|
How to include files inside an .exe file and when it runs it will extract them?
thanks in advance
|
|
|
|
|
|
See if this article helps.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks alot for your replaies, they helped alot.. thanks again : )
|
|
|
|
|
Hi,
Can anyone tell me how Fast User Switching (using Windows XP) can be implemented in VC++? Or even suggest how it might be done?
Thanks very much,
dlarkin77
|
|
|
|
|
I am trying to retrieve the file summary information but keep receiving File not found. I have tried this on two different boxes. Can anyone suggest a reason for the failure? Can we agree the file is where I say it is?
Thanks so much in advance
Anthony Baker
awwbaker@yahoo.com
void CFileSummary::ExtractFileSummary(LPCSTR pFileName)
{
IStorage *pStorage = NULL;
IPropertySetStorage *pPropSetStg = NULL;
HRESULT hr;
WCHAR wcFilename[1024];
setlocale( LC_ALL, "" );
int i = mbstowcs(wcFilename, pFileName, strlen(pFileName));
setlocale( LC_ALL, "C" );
wcFilename[i] = 0;
hr = ::StgOpenStorage(wcFilename,
NULL,
STGM_READ | STGM_SHARE_EXCLUSIVE,
NULL,
0,
&pStorage);
// CMT: If its not the compound file
if (FAILED(hr))
{
hr = StgOpenStorageEx(wcFilename,
STGM_READ | STGM_SHARE_DENY_WRITE,
STGFMT_FILE,
0,
NULL,
NULL,
IID_IPropertySetStorage,
reinterpret_cast<void**>(&pStorage));
}
// [CMT]: Obtain the IPropertySetStorage interface.
hr = pStorage->QueryInterface(IID_IPropertySetStorage, (void **)&pPropSetStg);
// [CMT]: Dump properties.
DumpBuiltInProps(pPropSetStg);
// [CMT]: Release obtained interfaces.
pPropSetStg->Release();
pStorage->Release();
}
void CFileSummary::DumpBuiltInProps(IPropertySetStorage *pPropSetStg)
{
IPropertyStorage *pPropStg = NULL;
HRESULT hr;
// Open summary information, getting an IpropertyStorage.
hr = pPropSetStg->Open(FMTID_SummaryInformation, STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStg);
if(FAILED(hr))
{
printf("No Summary-Information.\n");
return;
}
|
|
|
|
|
Can you first check what PathFileExists returns?
Geert
Want to spread the newest version of your software automatically? Use Updater!
Visit my website: http://geert.yoki.org
|
|
|
|
|
I am trying to use the wavetables in a sound card in order to play a number of overlapping WAV files.
I'm trying to avoid getting locked into a particular manufacturer so does anyone know of a gneral purpose library ?
Thanks.
Leina
The tigress is here
|
|
|
|
|
Have you considered using DirectSound? It will happily play simultaneous WAV files.
Trollslayer wrote:
Leina
Had a name change, huh?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Had a name change, huh?
Don't type when you have the flu, all you have to do is cough at the wrong moment.
I would prefer to use wave tables as that would allow more simultaneous sounds which could be useful.
Eniale (contrary fluffy tigress)
The tigress is here
|
|
|
|
|
|
how can I save a stuct whit Cfile
here is my code but id does not work :
struct naslovniki
{
CString ime1;
CString naslov1;
CString posta1;
CString drzava1;
CString naziv1;
CString skupina;
};
CFile f;
f.Open("hasek.has",CFile::modeWrite|CFile::typeBinary);
naslovniki x;
x.ime1=m_ime;
x.naslov1=m_naslov;
x.drzava1=m_drzava;
x.posta1=m_posta;
x.naziv1=m_naziv;
x.skupina;
f.Write(&x,sizeof(naslovnik));///this is the porblem
f.close();
///---there is no hope for you---\\\
|
|
|
|
|
I bet it does work, it just is not doing what you are expecting.
If you were to TRACE("Size of my data is %u bytes.\r\n", sizeof(naslovniki)); I bet your number would be close to 24, and it would not change depending upon what text your CStrings contain. Now, why is this? Because when you write out sizeof(naslovniki) you are only writing out the contents of the CString class, not its data. In order to write out the text of the CString (unless you are using CArhive), you have to process the data yourself, writing perhaps the length of the text followed by the contents of the text itself.
|
|
|
|
|
|
ALTF4 wrote:
f.Write(&x,sizeof(naslovnik));///this is the porblem
Had you serialized naslovniki instead of using Write() , it would have worked.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi everyone!
Thanks for the reply about running an exe directly in memory!
Can anyone tell me how can I lock a process. I use CreateProcess function
Thanks!
|
|
|
|
|
Hi everybody. Does anybody know why a Visual Basic Application doesn't respond to the WM_PRINT messages that I send from Visual C++? I got a serious problem with this because I'm trying to get in a bitmap the contents of a Visual Basic window even if that window is not currently on screen.
I am thinking that maybe I can insert some Visual C++ hook or subclass in the VB window and somehow determine it to answer to the WM_PRINT message. But the problem is that VB windows don't have an OnPaint event........ so I'm kind of stuck.
Thanks for reading this : ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|