|
<pre Lang="turbo c">
#include<studio.m>
main()
{
char m;
int p;
float n;
scanf ("%s%d%f",&m,&p,&n);
} </pre>
|
|
|
|
|
Hi everyone
The output of this code is 10,
I want to know why **q prints 10?
int x,*p,**q;
x=10;
p=&x
q=&p;
cout<<**q;
|
|
|
|
|
p points to x, which is assigned 10.
q points to p, which points to x.
*q returns p. Now you need to dereference that result to get to x. With parenthesis, you get: *(*q) == *p
|
|
|
|
|
Hello sound and video gurus. I am trying to capture my integrated web cam using Media Foundation APIs. I could not figure out the following couple of points.
1 - Difference between RAW video and uncompressed video
2 - Video format for RAW video (like PCM for RAW audio, MFVideoFormat_Base perhaps?)
I am using the following code to capture and store data onto my hard disk (a lot of code is ommited for clarity). I am saving on 100 samples but it stores 267+ hours of data. Here it is
BOOL CMyClass::StartRecording()
{
HRESULT hResult;
dwActualStreamIndex = 0;
m_bFirstSample = TRUE;
m_llBaseTime = 0, m_llTimeStamp = 0;
IMFSample* pSample = NULL;
IMFMediaBuffer* pMediaBuffer = NULL;
BYTE* pData = NULL;
BOOL bResult = InitCamera(); if(!bResult) return FALSE;
hResult = m_pReader->ReadSample((DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &dwActualStreamIndex, &dwStreamsFlags, &m_llTimeStamp, &pSample);
if(FAILED(hResult)) return FALSE;
hResult = m_pReader->ReadSample((DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &dwActualStreamIndex, &dwStreamsFlags, &m_llTimeStamp, &pSample);
if(FAILED(hResult)) return FALSE;
for (DWORD i = 0; i < 100; ++i)
{
hResult = m_pWriter->WriteSample(0, pSample);
if(FAILED(hResult)) return FALSE;
unsigned int c=0;
hResult=pSample->GetBufferCount((DWORD*)&c);
if(FAILED(hResult))MessageBox(NULL, "err","get buffer count", MB_OK);
IMFMediaBuffer* buffer=NULL;
hResult=pSample->GetBufferByIndex(0,&buffer);
if(FAILED(hResult))MessageBox(NULL, "err","GetBufferByIndex", MB_OK);
unsigned int sz=0;
hResult=buffer->GetCurrentLength((DWORD*)&sz);
if(FAILED(hResult))MessageBox(NULL, "err","GetCurrentLength", MB_OK);
unsigned char* data=NULL;
unsigned int validSize=0;
hResult=buffer->Lock((BYTE**)&data,NULL,(DWORD*)&validSize);
if(FAILED(hResult))MessageBox(NULL, "err","Lock", MB_OK);
hResult=buffer->Unlock();
if(FAILED(hResult))MessageBox(NULL, "err","Unlock", MB_OK);
hResult = m_pReader->ReadSample((DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &dwActualStreamIndex, &dwStreamsFlags, &m_llTimeStamp, &pSample);
if(FAILED(hResult)) return FALSE;
}
return TRUE;
}
Thanks for any pointers.
modified 9-Dec-13 7:57am.
|
|
|
|
|
I find some application can show a number in the shutcut in the desktop , but I cannot find which windows api can do it. Is there anyone know it?
|
|
|
|
|
What do you mean by "show a number in the shutcut in the desktop"?
Veni, vidi, abiit domum
|
|
|
|
|
Do you mean something like "Microsoft Word (2)"?
|
|
|
|
|
No, this is changed the shortcut name. I means that display a number in the icon of the shortcut.
|
|
|
|
|
So overlay an image of a number on top of an existing icon?
|
|
|
|
|
Yes, I donot know which windows api can do it.
|
|
|
|
|
|
The problem is that a host could have lots of network interfaces, and an interface could be bound to more than one IP address. And to top that, not all IP addresses will be reachable from off the machine. Some could be virtual devices, and others could be private network IP addresses.
How do i know my local ip address which is currently reachable from outside network?
|
|
|
|
|
Is this something to do with C++?
Veni, vidi, abiit domum
|
|
|
|
|
Yes, i am looking for a C Program for this...
|
|
|
|
|
|
|
Thanks Ahmad.
But I have one doubt in the above solution.
Suppose there are two ips configured in the system(one is through LAN and other one through USB) and we can connect external ip through one of the local ips(say through USB).
Then does this solution always returns the local ip which can connect outside(USB in this case) or it will return any one ip.
|
|
|
|
|
char cNamearr[255];
gethostname(cNamearr, 255);
hostent* hp = gethostbyname(cNamearr);
_sockaddr.sin_addr.s_addr = _nAdapterIp;
_sockaddr.sin_addr.S_un.S_un_b.s_b1 = hp->h_addr_list[0][0];
_sockaddr.sin_addr.S_un.S_un_b.s_b2 = hp->h_addr_list[0][1];
_sockaddr.sin_addr.S_un.S_un_b.s_b3 = hp->h_addr_list[0][2];
_sockaddr.sin_addr.S_un.S_un_b.s_b4 = hp->h_addr_list[0][3];
|
|
|
|
|
Recently my old Visual C++ (2005 or earlier) decided to upgrade itself to Visual C++ 2008, or whatever happened, and that has different features. I am having to re-make all my projects for Visual C++ 2008. I am currently doing this with my project ppp_vc, which is a simple image reader and outputter and editer, and it is very useful to me. (The -'_vc' means "Visual C", to distinguish it from stuff made with my old faithful Borland C++ 4.52, which I had to stop using when modern Windowses became incompatible with it.) So far, the Release version of ppp.exe runs OK, but the Debug version of ppp.exe fails with a MessageBox saying "The application has failed to start because its side-to-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more details."
What is sxstrace.exe, and how to call it? What is a side-to-side configuration? This needs to be sorted out, before I have to repeat this ordeal with my application makeobj, which is a very useful CGI 3D mesh-editor which I wrote. And ditto with several other applications which I wrote.
I was brought up on MS-DOS, where things were much simpler.
This difficulty became much worse today when my PC's Windows decided to upgrade itself from the web.
One thing that I did in my Borland C++ days was to make the .JPG graphics software into a DLL, which was useful, until a way arose of calling JPG directly from the Windows software.
modified 30-Nov-13 15:00pm.
|
|
|
|
|
|
Which of the updates listed on that page linked to, should I install? My PC has Windows 8, 64-bit.
Which #insert file declares the name WS_SYSMENU ?
|
|
|
|
|
I would suggest installing the 64-bit 2008 version.
You can find the definition of a symbol by right-clicking it, and selecting "Go to definition."
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard Andrew x64 wrote: I would suggest installing the 64-bit 2008 version.
Please where can I download it? http://msdn.microsoft.com/en-us/vstudio//[^] does not list it.
Would Visual Studio 2013 work on my PC?
I tried running an old compiled .exe file that ran OK before my computer was reformatted and reinstalled (with a newer version of Windows 8), and it gave the fault as described above. What IS happening? How do people make .exe files that are not so dependent on exact details of which system it is run on?
modified 30-Nov-13 18:07pm.
|
|
|
|
|
Does this application use MFC? If so, then that may be the problem.
The VC Express editions don't come with MFC, so you might be missing the debug libraries. The only solution for that is to install VS 2008 Professional Standard or higher.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Anthony Appleyard wrote: Which of the updates listed on that page linked to, should I install?
It depends upon which one is missing and/or corrupted.
Try installing both the 32-bit and the 64-bit versions and see if that fixes it.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|