|
hi again,
and did you add ON_COMMAND handlers for each menu command ?
-----------
Mila
|
|
|
|
|
I think instead of
TrackPopupMenu(..., pTreeCtrl->m_hWnd, ...);
you should try
TrackPopupMenu(..., m_hWnd, ...);
I hope this helps.
|
|
|
|
|
Hi.
I have developed an aplication that it read and write bytes through the serial ports. The program works fine, except for some PCs, (very few ones). While is reading the data, sometimes it ends the communication suddenly.
I found that it happend because ClearCommError fails, I have the following code:
<br />
<br />
...<br />
<br />
while( retry> 0 )<br />
{<br />
<br />
if( !ClearCommError( idCommDev, &dwError,&comstatInfo ))<br />
{<br />
lResult = 116;<br />
dwLasError = GetLastError();
return lResult;<br />
}<br />
<br />
if( !PurgeComm( idCommDev, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR ))<br />
{<br />
lResult = 115;<br />
return lResult;<br />
}<br />
lResult = TXPacket(dataTX, 250);<br />
<br />
if( lResult!= 0 )<br />
return lResult;<br />
<br />
lResult = RXPacket(dataRX, timeout);<br />
....<br />
<br />
This is my problem. In some PC, (I don't know why), the function ClearCommError() fail with no error code available with GetLastError(), so I can't figure out what is happened.
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
hi everyone,
I downloaded a E Y Player from Code project from the following link
http://www.codeproject.com/useritems/Media_Player.asp[^].... when i try to play *.mpg, *.avi,*.vob,*.dat files its playing fine .... BUT WHEN I TRY TO PLAY m2p files its giving error in MCIWndCreate(...) method .....
SO CAN ANYONE TELL ME WHETHER MCI SUPPORTS M2P FILE FORMATS(*.m2p files)?????????????
Thank You,
With Regards
Raja Bose
|
|
|
|
|
Dear All,
I am working with MSXML.
I cant write integer values on XML files as a tag.
Why ?
I want to write integer vaules into XML File.
Kindly Help me.
Thanks.
|
|
|
|
|
Sakthiu wrote: I cant write integer values on XML files as a tag.
Why do you want to do that?
Can't you prefix with an alphabetic char the numbers?
|
|
|
|
|
Hi,
I am having a SafeArray of bytes .I should know the size of it.
Is there any way where we can get the size of safearray?
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
My suggestions - look up the following functions:
SafeArrayGetDim(...)
SafeArrayGetElemsize(...)
SafeArrayGetLBound(...)
SafeArrayGetUBound(...)
Get The number of dimensions using the first function, use the third and forth ones to determine the number of elements in it. Use the second function to verify element size (size == 1 if using BYTE s/char s).
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
i use the SHBrowseForFolder() API to prompt the user to select a folder.
but i can't open the dialog in a particuliar folder. how to do that please ?
-- TTD --
|
|
|
|
|
The pidlRoot parameter of the BROWSEINFO structure is used for that.
Do a search for that member and you will find ways to manage the ITEMIDLIST required for the structure.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
yes, i know that james, sorry for not having pointed out my tries.
actually, i called CoInitialise(NULL) first, and i tried to use SHParseDisplayName() to create a PCIDLIST_ABSOLUTE to give to the pidlRoot attribute of the structure, in vain
-- TTD --
|
|
|
|
|
super_ttd wrote: but i can't open the dialog in a particuliar folder. how to do that please ?
Have you supplied a callback function? That is where you establish the default folder.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Have you supplied a callback function?
hu, no ! i thought callbacks were only to extend the dialog style/events management...
Sir, can i ask you please to show me how you write such a function ?
thank you very much for your answer
|
|
|
|
|
super_ttd wrote:
hu, no ! i thought callbacks were only to extend the dialog style/events management...
You can use it for whatever you need.
super_ttd wrote: Sir, can i ask you please to show me how you write such a function ?
I could, but Googling for examples would prove a much more useful exercise.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Symphton
When I delete directory which contains some files I will not get message FILE_ACTION_REMOVED. This happens int XP professional SP1. I can't install SP2 because some others reasons.
My code
initialization of watching
DirInfo[0].hDir = CreateFile(sDirectory,
FILE_LIST_DIRECTORY,
FILE_SHARE_READ |
FILE_SHARE_WRITE |
FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS |
FILE_FLAG_OVERLAPPED,
NULL
);
if(DirInfo[0].hDir==INVALID_HANDLE_VALUE)
return IDS_ERRCREATEFILE;
hCompPort=0;
hCompPort=CreateIoCompletionPort( DirInfo[0].hDir,
hCompPort,
(DWORD) &DirInfo[0],
0);
if(!hCompPort)
return IDS_ERRCREATEIOPORT;
ReadDirectoryChangesW( DirInfo[0].hDir,
DirInfo[0].lpBuffer,
MAX_BUFFER,
TRUE,
FILE_NOTIFY_CHANGE_SECURITY|
FILE_NOTIFY_CHANGE_CREATION|
FILE_NOTIFY_CHANGE_LAST_ACCESS|
FILE_NOTIFY_CHANGE_LAST_WRITE|
FILE_NOTIFY_CHANGE_SIZE|
FILE_NOTIFY_CHANGE_ATTRIBUTES|
FILE_NOTIFY_CHANGE_DIR_NAME|
FILE_NOTIFY_CHANGE_FILE_NAME,
&DirInfo[0].dwBufLength,&DirInfo[0].Overlapped,
NULL);
watching loop in other thread
unsigned __stdcall CFileChangeWatch::DoFileChangeWatch(void *_pcFileChangeWatch)
{
DWORD numBytes;
DWORD cbOffset;
LPDIRECTORY_INFO di;
LPOVERLAPPED lpOverlapped;
PFILE_NOTIFY_INFORMATION fni;
CString szFullFileName;
CFileChangeWatch *pcFileChangeWatch=(CFileChangeWatch *)_pcFileChangeWatch;
char sBuff[256];
CString sPath;
do
{
GetQueuedCompletionStatus( (HANDLE) pcFileChangeWatch->hCompPort,
&numBytes,
(LPDWORD) &di,
&lpOverlapped,
INFINITE);
if ( di )
{
fni = (PFILE_NOTIFY_INFORMATION)di->lpBuffer;
do
{
cbOffset = fni->NextEntryOffset;
szFullFileName=di->lpszDirName;
szFullFileName=szFullFileName + "\\";
szFullFileName=szFullFileName+ CString(fni->FileName).Left(fni->FileNameLength / 2);
if(!strcmp(szFullFileName.Right(3),"fdf"))
{
DBAction
switch(fni->Action)
{
case FILE_ACTION_ADDED:
break;
case FILE_ACTION_REMOVED:
break;
case FILE_ACTION_MODIFIED:
break;
case FILE_ACTION_RENAMED_OLD_NAME:
break;
case FILE_ACTION_RENAMED_NEW_NAME:
break;
default:;
}
fni = (PFILE_NOTIFY_INFORMATION)((LPBYTE) fni + cbOffset);
} while( cbOffset );
ReadDirectoryChangesW( di->hDir,di->lpBuffer,
MAX_BUFFER,
TRUE,
FILE_NOTIFY_CHANGE_SECURITY|
FILE_NOTIFY_CHANGE_CREATION|
FILE_NOTIFY_CHANGE_LAST_ACCESS|
FILE_NOTIFY_CHANGE_LAST_WRITE|
FILE_NOTIFY_CHANGE_SIZE|
FILE_NOTIFY_CHANGE_ATTRIBUTES|
FILE_NOTIFY_CHANGE_DIR_NAME|
FILE_NOTIFY_CHANGE_FILE_NAME,
&di->dwBufLength,
&di->Overlapped,
NULL);
}
} while( di );
return 0;
};
-- modified at 9:28 Tuesday 21st November, 2006
|
|
|
|
|
Have you tried the sample application from CDirectoryChangeWatcher[^]. Still nothing? Do you have the same problem? Then you really need to update to SP2. Sorry, but good luck!
|
|
|
|
|
I tried this demo, but on the machine, where my code doesn't work this demo doesn't work either. it really sucks.
|
|
|
|
|
You should read this[^] first.
Do take a look at point 4 and 5.
|
|
|
|
|
|
as required by the administrator here[^] (see 5.), please edit your message (not posting a new one) and post the code samples inside <pre>...</pre> html tags...
thank you
|
|
|
|
|
In my program iam using a named pipe for reading from source to destination programs. but when the source is waiting for input from destination(via another pipe) i cant read from the pipe .Only after the input was given ,the reading is possible.
Can I use any other technique by replacing pipes.
(Source and destination programs are at same machine)
vineesh
|
|
|
|
|
you can use select system call or do non-blocking IO using fcntl system call.
--
Pratap
|
|
|
|
|
you can check whther there is data present on the pipe or not
bu calling PeekNamedPipe() api so that you can come to know data is
available or not!!
and then make ReadFile() call is data is available
i did not understood your problem very well but this can be your solution
so replied
bye
Harshal
|
|
|
|
|
How can i hide columns ??????!!!!!
I have CDialog base aplication and... a CListCtrl m_list1.
I have 7 columns ,(0,1,2,3,4,5,6,7) and i want to hide 3 of them when i whant !!!!! HOW ???????
it is posibile ????
Bravoone
|
|
|
|