|
I am using vfw to extract frames from an avi files. I;d like to know if the bit depth of the frame is available in the AVIFILEINFO structure or in any other structure.
|
|
|
|
|
Assuming you mean video...
You need to get that from the appropriate stream. That means you need to
use AVIStreamReadFormat() or open the stream and read a frame to get a BITMAPINFO struct.
From that struct, the BITMAPINFOHEADER.biBitCount field is what you want.
See AVIStreamReadFormat(), AVIStreamGetFrameOpen(), AVIStreamGetFrame(), etc.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I know there is a fund raiser thermometer on this site, but I don't know how to install it. I want to install a "indicator" on my blog toward a financial goal. Does anybody know where I can get one from or can you help me use the one that's on here.
Thanks
|
|
|
|
|
can you explain me what a fund raiser thermometer is?
please...
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Happy birthday to you in code project and
welcome to code project.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
never mind i figured something out
|
|
|
|
|
can you explain what you have figured out?
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
I need to write a .dll (c++) that will be loaded by software running on Windows 95 from a VB-ish application. I have the .dll written and working on Windows XP and Windows 2000.
When I try to load the .dll in Windows 95 I get an error saying that the .dll could not be found. If I try regsvr32 c:\DLL.dll I an error "GetLastError return 0x00000485" which, according to MSDN, means that it could not find the .dll. Note that I don't actually need to register the .dll; I was just using regsvr32 to test if the problem was the VB-ish app or Windows.
Basically, is seems like Windows 95 isn't recognizing the file as a .dll. I only have VS2005 for development. Is there some settings that I need to adjust to allow Windows 95 to recognize it as a .dll?
Thanks
|
|
|
|
|
My guess is that you are calling some API function that is not supported in W95. If the OS can't find all the dependencies, it will not load the DLL. 2005 is not a problem, per se, but it defaults to windows version 5.1, which is XP. Try changing / adding the following two defines to your stdafx.h (or add them via Project Settings) which will target your DLL to W95. Recompile and see if the compiler has tagged some function call as undefined.
#define WINVER 0x0400<br />
#define _WIN32_WINNT 0x0400
Judy
|
|
|
|
|
Greetings!
I'm sure thousands of people have done this, but I haven't found any samples I can work with.
I want to save the ratio between the top and bottom halves of a two-pane splitter window after the splitter bar is moved. Then, if the window is resized, I can reposition the bar so that the ratio remains constant.
I have a class derived from CSplitterWnd. I can catch the WM_NCHITTEST message and store false in a member variable if the call to CSplitterWnd::OnNcHitTest() returns HTNOWHERE and store true otherwise. I thought after that it would be a simple matter of catching the mouse up event. But it looks like that event isn't fired! Using Spy++, I saw a WM_MOUSE_ACTIVATE message, but it doesn't seem to be possible to catch that, unless I'm missing something, which is very likely. I saw something that said that CSplitterWnd objects have StartTracking() and StopTracking() virtual methods, which would be great, except that the CSplitterWnds in Visual C++ 6.0 don't seem to have those methods. So how do I do this?
RobR, yet again frustrated that something so simple should be so hard
|
|
|
|
|
What about the WM_SIZE message of the views that result from the moving of the splitter?
|
|
|
|
|
I try to use the method wcscpy_s to copy BufferSource to BufferDestinationto.
The 2 buffer type is LPTSTR.
When i define the second parameter in the function wcscpy_s in HARD CODE all work fine.
But i want to define it in runTime - i use the function _tcslen to find the number of elements i want to copy ( in this case i want to copy all strSource to strDestination ) - but i crash each time i try to make the copy.
The code:
LPTSTR BufferDestinationto[256], strSource[256];<br />
.<br />
. [ Some code that add information to BufferDestinationto ]...<br />
.<br />
<br />
wcscpy_s(BufferDestinationto, _tcslen(strSource), strSource );
MY crach is in the wcscpy_s and this happand because the _tcslen function.
Thansk form any halp.
|
|
|
|
|
Yanshof wrote: wcscpy_s
First, if you are using generic string types, you should use generic string functions.
Otherwise, you get no benefit from the portability offered by the generic types.
_tcscpy_s() is the generic for strcpy_s()
Second, you should't be using _tcslen() here. The second parameter should be the
size of the destination buffer, not the length of the source string.
Use sizeof(BufferDestinationto ) / sizeof(TCHAR) instead.
Third, in this case, the size of the destination buffer is known by the compiler,
so you can use the two parameter version of _tcscpy_s() instead, and you
don't need to calculate the destination buffer size yourself.
Try
TCHAR BufferDestinationto[256], strSource[256];<br />
.<br />
. [ Some code that add information to BufferDestinationto ]...<br />
.<br />
<br />
_tcscpy_s(BufferDestinationto, strSource );<br />
<br />
Mark
*edit* changed array types to TCHAR - Thanks led mike
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yanshof wrote: LPTSTR BufferDestinationto[256], strSource[256];
Try
TCHAR BufferDestinationto[256], strSource[256];
|
|
|
|
|
Oh sh**^%t I missed that
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In reference to the visual styles uxtheme.dll...
Supposedly, according to MSDN
EnableTheming(BOOL fEnable)
TRUE - Enables visual styles. If the user previously had an active visual style, it becomes active again.
FALSE - Disables visual styles and turns visual styles off.
If I pass in FALSE, in XP and Vista, Visual styles goes away for all apps. However, if I subsequently call it passing in a TRUE, nothing happens.
Does anyone know more about this? Am I doing something wrong?
I've tried both compiling with the .lib and tried loading it dynamically but same results.
Any ideas?
|
|
|
|
|
I have noticed that when I include a common control manifest to a wizard generated Visual C++ 2003 MFC Doc/View app, and run it on XP or Vista with an XP or Vista Theme, the default gripper that comes with the toolbar either uses visual styles or is not using them. I can't figure out which is the case but regardless, the gripper background is not the same as the toolbar background.
I've been playing with uxtheme.dll and noticed some peculiarities with toolbars, menus on XP when themes are supposedly disabled for the app and it's children.
If I remove the manifest file, the toolbars work in the old fashion but popup menu's still have the visual style.
This is just a mess. I'm amazed at the amount of work Microsoft put into the visual styles libraries but when one wants to disable it completely for an app, some pieces refuse the request.
Does anyone know why the gripper stands out so bad when running in XP or vista modes with a common control manifest in a standard MFC wizard generated app? How do I get the gripper (or the toolbar or band) to fit in correctly? How do I force the popup menus to use the system colors so they match the menu colors?
|
|
|
|
|
void CSerialRecieveDlg::OnBtnAutosend()
{
// TODO: Add your control notification handler code here
if(!m_ctrlMSCommCOM1.GetPortOpen())
AfxMessageBox("please open the port!");
else
{
CCreateName Dlg;
CString TB_Name;
CString mstr;
if(Dlg.DoModal()==IDOK)
{
TB_Name=Dlg.m_TableName;
}
m_pRecordset->Close();
//// create a new table in SQL
mstr.Format("IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = '");
mstr+=TB_Name;
mstr+="') CREATE TABLE ";
mstr+=TB_Name;
mstr+=" (ID INT,FangWei TEXT,FuYang TEXT,QingXie TEXT)";
try
{
m_pRecordset->Open(mstr.AllocSysString theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
}
catch(_com_error *e)
{
AfxMessageBox(e->ErrorMessage());
}
SetTimer(1,500,NULL);
}
}
when debug to the end, appear an error about "stackoverflow"
what is the problem??
wuhuaiji
|
|
|
|
|
nibabug wrote: SetTimer(1,500,NULL);
What are you doing in response to the WM_TIMER message?
"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
|
|
|
|
|
get data from three different tables , and then do something , and then show them, look the flowing:
void CSerialRecieveDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CString strSql;
// int m=atoi(m_strNum);
_variant_t var;
CString str,strnum;
CString strSendFW,strSendFY,strSendQX;
CString strSend;
str="";
SQLNum++;
if(SQLNum==130)
SQLNum-=129;
strSql.Format("%d",SQLNum);
strnum=strSql;
strSql.Format("SELECT * FROM TB_FANGWEI WHERE ID = '%s'",strnum);
try
{
//先关闭已经打开的记录集对象
m_pRecordset->Close();
//根据新的Sql查询语句,重新打开记录集对象
m_pRecordset->Open(strSql.AllocSysString(),
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
}
catch(_com_error *e)
{
AfxMessageBox(e->ErrorMessage());
}
//在ADO操作中建议语句中要常用try...catch()来捕获错误信息,
//因为它有时会经常出现一些想不到的错误。
var = m_pRecordset->GetCollect("Value");
if(var.vt != VT_NULL)
str = (LPCSTR)_bstr_t(var);
m_strAGFW=str;
var = m_pRecordset->GetCollect("HexValue");
if(var.vt != VT_NULL)
str = (LPCSTR)_bstr_t(var);
strSendFW=str;
// char* pszTest = (char*)(LPCTSTR)strSendFW;
// unsigned char* ptr=(unsigned char*)pszTest;
// unsigned char uchartemp;
// unsigned char m=4;
unsigned int intFW=(unsigned int)_tcstoul(strSendFW, 0, 16);
intFW&=0x3fff;
intFW<<=2;
intFW|=0x0000;
strSql.Format("SELECT * FROM TB_FUYANG WHERE ID = '%s'",strnum);
try
{
//先关闭已经打开的记录集对象
m_pRecordset->Close();
//根据新的Sql查询语句,重新打开记录集对象
m_pRecordset->Open(strSql.AllocSysString(),
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
}
catch(_com_error *e)
{
AfxMessageBox(e->ErrorMessage());
}
var = m_pRecordset->GetCollect("Value");
if(var.vt != VT_NULL)
str = (LPCSTR)_bstr_t(var);
m_strAGFY=str;
var = m_pRecordset->GetCollect("HexValue");
if(var.vt != VT_NULL)
str = (LPCSTR)_bstr_t(var);
strSendFY=str;
unsigned int intFY=(unsigned int)_tcstoul(strSendFY, 0, 16);
intFY&=0x3fff;
intFY<<=2;
intFY|=0x0001;
SQLNumQX++;
if(SQLNumQX==458)
SQLNumQX-=457;
strSql.Format("%d",SQLNum);
strnum=strSql;
strSql.Format("SELECT * FROM TB_QINGXIE WHERE ID = '%s'",strnum);
try
{
//先关闭已经打开的记录集对象
m_pRecordset->Close();
//根据新的Sql查询语句,重新打开记录集对象
m_pRecordset->Open(strSql.AllocSysString(),
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
}
catch(_com_error *e)
{
AfxMessageBox(e->ErrorMessage());
}
var = m_pRecordset->GetCollect("Value");
if(var.vt != VT_NULL)
str = (LPCSTR)_bstr_t(var);
m_strAGQX=str;
var = m_pRecordset->GetCollect("HexValue");
if(var.vt != VT_NULL)
str = (LPCSTR)_bstr_t(var);
strSendQX=str;
unsigned int intQX=(unsigned int)_tcstoul(strSendQX, 0, 16);
intQX&=0x3fff;
intQX<<=2;
intQX|=0x0002;
strSend="";
// strSend+="$";
str.Format("%4x",intFW);
strSend+=str;
str.Format("%4x",intFY);
strSend+=str;
str.Format("%4x",intQX);
strSend+=str;
// CString m_str;
unsigned int crc;
unsigned char* ptr;
unsigned char len;
str=strSend;
char* pszTest = (char*)(LPCTSTR)str;
ptr=(unsigned char*)pszTest;
len=str.GetLength();
crc=0;
crc=ban_crc(ptr,len);//计算校验值
strSend.Format("$");
strSend+=str;
// str=m_sSendData;
// m_str+=str;
str.Format("*");
strSend+=str;
str.Format("%04x",crc);
strSend+=str;
m_ctrlMSCommCOM1.SetOutput(COleVariant(strSend));//发送数据
UpdateData(FALSE);
// m_AccessList.AddString( strName + " --> "+strAge );
// m_pRecordset->MoveNext();
CDialog::OnTimer(nIDEvent);
}
wuhuaiji
|
|
|
|
|
You are doing WAY too much in response to a WM_TIMER message that occurs every 1/2 second.
"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
|
|
|
|
|
|
What, pray tell, are you finding amusing?
"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
|
|
|
|
|
it was just obvious, but i loved the way you said it
|
|
|
|
|
it has no businiss with the timer, because when i change it to 2second, it also appear error:
(step debug)
unhandled exception in SerialRecieve.exe(KERNEL32.DLL):0xE06D7363:Microsoft C++ EXCEPTION
no matter where the error appears, it appears always in the CSerialRecieveDlg::OnTimer(UINT nIDEvent)
wuhuaiji
|
|
|
|
|