|
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
|
|
|
|
|
I am using MDI Architecture for my application.
I have the MainFrame Window within which I can create mulitple child windows.
My issue is that I am selecting a color from a dialog box.
When I click the apply button I want to invalidate all the child windows behind the dialog box so that the selected color is applied to the child windows even when the dialog box is visible in the foreground.
I used the following code but it throws a memory exception.
void CMyPropertySheet::OnApply()
{
CDC *pDC;
try
{
GetActivePage()->UpdateData(TRUE);
pDC = this->GetDC();
((CMyApplnView*)AfxGetApp())->OnDraw(pDC);
// ((CMyApplnView*)AfxGetApp())->Invalidate(FALSE);
}
catch(...)
{
AfxMessageBox(" Exception during OnApply");
}
}
I tried calling the Invalidate function of the View class as in the code above but the memory exception is still comming.Can anyone let me know what is the problem here.
laiju
|
|
|
|
|
For updating all the child windows i used the foll. code But it updates only the topmost window.
pMainWnd = (CMDIFrameWnd *)AfxGetMainWnd();
CMDIChildWnd *pActiveWnd = (CMDIChildWnd *)pMainWnd->MDIGetActive();
CKolOSDBuilderDoc* pDoc = (CKolOSDBuilderDoc*)pActiveWnd->GetActiveDocument();
if(pDoc)
{
pDoc->UpdateAllViews(NULL);
}
laiju
|
|
|
|
|
Try that
AfxGetApp()->GetMainWnd()->RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_ALLCHILDREN|RDW_UPDATENOW);
WBR
Henry
|
|
|
|
|
Is there a "serious" implementation of a MRSW-Lock available?
(I *think* a MRSW lock should do whatI need: I have a map with frequent concurrent reads and rare writes, contention during reads should be very low.)
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
If you can write the data atomically, then you shouldn't need a lock for the readers. If you can't then this[^] might help.
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"
|
|
|
|
|
I guess I can't update a std::map atomically
But the link looks good.
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Hi everybody,
I have a question .How can i print out the source code of my program, after i launch the program.
For example i run the program and it prints out on screen it's own source code ???
Thanks in advance
m0n0
|
|
|
|
|
Use OpenProcess, VirtualQueryEx, and ReadProcessMemory to access the memory. you are probably only interested int he parts of memory marked as MEM_IMAGE, as that contaisn the code. the other parts are other data.
Pass all this data to the disassembler, which will print out the assembly language
|
|
|
|
|
alternativly just have the source included in a text file with your program and just have it print it like any other text file.
|
|
|
|
|
One thing you have to realise is that the program has no idea what it's source code is, you will need to embed the source code as you would any other string, and then you can display it the same as you would any other string.
Christian Graus - Microsoft MVP - C++
|
|
|
|