Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to control a renderer via Ohnet
25-11-2014, 08:03 AM
Post: #1
Trying to control a renderer via Ohnet
Hello,
I am working on an application, wherein I have to control a smartphone app via a windows app. I am trying to use ohnet and the programs are not executing at all.

I am giving you a sample code below, which you may check and reply me if there are any issues.

Code:
#include<stdio.h>
#include<conio.h>
#include<OpenHome/Types.h>
#include<OpenHome/Net/ControlPoint/CpDevice.h>
#include<OpenHome/Net/ControlPoint/FunctorCpDevice.h>
#include<OpenHome/net/ControlPoint/CpDeviceUpnp.h>
#include<OpenHome\Net\Device\DvDevice.h>
int main()
{
printf("Hello World!!!");
getch();
}


Your replies will be much appreciated and I hope I will get a reply and will complete this app.

Regards,
mrwilliam2006
Find all posts by this user
25-11-2014, 08:51 AM
Post: #2
RE: Trying to control a renderer via Ohnet
I'm not sure whether this is a genuine question. Just in case it is, output in C is likely to be line buffered so you'll need to either call fflush(stdout) or add a \n at the end of your printf() statement to see it in your console.

After this, you'll have to read some of the ohNet docs and start calling ohNet code.
Find all posts by this user
25-11-2014, 12:16 PM
Post: #3
RE: Trying to control a renderer via Ohnet
Hello Simon,
Thank you very much for your timely reply. I appreciate your taking time to reply to our basic question. I am a newbie and I am not sure what you mean by not a genuine question?

Apart from this, I could print the "Hello World" in the console if I take out the codes from

#include<OpenHome/Types.h>
#include<OpenHome/Net/ControlPoint/CpDevice.h>
#include<OpenHome/Net/ControlPoint/FunctorCpDevice.h>
#include<OpenHome/net/ControlPoint/CpDeviceUpnp.h>
#include<OpenHome\Net\Device\DvDevice.h>

the above code I pasted here.

Does this mean the OpenHome library is not read from my folder? Or can you please let me know what might be the problem?

I will really appreciate your reply and will look forward to it.

Regards,
mrwilliam2006
Find all posts by this user
25-11-2014, 05:03 PM
Post: #4
RE: Trying to control a renderer via Ohnet
You need to choose where to install ohNet to. You'll then have to setup builds of your project to set appropriate include paths (likely -I directives to your compiler flags). This'll allow you to get ohNet client code to compile; you'll then have to add a reference to an ohNet library to get your code to link.

The problems here are not specific to ohNet. Its really just about building a C++ Windows application which uses other libraries. I don't know of any good resources that cover this but would imagine that MSDN should have some good material.
Find all posts by this user
28-11-2014, 04:01 AM
Post: #5
RE: Trying to control a renderer via Ohnet
Hi Simon,
Thanks for the reply. I will check and will come back if there are any more questions.

William
Find all posts by this user


Forum Jump: