Re: Harbour Compiler Build Questions ! UPDATED *
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Hua,
Please change this line:
StringFromGUID2( guid,tmpbuff,76);
Please change this line:
StringFromGUID2( guid,tmpbuff,76);
hua wrote:Congrats on a successful migration Tim. I'm still waddling through.
Antonio,
when I compile the source code below I got the following error message,guid.prg(47) : error C2664: 'StringFromGUID2' : cannot convert parameter 1 from 'GUID *' to 'const GUID &'
Reason: cannot convert from 'GUID *' to 'const GUID'
No constructor could take the source type, or constructor overload resolution was ambiguous
How can I solve this?
TIA
--
hua
- Code: Select all Expand view
//-------------------------
// GuID generieren
// Stefan Haupt, April 2005
//-------------------------
#include "FiveWin.ch"
//------------------------------------------------------------------
// standard 32 byte's M$ GuID
//------------------------------------------------------------------
FUNCTION CreateGuID32 (lNoBracket, lNoDash)
LOCAL cGuID := NewGuid()
DEFAULT lNoBracket := .t.
DEFAULT lNoDash := .f.
IF lNoBracket
cGuid := strtran(cGuid,"{")
cGuid := strtran(cGuid, "}")
ENDIF
IF lNoDash
cGuid := strtran(cGuid,"-")
ENDIF
RETURN (cGuID)
// Many thanks to Valerie for his help
// and these 2 functions
#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"
//------------------------------------------------------------------
// standard 32 byte's M$ guid
//------------------------------------------------------------------
HB_FUNC( NEWGUID )
{
GUID guid;
char obuff[38];
memset( obuff, 0x0, 38 );
if ( CoCreateGuid(&guid) == NULL )
{
OLECHAR tmpbuff[76];
StringFromGUID2(&guid,tmpbuff,76);
WideCharToMultiByte(CP_OEMCP,0,tmpbuff,-1,obuff,38,NULL,NULL);
}
hb_retclen(obuff,38);
}
#pragma ENDDUMP