May 01, 2024, 04:17:01 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


*char to string

Started by ExMember001, November 16, 2006, 09:47:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ExMember001

How can i display a byte as a string?

example:


struct BASS_PLUGINFORM
{
UNSIGNED INT ctype; // channel type
Byte *name;     // format description
Byte *exts;     // file extension filter (*.ext1;*.ext2;etc...)
}

struct BASS_PLUGININFO
{
UNSIGNED INT version; // version (same form as BASS_GetVersion)
UNSIGNED INT formatc;   // number of formats
BASS_PLUGINFORM formats; // the array of formats
}

BASS_PLUGININFO *info = BASS_PluginGetInfo(plugin);
int a;
                    for (a=0; a<info->formatc; a++)
{ // display the array of formats...
                         messagebox(this,info->formats[a].*exts,"test");
                    }

Ionic Wind Support Team

 UNSIGNED INT ctype;  // channel type
String *name;     // format description
String *exts;     // file extension filter (*.ext1;*.ext2;etc...)

Would be the easier way.  A pointer is always the same size, its only how you use it that would be different.  You could also use type casting.

messagebox(this,info->formats[a].*(string)exts,"test");

Paul.
Ionic Wind Support Team

ExMember001

thanx Paul,
i had already tryed that but not this way, so it was crashing at the start of the loop
now it return the 2 plugins infos but crash after ;)

Ionic Wind Support Team

Technically you should check for NULL as well, since they are pointers.

if( info && info->formats[a].exts)
       messagebox(this,info->formats[a].*exts,"test");

I don't see where 'info' is defined and am questionable about how they are storing the array. But start with that.
Ionic Wind Support Team

ExMember001

November 16, 2006, 10:51:20 PM #4 Last Edit: November 16, 2006, 11:21:04 PM by KrYpT
thats what i was thinking but its seems checking for null doesnt resolve it .. into investigating further.