|
The last time you asked you were given a link to a very good article by Michael Dunn. Have you even bothered to look at it?
|
|
|
|
|
It was good artical.But i need very simple example.becouse i am new in vc++.
Plz help me
|
|
|
|
|
|
Davitor wrote: But i need very simple example.
That's as simple as it gets. Anything simpler and we'd have to come over and do the work for you.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
you welcome
|
|
|
|
|
Hi,
How can I know the number of serial ports on my computer using code?
Thanks,
|
|
|
|
|
|
|
You're welcome.
|
|
|
|
|
You may try this !
#define MAX_AVAIL_COM_PORTS 250
int i = 0;
char chTemp[3];
CString strCOMPort;
HANDLE hndCurrCOMPortObj;
for (i = 0; i < MAX_AVAIL_COM_PORTS; i ++)
{
itoa (i + 1, chTemp, 10);
strCOMPort = "COM";
strCOMPort += chTemp;
// Create handle for selected COM port and check its Avilability
hndCurrCOMPortObj = CreateFile (strCOMPort,GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
if (INVALID_HANDLE_VALUE == hndCurrCOMPortObj)
{
strCOMPort += strCOMPort + " port not available !!";
AfxMessageBox (strCOMPort);
}
else
{
strCOMPort += " port Available !!";
AfxMessageBox (strCOMPort);
CloseHandle (hndCurrCOMPortObj);
}
}
|
|
|
|
|
It won't work for ports having number >= 10 .
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]
|
|
|
|
|
Thanks !
i didn't knew this !!
but can u plz tell me the reason why this doesn't work ?
and can you give a solution to it, bcoz i need the requirement must be fullfilled in a small code rather that importing those classes !!
|
|
|
|
|
kapardhi wrote: i didn't knew this !!
I suspected so.
kapardhi wrote: but can u plz tell me the reason why this doesn't work ?
Because you must use UNC [^] names for serial ports with number >= 10 , e.g. port 12 UNC is \\.\COM12 (you may use always UNC names).
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]
|
|
|
|
|
may i know how to save and load a .xml by using c++ in MFC?
can send me any link?
thanks
|
|
|
|
|
You may use MSXML . Samples here [^].
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]
|
|
|
|
|
|
This may help
Don't forget to write this line
#import <msxml.dll> // The XML DOM
try
{
CString sQueryXML = "<start><sometag></sometag></end>";
CString sFileName;
sFileName.Format("%s","C:\\MyXml.xml");
MSXML::IXMLDOMDocumentPtr pDoc(__uuidof(MSXML::DOMDocument));
pDoc->async = false;
pDoc->loadXML((LPCSTR) sQueryXML);
pDoc->save((LPCSTR) sFileName);
}
catch(_com_error e)
{
ASSERT(false);
}
|
|
|
|
|
serach tinyXML in google ..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I have CMenu Items for a ClsiCtrl Corresponding to certain buttons.
I have kept all the buttons disabled except one.
Now the problem is in CMenu Item List the respective menu items for enabled button is enabled and for the remaining disabled buttons one menu items is being displayed as enabled. WHat can be the reason.
Please help me. My code is as follows:
CMenu mnu;
mnu.LoadMenu(IDR_VLIST_MENU);
CMenu* pSubMenu = mnu.GetSubMenu(0);
if(!m_btnViewDetails.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VLIST_DETAILS, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if(!m_btnFootPrints.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VLIST_FOOTPRINT, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if(!m_btnAccept.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VLIST_ACCEPT, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if(!m_btnInvite.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VLIST_INVITE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if(!m_btnDelete.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VISITOR_DELETE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED );
if(!m_btnIPBlocking.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VLIST_BLOCKIP, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if(!m_btnDeny.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VLIST_BUSY, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON ,point.x,point.y,this,0);
In the aboce code
if(!m_btnDelete.IsWindowEnabled())
pSubMenu->EnableMenuItem(ID_VISITOR_DELETE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED );
is seen as enabled although it should be disabled. m_btnDelete is also disabled.
Thanks in advance
|
|
|
|
|
just a question, are these menu item are mapped with correct function!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Did you set functions for them correctly?
|
|
|
|
|
Hi All
How can i copy folder tree?I have source and destination address.Plz help me
|
|
|
|
|
Use the SHFileOperation() function.
|
|
|
|
|
I am useing this code for copy.It's working for File.Then I am geting Error No.5
Access is denied.
CString source[100];
int path;
CString destination = _T("C:\\");
destination += PathFindFileName(source[path]);
if ( !CopyFile(source[path],destination , TRUE))
{
DWORD dwError = GetLastError();
CString szMsg;
szMsg.Format(_T("Error number), dwError);
AfxMessageBox(szMsg);
}
else
{
AfxMessageBox(_T("Success"));
}
modified on Tuesday, September 30, 2008 4:13 AM
|
|
|
|
|
You cannot use CopyFile to copy content of a folder.. Other wise you have to copy all the files in folder one by one..
|
|
|
|