Register    Login    Forum    Search    FAQ

Board index » Software » Windows




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post Posted: Mon Mar 27, 2017 12:57 pm 
Offline

Joined: Mon Mar 27, 2017 11:47 am
Posts: 15
Hi,

Using the latest SDK v2 with the C# wrappers, I'm trying to connect to an ASI1600MM camera within a Universal Windows Project using MS Visual Studio 2017. However, when I call ASICameras.Count; I get a count of 0 returned indicating that no cameras are connected. Therefore, if I try to execute ASICameras.GetCamera(0); I get an index out of bounds exception.

I have installed both the native and directshow drivers for the camera and in device manager I can see it without any issue. Also, the camera is detected and streams fine in SharpCap.

Is there something I need to do to initialize and connect to the camera before calling ASICameras.GetCamera(0);? I'm wondering if I'm missing something or doing something incorrect here.

Any guidance and help would be much appreciated.

Best regards,

Evren


Top 
 Profile  
Reply with quote  
 Post Posted: Wed Mar 29, 2017 7:15 am 
Offline
Site Admin

Joined: Fri Jul 25, 2014 2:43 am
Posts: 163
ASICameras.Count is the first you should call, all other functions will return error if ASICameras.Count reurns 0.
Can you run our demo writen by C language, because it's easier to find the issue

_________________
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China


Top 
 Profile  
Reply with quote  
 Post Posted: Thu Mar 30, 2017 10:58 am 
Offline

Joined: Mon Mar 27, 2017 11:47 am
Posts: 15
Hi there,

Many thanks for the response. I got the SDK working just fine in a standard C# WPF app. I am able to get a handle on the camera and then initialise it and start a video recording. All good within this kind of project.

My problem is that I need to create a C# UWP app. Within this kind of C# project, the SDK does not appear to work (i.e. returns a camera count of 0). Having spent an entire couple of days on this trying various things and doing some research, I think the issue may be arising from UWP apps running in a protected environment which places constraints on what unmanaged dlls can be executed. See the Microsoft article below:
https://msdn.microsoft.com/en-us/library/mt186162.aspx

There is a potential work around, but I don't have the SDK source code to try it out:
https://blogs.msdn.microsoft.com/chrisbarker/2014/10/08/consuming-a-c-library-project-from-a-windows-phone-store-app/

There is still a chance that this is a smaller issue and I have missed something.

Any help or assistance would be greatly appreciated.

Many thanks,

Evren


Top 
 Profile  
Reply with quote  
 Post Posted: Fri Mar 31, 2017 1:55 am 
Offline
Site Admin

Joined: Fri Jul 25, 2014 2:43 am
Posts: 163
I have no experience with C# UWP app, did you run it on a normal Windows PC and can't work?
can you provide the C# UWP project and the procedure of setup to me, I have VS Community 2015, so I can try to find the problem.

_________________
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China


Top 
 Profile  
Reply with quote  
 Post Posted: Fri Mar 31, 2017 10:59 am 
Offline

Joined: Mon Mar 27, 2017 11:47 am
Posts: 15
Hi,

That's correct: on a normal windows PC, using a C# UWP project, it does not work. I have created a simple UWP project using Visual Studio 2015 Community Edition for you.

As previously stated, the SDK works in a standard C# WPF project, but not in a C# UWP project (no exceptions thrown).

Really looking forward to hearing back from you and do let me know if I can help in anyway to resolve this.

Best regards,

Evren


Attachments:
File comment: VS 2015 C# UWP project
ASITestUWP.zip [416.77 KiB]
Downloaded 22 times
Top 
 Profile  
Reply with quote  
 Post Posted: Fri Mar 31, 2017 12:12 pm 
Offline

Joined: Mon Mar 27, 2017 11:47 am
Posts: 15
I forgot to mention that you need to build this project using the x64 profile.


Top 
 Profile  
Reply with quote  
 Post Posted: Wed Apr 05, 2017 1:54 am 
Offline
Site Admin

Joined: Fri Jul 25, 2014 2:43 am
Posts: 163
I enocounter error when I tried to open your project by VS2015 on my Win7, it prompts that SDK (UAP, Version=10.0.14393.0) should be installed, but I cant install it successfullt on Win7, it seems that I have to install VS2015 on Win8/Win10.

_________________
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China


Top 
 Profile  
Reply with quote  
 Post Posted: Fri Apr 07, 2017 1:43 pm 
Offline

Joined: Mon Mar 27, 2017 11:47 am
Posts: 15
Hello yang,

Thanks for your help so far. You are correct that UWP targets Windows version 8 and beyond. Therefore you would need to be running your IDE on one of these versions. From your response, it is not clear to me if you intend to do this or not. Can you clarify if you will be testing on a later windows version?

I think it is important to make the SDK compatible with UWP apps as they will become more and more prominent as time goes on.

Best regards,

Evren


Top 
 Profile  
Reply with quote  
 Post Posted: Mon Apr 10, 2017 1:15 am 
Offline
Site Admin

Joined: Fri Jul 25, 2014 2:43 am
Posts: 163
It's better if I can open the project with VS2015 on my Win7, is this possible?

_________________
ZWO software engineer
Location:lon=120.6 lat=31.3
SuZhou China


Top 
 Profile  
Reply with quote  
 Post Posted: Tue Apr 11, 2017 9:49 am 
Offline

Joined: Mon Mar 27, 2017 11:47 am
Posts: 15
yang wrote:
It's better if I can open the project with VS2015 on my Win7, is this possible?


Hi Yang,

Yes, you should be able to open and build a UWP project on Win 7. You will just not be able to run or debug the app locally.

Here are some Microsoft instructions that may be helpful:

https://msdn.microsoft.com/en-gb/library/dn975273.aspx

Best regards,

Evren


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2, 3  Next

Board index » Software » Windows


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: