|
|
Hello Audio/Video gurus. I have managed to render a local .mp4 file using Source Reader . I pass the path of the local file in the funtion MFCreateSourceReaderFromURL .
I tried to do the same for rendering a camera on my LAN and passed it's URL into the said function. But it gives error. Error code is 0xc00d36c4 . Watching this error's description, it says that byte stream of the given URL is unsupported.
Question is: DO I have to write my own media source or something to get RTSP packets or this could be done by playing with Source Reader 's properties/attributes? Thanks for your input.
NOTE: I have not tried to interact with or modify any networking related property of Source Reader other than passing this camera URL.
modified 19-Mar-14 7:58am.
|
|
|
|
|
I need a device built for a school project. The device will play a simple game, something like who wants to be a millionaire, and be built solely for that purpose. The game questions needs to be updatable from point to point. Something as small as the nokia 101 would be perfect. I guess the program can be written in C, C++ or the likes and I'm pretty sure I can handle that bit, what I really need help with is the device building. I'm clueless there. Any help would be appreciated.
|
|
|
|
|
Do you really think an answer to a question of this magnitude can be provided in such a forum?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Personally, I'd go with the Arduino platform.
You can buy an Arduino Pro Mini (clone) for about $4 on flea-bay, which you could either couple with a 16x2 character display complete with buttons, or with a 128x160 16-bit graphics display and some extra buttons.
In either case, you should be able to build the device for under $15.
Arduino gives you the advantage of writing in C/C++. The Nokia 101 looks like programming would be something more of a task.
Links:
Arduino Pro Mini - $4.49 delivered to Aus[^]
1602 character display (no buttons) - $2.55 delivered to aus[^]
1602 5 button arduino shield - $5.89 delivered to aus[^]
128x160px tft display (no buttons) - $5.32 delivered to aus[^]
You'd also need a USB->serial converter, which can be bought for a few dollars or so, depending on whether you'd like it to have the ability to auto-reset the arduino at the start of the programming process. If you don't employ that functionality, you need to manually press the reset button at the right time to upload the program to the device. I have one of the 6-wire, auto-reset type. They're often 3-4 times as expensive as a 'cheapy' (but much more convenient)
5 wire usb->serial converter (no auto-reset) - $1.87 delivered to aus[^]
You'd also need a bread-board and some wires, or a soldering iron and some wires.
The neat thing about the tft display, is that it even has an SD card reader on the back. You could easily put the questions on the sd-card and read them from your program. This way, you'd only need to program the device once, updating the questions by simply copying the required data onto the sd-card.
All that said, the memory available on these devices is limited - 2kb of ram, 32kb of program memory and 1kb of eeprom. This should be ample for a Who Wants to Be A Millionaire type game, but it does require a close-eye on your memory usage.
Generating and saving to sdcard BMP or WAV files of several 100kb is reasonably easy, displaying 128x160 bmp files on the tft is trivial.
Sounds like a fun project.
|
|
|
|
|
ex- if( 0 < -1 )
I remember "C" compiler takes bits data of -1 to signed format and returns true for the above statement.
Whats behavior in C++. Is the behavior same/different.Any updated standard(C/C++) brought changes to this behavior.Please answer.
|
|
|
|
|
In C a zero value is assigned to (0 < -1) expression, hence, in the following code
if ( 0 < -1)
{
k = 5;
}
else
{
k = 10;
}
the statement k = 10; is executed.
In C++ the esame expression is evaluated as false and (like happened in the C program) the statement k = 10; is executed.
Veni, vidi, vici.
modified 20-Mar-14 4:16am.
|
|
|
|
|
I tried on gcc compiler, the statement 0 < -1 always false.please help.
|
|
|
|
|
Of course. I made a blunder.
I am very sorry. Please see my (hopefully) fixed answer.
Veni, vidi, vici.
|
|
|
|
|
Oh.. fine..But I read somewhere that when a signed value is compared with unsigned, signed converted to unsigned first. 0 is by default unsigned, hence signed version of -1 is greater than 0.
May be old compiler showing this behavior.Do u have any idea?
|
|
|
|
|
Oh, now I see. You are looking for an example of 'idiosyncrasy of integer promotions' (see, for instance, , however
shaktikanta wrote: 0 is by default unsigned
is a wrong assumption. It is signed, by default.
You have to write:
#include <stdio.h>
int main()
{
int k;
if ( 0u < -1)
{
k=5;
}
else
{
k=10;
}
printf("%d\n", k);
return 0;
}
Veni, vidi, vici.
|
|
|
|
|
Hello everyone,
Now I'm facing some problems trying to use .Net 4.0 DLLs in VC6.
Just to share some background info, it started with a requirement I need to use a (.Net 4.0 third-party) grid in an old VC6 application.
I browsed the internet and got the information about the interop and COM and so on.
Finally I arrived to this point: I used Microsoft's Interop Form Library in VS-2010 and created a dll file wrapping the third-party grid. Then from VB6 I tried to use it in VB6. It's working. I tried to do the same in VC6, but failed, and I also don't know exactly how to do exactly the same as in VB6. So I created VB6 ActiveX Control wrapping this dll. I used this ActiveX Control in VB6 exe applicaiton. It's working too. Then I tried to use the ActiveX control from VC6. I can load the grid on to the UI (by clicking a button). However, the intrinsic functions of the third-party grid (such as sorting by double-click on the column-header, group by the colums drag and drop) are not working anymore. Even when I click on the grid, the application hangs up. The error is saying something related with ".Net-BroadcastEventWindow".
Can you please help me?
Any information or guess-and-advise will be useful and really thankful.
Best regards,
Zaw Min Tun
|
|
|
|
|
If you can recompile the old VC6 code using VS2010 and its compiler, then you will have an easier time. In this case, you can then change it to a C++/CLI project and then use any .NET controls you wish. Basically, just open the old VC6 project in VS2010 and recompile. If that works, then change the project over to C++/CLI and you are in business.
If you cannot recompile the VC6 project, but can directly load DLLs, then you could use C++/CLI to be a wrapper DLL around the .NET stuff and call it from the old C style code.
Using COM and Interop the way you did is not easy as you found out. That is why you might consider the 2 suggestions above.
|
|
|
|
|
Thanks a lot, David.
The first option is probably a bit discouraging (for the source files are quite a lot and a bit messy already through the ages), so I'll be trying the second.
In fact, I've already tried wrapping in C# and calling from VC++, but still in vain.
So I will try this in C++/CLI.
For your advice and time, thanks a lot.
Best regards,
Zaw Min Tun
|
|
|
|
|
Windows 7, Visual Studio 2008, C++
Question: Is there a way to use C++ with a dialog or other GUI to open a DOS CMD window, feed it commands, let it run, and capture the output from those commands?
Parts of the output will be used for follow up commands. We may need to change directory more than once so consistency between commands will be rather helpful.
Motivation: A very extensive and heavily used application is all command line. We want to create a GUI to drive it.
Thanks for your time
If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig_106/
|
|
|
|
|
bkelly13 wrote: open a DOS CMD window DOS is long dead; it's just a command window these days. You can do this via the CreateProcess [^] function in Windows.
|
|
|
|
|
See here and here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
thanks for the links.
No, DOS is not dead. There are still some things to do with command line. Power Shell is a supercharged DOS. It can do much that the various Unix/Linux scripts do. I did some more searching and remembering. Now I have concluded that using Expect to drive this command line application is probably the text way. ExpectTk is probably even better. It will be better and easier to develop than a C++ solution.
Thanks for taking the time to read and respond.
Thanks for your time
If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig_106/
|
|
|
|
|
To be exact, DOS is a operation system, and command line in windows is just a application, we call it console.
You can use GetStdHandle to get the standard output in a running GUI application, or use CreateProcess to spawn a process and redirect it's output to do the same thing.
|
|
|
|
|
Hi to all. I'm not very good at English, so be lenient. I am a beginner in MFC. I created a tab control which uses dialogs using MFC dialog base. I created clases for each dialog. Iwould like to know how to retrieve the value of an edit box located in my class OngletOne with the class MainWinDlg
class OngletOne : public CDialogEx
{
DECLARE_DYNAMIC(OngletOne)
public:
OngletOne(CWnd* pParent = NULL); virtual ~OngletOne();
enum { IDD = IDD_FORMVIEW };
protected:
void Initi();
virtual void DoDataExchange(CDataExchange* pDX);
DECLARE_MESSAGE_MAP()
public:
CEdit m_nom;
};
IMPLEMENT_DYNAMIC(OngletOne, CDialogEx)
OngletOne::OngletOne(CWnd* pParent )
: CDialogEx(OngletOne::IDD, pParent)
{
}
OngletOne::~OngletOne()
{
}
void OngletOne::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT1, m_nom);
}
BEGIN_MESSAGE_MAP(OngletOne, CDialogEx)
ON_EN_CHANGE(IDC_EDIT1, &OngletOne::OnEnChangeEdit1)
END_MESSAGE_MAP()
void OngletOne::Initi()
{
m_nom.LimitText(25);
}
BOOL OngletOne::OnInitDialog()
{
CDialogEx::OnInitDialog();
Initi();
return TRUE; }
In my MainWinDlg, I do this:
OngletOne *Onglet1;
CString edit;
Onglet1 = new OngletOne;
OngletOne->GetDlgItemText(IDC_EDIT1, edit);
MessageBox(edit,0,0);
BUT IT SHOW NOTHING.
PLEASE I NEED HELP.
modified 20-Mar-14 4:37am.
|
|
|
|
|
Well, since you're using a CEdit anyway, why not use one of his own methods to get the text:
OngletOne *Onglet1;
CString edit;
Onglet1 = new OngletOne;
OngletOne->m_nom.GetLine(0, edit);
MessageBox(edit,0,0);
Edit: I also just noticed that you call new and never actually "create" the dialog. You have to create it or else the windows don't really exist (so when you ask for values inside the windows, well, you either get nothing, an error, or a crash). See CDialog::Create() for a modeless dialog or a CDialog::DoModal() for a modal dialog.
|
|
|
|
|
I did this:
OngletOne *Onglet1;
CString edit;
Onglet1 = new OngletOne;
Onglet1->Create(IDD_FORMVIEW, this);
Onglet1->m_nom.GetLine(0, edit);
MessageBox(edit,0,0);
But it didn't work.
|
|
|
|
|
Fawaz Ajani wrote: But it didn't work. You need to look at what you are doing here, you create the dialog and immediately try to capture some data before the edit control has received any information. Try stepping through your code with the debugger to see exactly what is going on and what are the values of all the varibles at each stage. You may like to work through this sample[^] to see how it should be done.
|
|
|
|
|
It works!!!
thanks!!!
god bless you!!!!
|
|
|
|
|
You are welcome; good luck with the rest of your development.
|
|
|
|