skibby Posted March 7, 2018 Share Posted March 7, 2018 I'll try to develop a C#-Application with Waveform SDK. I discovered that some functions return empty strings: static string version = ""; static string device_name = ""; dwf.FDwfGetVersion(version); dwf.FDwfEnumDeviceName(0, device_name); Any hint what I'm doing wrong ? Link to comment Share on other sites More sharing options...
attila Posted March 7, 2018 Share Posted March 7, 2018 Hi @skibby Please try the following:dwf.csdwfPINVOKE.cs Thank you for the observation. Link to comment Share on other sites More sharing options...
skibby Posted March 7, 2018 Author Share Posted March 7, 2018 Hi Attila, I'm always using these 2 files in my project. I discovered when I replace all "string"-Variables with "StringBuilder" all works fine. dll-import in c# seems not to work with string variables but with StringBuilder-Type. I attach these 2 modifies files. Maybe you could replace them in the SDK. This example works fine: StringBuilder device_name=new StringBuilder(100); StringBuilder device_sn = new StringBuilder(100); StringBuilder version = new StringBuilder(100); dwf.FDwfGetVersion(version); dwf.FDwfEnumDeviceName(dev_nr, device_name); dwf.FDwfEnumSN(dev_nr, device_sn); Best regards Klaus dwf.cs dwfPINVOKE.cs Link to comment Share on other sites More sharing options...
attila Posted March 7, 2018 Share Posted March 7, 2018 Hi @skibby In the earlier posted files I also added StringBuilder but kept the argument as string for simple C# usage. Link to comment Share on other sites More sharing options...
Mattflorida Posted April 20, 2018 Share Posted April 20, 2018 Works Perfectly! Thanks! Link to comment Share on other sites More sharing options...
Question
skibby
I'll try to develop a C#-Application with Waveform SDK.
I discovered that some functions return empty strings:
static string version = ""; static string device_name = ""; dwf.FDwfGetVersion(version); dwf.FDwfEnumDeviceName(0, device_name);
Any hint what I'm doing wrong ?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.