|
Hi!
I hace a problem. I'm using libpcap for linux and collecting packets from ip-tv. I know that one TS packet are 188 bytes and 7 of them can be put in a IP packet (1316 byte).
When I recieving the IP packet there are 1358 bytes, recieved and the first TS packet start at the 42 bytes (TS starts with 0x47) at the IP packet (1358-42 = 1316 correct), but after 188 bytes further there will be 0x47 again to indicate that there is beginning of a new TS packet, and further 188bytes there will be 0x47 again, but it is not.
Does someone know what is wrong?
my code:
...
while(1)
{
packet=pcap_next(handle, &header);//grab packet
printf("packet with length of %s", header.len);
for(counter=0; counter
|
|
|
|
|
I use WinExec( ) to call up to Window Media Player to play a Movie File . But I want to control that Window Media Player while it was playing.
I mean, I want to create an Application, which have 3 buttons, Stop, Pause, Exit that Window Media Player .
Anyone knows about this ! Please tell me or show me the code.
Thank you !
email : ngoanhvu194@yahoo.com
|
|
|
|
|
MSDN, use MCI Platform SDK and funtion to do it :
MCIWndCreate
MCIWndPlay
MCIWndStop
MCIWndPause
Nho'c Ti`
|
|
|
|
|
do you have a simple code for that ?
Thanks
|
|
|
|
|
Create an MFC Dialog base project and add 3 button Play, Pause, Stop
1. add avarible
HWND m_Player;
2. On init Dialog add code :
// TODO
m_File = "Path your audio file";
m_Player = MCIWndCreate(GetSafeHwnd(), AfxGetInstanceHandle(), WS_CHILD | MCIWNDF_NOMENU | MCIWNDF_NOPLAYBAR, m_File);
3. On Button Event Play, Stop , Play call it
MCIWndPlay(m_Player);
MCIWndStop(m_Player);
MCIWndPause(m_Player); <-- use MCIWndResume(m_Player) to continue
Nho'c Ti`
|
|
|
|
|
or, for a broader range of supported file formats look for DirectShow, there are many samples in the DirectX SDK for your needs
|
|
|
|
|
hi all,
I want to play audio file on internet with my application, help me that how i can use MCI (platform SDK) to play audio file on my free website.
or some idea to do this.
thanks
Nho'c Ti`
|
|
|
|
|
I need to write ActiveX control that can retrieve product version from specified file from ftp or http server. Is there any function in MFC that can do this? Can somebody help me?
Nase.
|
|
|
|
|
Good day ALL.
Such question. I'm try to call SOAP method from NT Service about in the same way:
ISOAPClient* m_pSOAPClient;
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
hr = CoCreateInstance ( __uuidof (SoapClient), NULL, CLSCTX_INPROC_SERVER,
__uuidof (ISOAPClient),(void**) &m_pSOAPClient );
hr = m_pSOAPClient->mssoapinit( A2BSTR( sURL ), L"", L"", L"" );
As a result of execution the last string I'm get error:
The specified module could not be found.
Funnily what not long ago it's work. But when I write similar code at MFC of console application it's work ok.
HELP ME PLEASE!!!!!!!!
|
|
|
|
|
I wanna write a small c program to record HTTP request information to a file and I am curious what precautions will I have to take?
I think basically all I will concern myself with is locking the file, writting to file and unlocking file.
The file will be simple in nature...basically append each request after the other and nothing but CSV format I guess.
Anyways, i'm not writting to a database so I don't think I need to secure data before being written to a file, cuz I can't see any way anyone can make data being sent to a file run any system commands or anything.
There will be no SQL injection hacks here
What should I concern myself with...? I wanna make this thing as small and fast as possible...so...I wanna keep it simple...
p.s- I am aware MySQL would be better, but it isn't in this situation...and I am also aware most servers like Apache...already generate log files...but I need my own...
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
I wrote a code of WAV(C:\\InputFile.wav) to WMA(C:\\OutputFile.wma) of the audio,but it was distempered.Please give a help,thank you in advance.
The following is my code:
#include <windows.h><br />
#include <atlbase.h><br />
#include <comdef.h><br />
#include "D:\WMSDK\WMEncSDK9\include\wmencode.h"<br />
#include <conio.h>
<br />
void main()<br />
{<br />
HRESULT hr;<br />
IWMEncoder* pEncoder;<br />
IWMEncSourceGroupCollection* pSrcGrpColl;<br />
IWMEncSourceGroup* pSrcGrp;<br />
IWMEncSource* pSrc;<br />
IWMEncVideoSource* pSrcVid;<br />
IWMEncAudioSource* pSrcAud;<br />
IPropertyBag* pPropertyBag;<br />
IWMEncProfileCollection* pProColl;<br />
IWMEncProfile* pPro;<br />
IWMEncFile* pFile;<br />
IWMEncAttributes* pAttr;<br />
IWMEncDisplayInfo* pDispInfo;<br />
CComBSTR bstrName = NULL;<br />
long lCount;<br />
int i;<br />
<br />
hr = CoInitialize(NULL);<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = CoCreateInstance(CLSID_WMEncoder,<br />
NULL,<br />
CLSCTX_INPROC_SERVER,<br />
IID_IWMEncoder,<br />
(void**) &pEncoder);<br />
}<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pEncoder->get_SourceGroupCollection(&pSrcGrpColl);<br />
}<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pSrcGrpColl->Add(CComBSTR("SG_1"), &pSrcGrp);<br />
}<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pSrcGrp->AddSource(WMENC_AUDIO, &pSrc);<br />
}<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pSrc->QueryInterface(IID_IWMEncAudioSource, (void**)&pSrcAud);<br />
}<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pSrcAud->SetInput(CComBSTR("C:\\InputFile.wav"));<br />
}<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pEncoder->get_File(&pFile);<br />
}<br />
if ( SUCCEEDED( hr ) ) <br />
{<br />
hr = pFile->put_LocalFileName(CComBSTR("C:\\OutputFile.wma"));<br />
}<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pSrcAud->QueryInterface(IID_IPropertyBag, (void**)&pPropertyBag);<br />
}<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pEncoder->get_ProfileCollection(&pProColl);<br />
}<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pProColl->get_Count(&lCount);<br />
}<br />
for (i=0; i<lCount; i++)<br />
{<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pProColl->Item(i, &pPro);<br />
}<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pPro->get_Name(&bstrName);<br />
}<br />
if (_wcsicmp(bstrName,CComBSTR("Windows Media Video 8 for Local Area Network (384 Kbps)"))==0)<br />
{<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pSrcGrp->put_Profile(CComVariant(pPro));<br />
}<br />
break;<br />
}<br />
}<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pEncoder->PrepareToEncode(VARIANT_TRUE);<br />
} <br />
if ( SUCCEEDED( hr ) )<br />
{<br />
hr = pEncoder->Start();<br />
printf("When encoding stops, press a key to close the console window.");<br />
<br />
if ( SUCCEEDED( hr ) )<br />
{<br />
while(!kbhit())<br />
_asm nop;<br />
<br />
hr = pEncoder->Stop();<br />
}<br />
}<br />
<br />
if ( pPropertyBag )<br />
{<br />
pPropertyBag->Release();<br />
pPropertyBag = NULL;<br />
}<br />
if ( pSrcGrpColl )<br />
{<br />
pSrcGrpColl->Release();<br />
pSrcGrpColl = NULL;<br />
}<br />
if ( pSrcGrp )<br />
{<br />
pSrcGrp->Release();<br />
pSrcGrp = NULL;<br />
}<br />
if ( pProColl )<br />
{<br />
pProColl->Release();<br />
pProColl = NULL;<br />
}<br />
<br />
if ( pPro )<br />
{<br />
pPro->Release();<br />
pPro = NULL;<br />
} <br />
if ( pFile )<br />
{<br />
pFile->Release();<br />
pFile = NULL;<br />
}<br />
if ( pSrcAud )<br />
{<br />
pSrcAud->Release();<br />
pSrcAud = NULL;<br />
}<br />
if ( pSrcVid )<br />
{<br />
pSrcVid->Release();<br />
pSrcVid = NULL;<br />
}<br />
if ( pSrc )<br />
{<br />
pSrc->Release();<br />
pSrc = NULL;<br />
}<br />
if ( pAttr )<br />
{<br />
pAttr->Release();<br />
pAttr = NULL;<br />
}<br />
<br />
if ( pDispInfo )<br />
{<br />
pDispInfo->Release();<br />
pDispInfo = NULL;<br />
}<br />
if ( pEncoder )<br />
{<br />
pEncoder->Release();<br />
pEncoder = NULL;<br />
}<br />
}
Rap off for you,for me,for our human.
|
|
|
|
|
I've noticed that on a couple of different installs of Visual Studio 6.0 the auto-complete stops working for some reason. It continues to work on user defined classes, just not included ones. Does anyone know how to fix this or turn it back on?
Ex:
string test;
test. //after the dot operator pop-up menu does not appear nor function definitions on open paren.
|
|
|
|
|
Can anyone suggest a way to play an Avi file over a push button control?
|
|
|
|
|
|
Hi,
Is it is possible to create a interactive thread or process from a interactive service?
With best Regards,
A.Ilamparithi
|
|
|
|
|
The book I'm reading has me create three files:
rectangle.h
- header file with #ifndef RECTANGLE_H #define RECTANGLE_H and ends with #endif .. I'm not sure what these do exactly, but it says to put them in there.
rectangle.cpp
- This one contains the member functions of the class I define in the header file, but there is no main function in it. When I try to compile it I get..
"LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main"
For the third file it tells me to link the project with the object file that's created from the rectangle.cpp file, but that file wont compile.
I'm using Visual C++ 6.0 and to make the rectangle.cpp I went to New/C++ source file.
Please help
|
|
|
|
|
oops. looks like I was hitting build instead of compile.. it put the .obj file in a folder called debug.
Now I'm trying to figure out how to link that .obj file with the third file.
|
|
|
|
|
Hi there
How to convert double to int?
Q1:
if a double is smaller than 1.4, it will be assign to 1
Ex: 1.3 will be 1
if a double is bigger than 1.4, it will be assign to 2
Ex: 1.5 will be 2
Q2:
if a double is bigger than 1 and smaller than 2, it will be assign to 2
Ex: 1.20 will be 2
2.10 will be 3
Does anyone know the function?
Thanks.
|
|
|
|
|
Can't u use a cast?
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Q1: Add 0.5 and cast to int.
Q2: (rounding up) is done bey ceil() (and ronding down by floor()).
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I can not find sqlcli1.h and sqlenv.h
could you help me ?
thanks
|
|
|
|
|
They are discussed in this online manual[^]. It looks like a pair of headers for developing programs to use DB2 databases. If there's a developer kit for the product, they're probably included in it.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
|
I'm trying to write a peice of code to allow me to intercept the close command in the console attached to my application's process so it will prompt the user before destroying the process. Below is the function I wrote for this. It works fine, but the problem is that when the message box pops up it convinces windows the program has stalled, and an end task window opens. Is there any way to prevent this? If it matters, I'm only considering Windows 2000/XP compatibility for this app.
BOOL WINAPI ConsoleHandlerRoutine(DWORD dwCtrlType)
{
int i;
switch(dwCtrlType)
{
case CTRL_C_EVENT:
case CTRL_CLOSE_EVENT:
for(i = 0; i < (MAX_DASMS - 1); i++)
{
if(dasmDialogProcInfo[i].handle)
{
if( MessageBox(hWnd_console, "All work in open windows will be lost if you terminate the application. Proceed?", "Information", MB_YESNO | MB_ICONQUESTION) == IDYES )
return FALSE;
else
return TRUE;
}
}
break;
}
return FALSE;
}
|
|
|
|
|
Hi,
I learn that Visual C++ 6.0 is not ansi/iso compatible but Visual studio .net is. Can anybody elaborate a little more on it? Why one is not and the other is?
|
|
|
|