|
I also find myself loosing the mouse cursor into the other screen too many times. I'm used to the clipping and usually don't worry about horizontal motion when trying to reach the X button to close =).
Anyway I think I have it under control.
|
|
|
|
|
Could someone who has the Windows Media Device Manager 10 SDK installed please tell me what the value of g_wszWMDMFormatCode in mswmdm.h is?
I suspect it is L"Format Code" but if I use that, it doesn't appear to be working.
Yes, I know.. I could just install the SDK, but our license is currently being processed (so I don't have the SDK yet) and I need to do a quick test.
Thanks in advance.
Andrew
|
|
|
|
|
|
I am handling OnClik and OnDoubleClick event on a listControl. When ever user doubleclicks on a item, first onclick and then OnDoubleClick event gets fired. Is there a way to avoid onclick event when user has DoubleClicked on the item ?
Sandeep Naik
|
|
|
|
|
How about starting a timer that's longer than the interval between double-clicks? So if 200 ms is the longest interval between double-clicks, start a timer with an interval of 250ms. In double-click event and in timer event, kill the timer.
[insert witty comment here]
bdiamond
|
|
|
|
|
Thanks a lot....
I could solve the problem
Sandeep Naik
|
|
|
|
|
I'm curious: what does your On Click() handler do (eg: does it update a selection count?)
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
OnClick refreshes the selected item on the listViewControl.
DoubleClick refreshes and then allows the user to modify it. The refreshing happens twice in this case.
Sandeep Naik
|
|
|
|
|
From look at Spy++, when a list control single-clicked, it receives a WM_LBUTTONDOWN message followed by a WM_LBUTTONUP message. When a list control double-clicked, it receives those two messages followed by a WM_LBUTTONDBLCLK and WM_LBUTTONUP . Can you monitor for WM_LBUTTONDOWN and WM_LBUTTONDBLCLK separately?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have started writing a game in C++ and while creating the login section of it I have come to a problem. I have it to where it gets the string and types it on the next line. But when it sends it to the save file it only shows up as little box symbols. I had it working before but i changed some things. then i changed them back and now it doesn't work. i can't find anything i forgot to take out or change.
--Blah
|
|
|
|
|
here is my code:
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "time.h"
char username[12];
int i, ch;
FILE *MyHandle;
char MyFile[12] = "Save.txt";
void main(void)
{
printf("Welcome.\n\n\n");
getch();
printf("Please identify yourself.\n");
printf("Name: ");
for( i = 0; (i < 12) && ((ch = getchar()) != EOF)
&& (ch != '\n'); i++ )
username[i] = (char)ch;
username[i] = '\0';
MyHandle = fopen( MyFile, "a+");
fprintf( MyHandle, "%s%c", username);
fclose( MyHandle);
printf("Welcome ");
printf( "%s", username);
printf( ". Go to the waiting room and await your orders.");
getch();
}
Blah
|
|
|
|
|
You are allowing up to 12 characters to be input for the name so username needs to hold 12 plus 1 for the '\0' character.
Zinzara wrote:
fprintf( MyHandle, "%s%c", username);
An additional byte is being popped from the stack with this. Either remove the %c , or add another parameter.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks for your help. taking the %c out didn't help but i changed the "a+" to just "a" and it works now. again, thanks. well, i'm off to work on my game.
Blah
|
|
|
|
|
Zinzara wrote:
...taking the %c out didn't help...
While it may not have solved the exact problem you were having, having the "%c" in the format specifier was indeed an error.
Zinzara wrote:
...i changed the "a+" to just "a" and it works now...
I question this since the only difference between "a" and "a+" is how the EOF marker is handled.
You still need to chahge username from 12 to 13 so the '\0' character can be safely stored.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I would like to know how to catch ESC key in MDI application. I tried with WM_KEYDOWN, WM_CHAR, But nothing seems to work. When ever any View is opend I able to catch ESC key on that view. But no view is opened nothing seems to work.
Thanks in Advance.
|
|
|
|
|
|
Newbie question here...
I am learning c++ and following through the code from a book - which recommends using Microsoft VC++ 7.0. The book stresses that it does not use the .net framework.
My question is can i use VS 2003 (.net) to create a "NON"-.net application? Would this be a "Win32 App" in visual studio?
help?
Thanks.
SN
|
|
|
|
|
Of course!! I've only experimented with the managed extensions a few times, but other than that, I just like the .Net IDE a lot better than VC6's. You can make any of the same application types that you could in VC6. And so far, any code or functions that I had in VC6 work with no problem. The difference if you just want to write C++ code without the .Net stuff is invisible to me. But at any time you can go into your project's properties and set 'Use Managed Extensions' to YES, which adds a \clr switch to your linker settings.
[insert witty comment here]
bdiamond
|
|
|
|
|
Thanks bdiamond! That's good to know.
What exactly are Managed Extensions?
SN
|
|
|
|
|
What exactly are Managed Extensions?
.net stuff...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Managed extensions is the .Net BCL (Base Class Library). I guess it's almost like .Net's version of MFC. There is a great beginner's book I have by Tom Archer and Nishant Sivakumar (whom are both CodeProject members) that deals with a C++ programmer learning to use managed extensions. It's a great book, but I really haven't had the time to do more than a few exercises from it in the past few months.
[insert witty comment here]
bdiamond
|
|
|
|
|
Now i am a little confused....
"...at any time you can go into your project's properties and set 'Use Managed Extensions' to YES..."
As you posted earlier, i need to set 'Use Managed Extensions' to YES, but here you also say they are the .Net BCL.
If so wouldn't i NOT want to use Managed Extensions?
I'm being fussy i know... I just want to be sure i understand!
SN
|
|
|
|
|
I have a function that is handled for my listbox's double-click event. When a file in the list is double clicked it is opened in its default application. It was suggested by one of the users that I make this file read-only after it was opened so that if the user tried to then save a modification they would be reminded. Since the file is saved in the database, when my app closes, it goes through the temp folder and deletes all files that were open during this session. In case I also made it where it'll remove the read-only attribute and delete it if it's already there. The problem is that the BYTE buffer I allocate with the new operator is causing a memory leak, and when I try to call delete on it, I get an error in this section of code in "comip.h":
~_com_ptr_t() throw()<br />
{ <br />
_Release(); <br />
}
here's my function, with offending lines in bold:
BeginWaitCursor();
_RecordsetPtr rst;
strWhere.Format("LinkID = %d",data);
rst = theApp.GetRecordset(_T("*"),_T("tblLink") ,strWhere);
CString str,strPath;
FieldsPtr pFields = rst->GetFields();
FieldPtr pField,pName;
pField= pFields->GetItem(_T("FileBytes"));
pName = pFields->GetItem(_T("Link"));
unsigned long nLength = pField->GetActualSize();
str.Format("%s",(char*)_bstr_t(pName->Value));
_variant_t varBLOB = pField->GetChunk(nLength);
pBuf = new BYTE[nLength];
SafeArrayAccessData(varBLOB.parray,(void **)&pBuf);
pBytes = pBuf;
SafeArrayUnaccessData(varBLOB.parray);
::GetModuleFileName(NULL,szPath,512);
strPath.Format("%s",szPath);
int pos = strPath.ReverseFind('\\');
strDirectory = strPath.Left(pos + 1) + "temp\\";
strPath = strDirectory + url;
CreateDirectory(strDirectory,NULL);
CFile file;
CFileException ex;
CFileStatus status;
status.m_attribute = 0;
if(file.Open(strPath,CFile::modeRead,&ex))
{
file.Close();
CFile::SetStatus(strPath,status);
DeleteFile(strPath);
}
if(file.Open(strPath,CFile::modeCreate | CFile::modeWrite,&ex))
{
file.Write(pBytes,nLength);
file.Close();
file.GetStatus(status);
status.m_attribute |= 0x01;
CFile::SetStatus(strPath,status);
int iReturn = (int) ShellExecute(NULL, _T("open"), strPath, NULL, NULL, SW_SHOWNORMAL);
if (iReturn <= 32)
MessageBox (_T("Cannot open file. File may have been moved or deleted."), _T("Error!"), MB_OK | MB_ICONEXCLAMATION) ;
if(url.GetLength()==0)
MessageBox (_T("This is an empty entry! Try clicking a filled link! "), _T("Error!"), MB_OK | MB_ICONEXCLAMATION) ;
}
else
{
AfxMessageBox("File could not be opened from this location.\r\n"
"Check to make sure you don\'t already have this attachment open.",MB_ICONINFORMATION);
}
}
MYCATCHALL
url.ReleaseBuffer();
EndWaitCursor();
[insert witty comment here]
bdiamond
|
|
|
|
|
Hi,
Does anyone know how to write a text string on a video stream captured with the DirectX libraries in a way that the text is embedded in the stream ? In other words, it is possible to apply a text overlay on a video stream that will be saved with the stream ?
Any help would be greatly appreciated,
John
|
|
|
|
|
Hi,
Does anyone know how to write a text string on a video stream captured with the DirectX libraries in a way that the text is embedded in the stream ? In other words, it is possible to apply a text overlay on a video stream that will be saved with the stream ?
Any help would be greatly appreciated,
John
|
|
|
|