|
How you plot depends on what you want to see...
You showed what looks like a window procedure - Is the value being delived at regular intervals
through a window message?
The basic steps for drawing to a window are:
Create or obtain a device context (DC)
Set up the DC for drawing - select the appropriate pen/brush/font into the DC
Do the drawing
Restore the DC's original pen/brush/font
Free the DC
You can do all this in response to the WM_PAINT message.
When the value changes, invalidate the rectangle or region that you want redrawn and call
UpdateWindow() to force a WM_PAINT to be sent immediately.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
thanks !
yes i am already having a bunch of cases. I get out about 10 values per second so its really current. I give out the value right now in WM_paint.
i shpuld read up on the deice context!
Thanks for the reply ..
|
|
|
|
|
Sam Rens wrote: i shpuld read up on the deice context!
Yes, definitely! Also check out the BeginPaint()/EndPaint() APIs for obtaining a DC when drawing
in response to WM_PAINT.
MArk
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
i cant remember how to create dialogs like buttons
thanks
|
|
|
|
|
Dane Grant wrote: cant remember how to create dialogs like buttons
A dialog that looks like a button? What are you asking?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Mark Salsbery wrote: A dialog that looks like a button?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
im sorry my question is stupid what i mean is controls
i just need an example of adding a button
|
|
|
|
|
just noticed i mave have posted in the wrong forum to this is not in mfc obviously
|
|
|
|
|
you're in the right place.
MArk
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Dane Grant wrote: my question is stupid
No such thing IMO - misworded maybe
You can add buttons to the dialog resource or
CreateWindow()/CreateWindowEx() can be used to create buttons on an already-created dialog.
For the appropriate window class to use when creating controls, see
Windows Controls[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
yes my question was messed up i meant adding controls thanks for the help
|
|
|
|
|
Come on, Mark. Put your double-quote fingers up when you ask those questions:
You want to create "dialogs" that look like "buttons?"
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I DID!
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
For make a dialog you can use of CreateDialog it makes a modeless dialog box.
|
|
|
|
|
error lnk2001: unresolved external symbol _IID_IMediaEventEx<br />
error lnk2001: unresolved external symbol _IID_IMediaControl<br />
error lnk2001: unresolved external symbol _CLSID_FilterGraph<br />
error lnk2001: unresolved external symbol _IID_IGraphBuilder <br />
error lnk2001: unresolved external symbol _IID_IVMRWindowlessControl <br />
error lnk2001: unresolved external symbol _IID_IVMRFilterConfig <br />
error lnk2001: unresolved external symbol _CLSID_VideoMixingRenderer <br />
error lnk2001: unresolved external symbol _IID_IBaseFilter <br />
error lnk2001: unresolved external symbol _CLSID_VideoInputDeviceCategory <br />
error lnk2001: unresolved external symbol _CLSID_SystemDeviceEnum<br />
error lnk2001: unresolved external symbol _IID_ICreateDevEnum <br />
error lnk2001: unresolved external symbol _IID_IAMStreamConfig <br />
error lnk2001: unresolved external symbol _FORMAT_VideoInfo <br />
fatal error lnk1120: 13 unresolved external symbols
but there is no such errors in VC6
|
|
|
|
|
VS is unable to locate the DirectShow library, probably Strmiids.lib
See my reply about setting up your build environment properly below
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
I have a project using DShow.It works well in VC6.
But when I convert it to VC2005,some errors occur.
Especially,a error like this:
1>d:\program files\microsoft visual studio .net\vc\platformsdk\include\winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
I thinks there is some wrong in the configuration of the DirectX(9.0b).
Someone would tell me how to config it and correct such error?
Thanks
|
|
|
|
|
The error has been resloved.
But another error occured.
It said that could not find such external :
_CLSID_VideoInputDeviceCategory
error LNK2001: _CLSID_SystemDeviceEnum
error LNK2001: _IID_ICreateDevEnum
How to resolve it?
Thanks
|
|
|
|
|
When you install the DirectX SDK, it updates the directories in your VS2005 settings
automatically. You may need to do this manually.
The errors you show look DirectShow-related. For DirectShow, you need the platform SDK as well,
unless you're using an old DirectX SDK.
Regardless, in VS 2005, go to Tools/Options Projects and Solutions/VC++ Directories and make sure
you have valid paths to the directX and DirectShow include and library directories in the
appropriate lists. These should be added at the top so they are searched before the include/lib
directories in the VS installation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
its a linker error you need to import a lib file to your project.
|
|
|
|
|
I need a browse dialog that can select files that have file paths longer then _MAX_PATH(260).
I've tried using GetOpenFileName, but I get a "File name is invalid" error when I select a file with a name longer then 260 (_MAX_PATH) characters.
Does anyone have a method or know of an existing library/project that can display a browse dialog which can select file names longer then 260 characters?
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
Windows not support files longer than 259.
TCHAR lpstrFilename[MAX_PATH]="";
OPENFILENAME ofn;
CString pathname;
CString filename;
int nTerm=0;
char stemp[255]={0};
TCHAR *p;
memset(&ofn,0,sizeof(OPENFILENAME));
ofn.lStructSize=sizeof(OPENFILENAME);
ofn.lpstrFile=lpstrFilename;
ofn.hwndOwner=m_hWnd;
ofn.nMaxFile=MAX_PATH*2;
ofn.lpstrFilter="All files(*.*)\0*.*\0";
if(WINVER >= 0x0400)
ofn.Flags=OFN_ALLOWMULTISELECT|OFN_EXPLORER|OFN_LONGNAMES|OFN_FILEMUSTEXIST;
else ofn.Flags=OFN_FILEMUSTEXIST;
ofn.lpstrTitle="GetOpenFileName";
ofn.nFilterIndex=0;
if(GetOpenFileName(&ofn))
{
pathname=lpstrFilename;
if(pathname.Right(1)!="\\")pathname+="\\";
for(int i=0;;i++)
{
if(lpstrFilename[i]==0)
{
nTerm++;
if(lpstrFilename[i+1]==0)
{
if(nTerm==1)
m_FileList.AddString(lpstrFilename);
break;
}
else
{
p=&(lpstrFilename[i+1]);
strcpy(stemp,p);
m_FileList.AddString(pathname+stemp);
}
}
}
}
|
|
|
|
|
Windows does support files longer then 259 characters, but you have to use a different syntax.
You have to use prefix "\\?\" with the file name, and use CreateFile.
For more information, look at CreateFile in MSDN.
I've already tried using GetOpenFileName, and I gave it required buffer size which was greater then MAX_PATH, but it still failed.
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|
|
As KevinXli pointed out, make sure you pass large enough buffers and set the nMaxFilexxx members
of the OPENFILENAME struct accordingly.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
I've already tried using GetOpenFileName, and I gave it required buffer size which was greater then MAX_PATH, but it still failed.
Here's example code:
void TestLongFileBrowse()
{
TCHAR acPath[2048] = _T("\0");
OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.nMaxFile = 2048;
ofn.lpstrFile = acPath;
if (GetOpenFileName(&ofn)) {
printf("Path length: %d\n", _tcslen(ofn.lpstrFile));
printf("Path: %S\n", ofn.lpstrFile);
} else printf("CommDlgExtendedError(): %d\n");
}
Top ten member of C++ Expert Exchange.
http://www.experts-exchange.com/Cplusplus
|
|
|
|