|
You should be able to extrapolate from this:
bool IsMediaPresent( void )
{
MCI_OPEN_PARMS mciOpen = {0};
MCI_STATUS_PARMS mciStatus = {0};
MCIERROR mciError;
mciOpen.lpstrDeviceType = "cdaudio";
mciError = mciSendCommand(NULL, MCI_OPEN, MCI_OPEN_TYPE, (DWORD) ((LPVOID) &mciOpen));
if (0 == mciError)
{
mciStatus.dwItem = MCI_STATUS_MEDIA_PRESENT;
mciError = mciSendCommand(mciOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM, (DWORD) ((LPVOID) &mciStatus));
mciError = mciSendCommand(mciOpen.wDeviceID, MCI_CLOSE, 0, NULL);
}
return (1 == mciStatus.dwReturn);
}
|
|
|
|
|
First of all many thanks for taking the time to provide an answer , it is much appreciated. The code fragment works in detecting an empty drive or a drive containing a formatted CD, however it returns exactly the same responses for a drive containing a blank unformatted CD as it does for an empty drive. This is the same problem I have experienced using the CD IOCTL calls from the DDK, they all tend to return 21 (device not ready). The application I am trying to write is a service that will kick off a third party app to write a CD overnight if there is valid media in the drive. I don't want to kick it off if there isn't because the app will sit there with a non displaying dialog waiting for a response.
|
|
|
|
|
I derived the tab control and attached two dialogs.a piece of code
and see the attached pic,where two dialog attached to the tab.
class CBaseTabCtrl : public CTabCtrl
{
// Construction
public:
CBaseTabCtrl(int nType = BTC_NONE);
CDialog *m_tabPages[2];
int m_tabCurrent;
int m_nNumberOfPages;
//Operation
public:
//tab
void Init();
void SetRectangle();
....
CBaseTabCtrl::CBaseTabCtrl(int nType)
{
m_tabPages[0]=new CCamera1CtrlDlg;//CCamera1CtrlDlg is the dialog (IDD_CAMERA1)'s wrapper class.
m_tabPages[1]=new CCamera2CtrlDlg;//CCamera2CtrlDlg is the dialog (IDD_CAMERA2)'s wrapper class.
}
CBaseTabCtrl::~CBaseTabCtrl()
{
delete m_tabPages[nCount];
}
void CBaseTabCtrl::Init()
{
m_tabCurrent=0;
m_tabPages[0]->Create(IDD_CAMERA1, this);
m_tabPages[1]->Create(IDD_CAMERA2, this);
m_tabPages[0]->ShowWindow(SW_SHOW);
m_tabPages[1]->ShowWindow(SW_HIDE);
SetRectangle();
}
in the parent dialog's Oninitdialog()
BOOL CTestDlg::OnInitDialog()
{
...
m_tabCtrl.InsertItem(0, "ÉãÏñ»ú1", 0);
m_tabCtrl.InsertItem(1, "ÉãÏñ»ú2", 1);
m_tabCtrl.Init();
...
}
so when I handle the clicked button 's message in test dialog(parent dialog),I want to send message to the the IDD_CAMERA1 dialog.so I can handle the defined my message in IDD_CAMERA1 dialog .
above,how to send user defined the message to the IDD_CAMERA1 dialog .
attached IMG (there is a link)
|
|
|
|
|
I had solved the problem use the code:
m_tabCtrl.m_tabPages[0]->SendMessage(WM_COMMAND,(WPARAM)IDC_MODLESSDIALOGBTN);
|
|
|
|
|
" Linking...
MAPI.lib : fatal error LNK1136: invalid or corrupt file
Error executing link.exe. "
this is the error which i get when executing a file that includes mapi.dll
kindly help me in debugging it!
ranjani
|
|
|
|
|
There's nothing to debug. The file has either a corrupt header, or has a zero size. It sounds like you need to reinstall VS, thus getting a non-corrupt copy of mapi.lib.
|
|
|
|
|
What version of Visual C++ are you using?
I thought MAPI required MAPI32.lib?
Isn't MAPI.lib a 16bit lib?
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
MAPI>lib is a 16 bit lib only
wat iam using is VC++ 6.0 version!
donno what the problem is!
does MAPI require MAPI32.libb??
ranjani
|
|
|
|
|
In my MAPI programs I link with MAPI32.lib not MAPI.lib
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Hi
Anyone knows how i can change the color of the border of a group box?
Greetings
Jens
|
|
|
|
|
One solution is to derive a class from the group box control. Do custom drawing.
Kuphryn
|
|
|
|
|
i thought something like that
but i'm not that good at drawing things
any tutorials of it?
greetings
Jens
|
|
|
|
|
Look in CodeProject code section.
Kuphryn
|
|
|
|
|
It does not seem to be possible with CPen... anyone knows of an alternative? Could not find an article here with an alternative to CPen...
Any ideas?
Thanks
|
|
|
|
|
Will
int nWidth = 3;<br />
ExtCreatePen(..., PS_DOT, ..., nWidth, ...);
work?
|
|
|
|
|
It did the trick!
Thanks a lot! I had not RTFM for long and never realised that CPen had another constructor.
|
|
|
|
|
I learnt from a book how to create a database by creating a new wizard app SDI with ODBC support, but is there a way which i can incorporate a database into an already made SDI(without ODBC support)? coz i only realise i need a data base for my GUI after I did the SDI..thanx
|
|
|
|
|
first
#include "afxdb.h"
in your stdafx.h file
then simply add the CRecordSet Classes into your code with the ClassWizard
|
|
|
|
|
erm...I tried to add the CRecordSet classes but which base class should it b based on? Mi not veri familiar to c++ but need to do a project.
|
|
|
|
|
Hi all,
I want to write a serial and parallel device driver for Windows 2000. Does anyone of any good books on the market.
Thanks
Louis
|
|
|
|
|
I'll let you be the judge as to its goodness or relevance, but here is one:
http://www.flounder.com/books.htm#Developing%20Windows%20NT%204.0%20Device%20Drivers
|
|
|
|
|
I have an Icon resource containing a 16x16 icon and a 32x32 icon.
When I use :
<br />
DrawIconEx(dc, 0, 0, icon, 16, 16, 0, 0, DI_NORMAL);<br />
I always get the 32x32 version of the icon scaled into a size of 16x16, instead of getting the 16x16 version.
When I supply the same Icon to a CTreeCtrl's CImageList, it manages to display the correct icon (16x16) on the tree.
How can I force DrawIconEx or any other method to pull out the small version of the icon ?
Thanks
|
|
|
|
|
DrawIconEx() simply renders the icon associated with the icon handle. How this handle was obtained is the real issue here. Did you use LoadIcon() , LoadImage() , or CreateIcon() ?
|
|
|
|
|
Thanks for the explanation
I was using a simple LoadIcon . I now switched to LoadImage with the 'desired size'.
Thanks again
|
|
|
|
|
hi
How to create a win32 static library and export a function?
with VC6 + sp4
thanks.
|
|
|
|