|
Windows and other OSes generally isolate you from hardware through their abstraction layers. So you can't get the address of video memory and write a byte there. Instead you have to use DirectX, which is a part of OS and provides the programmatic interface for you. The layer between your program and hardware is not very thick in this case.
OTOH, if you want to go hardcore, you'll need to create a device driver. These are the beasts which are allowed to talk to hardware directly.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm trying to flush all system buffers associated with a drive on a Win 2k system. The only way I found is to use an Int 21h function 710Dh from the SDK documentation. Can anyone think of another simple way to do this?
I think this will help me with my testing, but it isn't worth spending a lot of time on.
Brad Manske
|
|
|
|
|
Brad Manske wrote:
The only way I found is to use an Int 21h function 710Dh from the SDK documentation.
Does Int 21h work on W2k?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm guessing that it will not. The page in the SDK is under a heading for 95/98/ME.
Brad Manske
|
|
|
|
|
I'd look into DeviceIoControl. There's a control code, FSCTL_LOCK_VOLUME, which apparently does flush the buffers. You could lock and unlock immediately. I've never done this, however - treat this with 1e6 milligrams of salt.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
As much as 1 kg. of salt? Perhaps you meant 1e3 milligrams.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
Perhaps you meant 1e3 milligrams
No, when I write 1e6 I mean 1e6
This DeviceIoControl is quite low level for my taste. If the guy looses his data, I don't want to be responsible
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz Sowinski wrote:
No, when I write 1e6 I mean 1e6
LOL
I didn't even notice the quantity specified. Now I feel like I really got my money's worth.
Brad Manske
|
|
|
|
|
I've looked through the documentation and it looks like it might work. If it doesn't, it would only be a little more work to try dismounting the volume. So I now have several more things to try.
Thanks for your help.
Brad Manske
|
|
|
|
|
|
I'm writing my own custom install program. I need to create links in the common desktop, common programs, and common startup directories. I use SHGetSpecialFolderPath to find these directories, but when I run the setup program on NT4 with IE6 I get told it can't find SHGetSpecialFolderPath in SHELL32.dll
Quoting from MSDN...
Requirements...
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later).
When calling SHGetSpecialFolderPath I write "BOOL success = SHGetSpecialFolderPath(m_hWnd, path, ssfCOMMONDESKTOPDIR, FALSE);" for example.
Well the NT4 PC that I'm testing it on has IE6 on it, so in theory should work. Anyone know why I'm getting this error please?
Jeremy Davis
http://www.astad.org
|
|
|
|
|
What version of shell32.dll do you Have?
You need the version 4.71 or later...;)
Best Reagards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hmm, I saw that in MSDN. How would I find what version I have? Also why didn't IE6 install the latest version? Thanks for your help anyway.
Jeremy Davis
http://www.astad.org
|
|
|
|
|
Can you run depends.exe on target system and check if Shell32.dll exports SHGetSpecialFolderPath? You'll be able to tell whether problem is located in OS or in your installer.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
... and if you're using GetProcAddress to get the SHGetSpecialFolderPath, do not forget that actual name is SHGetSpecialFolderPathA (if you want ANSI) or SHGetSpecialFolderPathW (if UNICODE is your cup of tea)
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for your help. In the end I've used SHGetSpecialFolderLocation to find the directories ppidl, and converted it into a path using SHGetPathFromIDList.
Jeremy Davis
http://www.astad.org
|
|
|
|
|
|
I created a window on the screen, but it doesn't seem to repaint itself properly. I've called the updatewindow.
|
|
|
|
|
|
Do you need to overwrite the mesage OnPaint...
Reagards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thank you for reviewing my code. Please tell me whether this will cause any resource leak. Thank you a lot for your time and help!
void CMyView::OnDraw(CDC *pDC)
{
CPen redBeaconPen;
VERIFY(redBeaconPen.CreatePen(PS_SOLID, 1, RGB(255,0,0)));
CPen * pOldPen = pDC->SelectObject(&redBeaconPen);
pDC->SelectStockObject(HOLLOW_BRUSH);
pDC->Ellipse(1, 1, 10, 10);
pDC->SelectObject(pOldPen);
}
|
|
|
|
|
redBeaconPen is not selected into pDC when its destructor calls ::DeleteObject. There will be no resource leak. Code is OK.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you for your quick reply!
|
|
|
|
|
Who has used the regexp object in system32\vbscipt.dll to parse the text string. I have tried it and make it work!
But i don't know why i can get only one match(that is the matches.GetCount()==1, even there are many exist. The next is my code:
void CInetSessionDlg::ParsePage(CString szPattern, CString szContent)
{
//m_regExp's declaration is on other place link this: IRegExp m_regExp;
//The class IMatchCollection and IMatch are both got from the tlb
//m_regExp = regExp;
try{
if(m_regExp.CreateDispatch(__uuidof(RegExp)) == FALSE)
{
AfxMessageBox("CreateDispatch Failed!");
return;
}
//IMatchCollection2 * temp;
m_regExp.SetIgnoreCase(TRUE);
m_regExp.SetPattern(LPCTSTR(szPattern));
if(m_regExp.Test(LPCSTR(szContent)))
{
//IMatchCollection2 matches=m_regExp.Execute(szContent);
ISubMatches matches = m_regExp.Execute(szContent);
for(long i = 0; i < matches.GetCount(); i++)
{
IMatch2 match = matches.GetItem(i);
//IMatch2 match = temp->GetItem(i);
CString strLink = match.GetValue();
m_cbHref.AddString(strLink);
}
}
}
catch(_com_error& e)
{
AfxMessageBox("Com Error occurred!" + e.Description());
return;
}
}
in this implementation file's header file:
i defined the RegExp(copied from the file RegExp.tlh got from vbscript.dll)
struct __declspec(uuid("3f4daca4-160d-11d2-a8e9-00104b365c9f"))
RegExp;
// [ default ] interface IRegExp2
Why? Who can tell me how to use vbscript.dll in VC++ 6.0
thanks a lot!
Sincerely, Davidlou
davidlou68@hotmail.com
|
|
|
|
|
Hello all,
I'm trying to avoid users to move my window and I've tried to overload the DefWindowproc() and OnWndMsg() in order to catch the WM_MOVING message, but it's doesn't work. Do you have any idea about how to manage this matter?
Thanks you,
parker john
|
|
|
|