GLBasic forum

Main forum => Bug Reports => Topic started by: Hemlos on 2008-Oct-27

Title: inline
Post by: Hemlos on 2008-Oct-27
how do i get this to work?

And how do i get NULL into the declaration?

linking:
gpc_temp0.o:gpc_temp0.cpp:(.text+0x568): undefined reference to `_mciSendString@16'
gpc_temp0.o:gpc_temp0.cpp:(.text+0x2021): undefined reference to `_mciSendString@16'
*** FATAL ERROR - Please post this output in the forum

Code (glbasic) Select
FUNCTION foo:
ENDFUNCTION

INLINE
}
extern "C" int __stdcall mciSendString(const char*,int,int,void*);
namespace __GLBASIC__
{
ENDINLINE

FUNCTION api:


a$="open tabs.mid type mpegvideo alias MediaFile";
b=0
c=0
INLINE
mciSendString(a_Str.c_str(),b,c,GLBASIC_HWND());
ENDINLINE
ENDFUNCTION

Title: Re: inline
Post by: Kitty Hello on 2008-Oct-27
is it mciSendStringA (for ASCII version?)
Title: Re: inline
Post by: Hemlos on 2008-Oct-28
Should i use the ascii command instead?
Title: Re: inline
Post by: Kitty Hello on 2008-Oct-28
Mostly all functions from the Windows API are either ascii (A) or unicode (W) functions. The function names w/o A/W are just macros depending on your _UNICODE #define variable.
So, yes. You must use the "A" version.
Title: Re: inline
Post by: Hemlos on 2008-Oct-29
Sweet thanks, i got the fullscreen mode for movies to work with this!
Oh and BTW ,it plays midi files...one time.
Code (glbasic) Select

PLAYONCE()
SHOWSCREEN
MOUSEWAIT
END

FUNCTION foo:
ENDFUNCTION
INLINE
}
extern "C" int __stdcall mciSendStringA(const char*,int,int,void*);
namespace __GLBASIC__
{
ENDINLINE
FUNCTION PLAYONCE:
a$="play test.avi fullscreen";
b=0;
c=0;
INLINE
mciSendStringA(a_Str.c_str(),b,c,GLBASIC_HWND());
ENDINLINE
PRINT a$+" "+b+" "+c,10,10
ENDFUNCTION