Jump to content
  • 0

WaveForms SDK with C# - empty strings


skibby

Question

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...