Hawk2k
September 23rd, 2001, 11:36 PM
Hello there! :-)
I've a big problem with a VB func out of a DLL. :-( I work on this now many weeks (with help from other programmers) without success. ;( The VB header for the func out of the DLL:
---cut---
'//////////////
'// LOADHULLKEYS
'// sPath : (input) is the complete path to the directory that has the ship packs
'// You need to supply sPath to LOADHULLKEYS
'//
'// vFistLong : (OUTPUT) is the first element in an array of 2000 longs
'// You must dim the array of 2000 longs and pass the first element
'// The array will be filled with a list of existing hull ID values
'// If element(23) of the array comes back with a value 23 then ship 23 exists
'// If element(23) comes back a zero the ship hull does not exist
'// If you Dim g_vList(1 to 2000) as long you MUST pass the element g_vList(1)
'//
'// sKey : (OUTPUT) This is a key string that LOADHULLKEYS returns to you.
'// Save this string and pass it to subs that require it as an input
'// This sub always loads the keys to the latest versions of the ship hulls, old ship files are ignored
Declare Sub LOADHULLKEYS Lib "v4face2.dll" (sPath as string, vFirstLong as Long, sKey as string)
---cut---
What I've (till now) works but the result vars are empty. What's wrong with this:
typedef DWORD dwat[2000];
typedef void (__stdcall* LOADHULLKEYS)(_bstr_t, dwat*, _bstr_t*);
LOADHULLKEYS _LoadHullKeys=NULL;
[...]
void LoadHullKeys(dwat* pdw_array, _bstr_t* p_bstr)
{
CString str=Planets4Path+_T("ships");
BSTR bstr=str.AllocSysString();
_LoadHullKeys(bstr, pdw_array, p_bstr);
}
p_bstr give nothing ("") back and the pdw_array is further filled with zero. :-(
[...]
typedef DWORD dwat[2000];
void LoadHullKeys(dwat*, _bstr_t*);
[...]
dwat dw_ar_result;
ZeroMemory(&dw_ar_result, sizeof(dwat));
_bstr_t BString;
LoadHullKeys(&dw_ar_result, &BString);
Another func out of this DLL works fine. Planets4Path is a pathstring (CString).
Help me please! Many thanks in advance!
Bye, ^Hawk^.
.-=> WWW: http://www.darksoft2001.de - ICQ: 129057905 <=-.
I've a big problem with a VB func out of a DLL. :-( I work on this now many weeks (with help from other programmers) without success. ;( The VB header for the func out of the DLL:
---cut---
'//////////////
'// LOADHULLKEYS
'// sPath : (input) is the complete path to the directory that has the ship packs
'// You need to supply sPath to LOADHULLKEYS
'//
'// vFistLong : (OUTPUT) is the first element in an array of 2000 longs
'// You must dim the array of 2000 longs and pass the first element
'// The array will be filled with a list of existing hull ID values
'// If element(23) of the array comes back with a value 23 then ship 23 exists
'// If element(23) comes back a zero the ship hull does not exist
'// If you Dim g_vList(1 to 2000) as long you MUST pass the element g_vList(1)
'//
'// sKey : (OUTPUT) This is a key string that LOADHULLKEYS returns to you.
'// Save this string and pass it to subs that require it as an input
'// This sub always loads the keys to the latest versions of the ship hulls, old ship files are ignored
Declare Sub LOADHULLKEYS Lib "v4face2.dll" (sPath as string, vFirstLong as Long, sKey as string)
---cut---
What I've (till now) works but the result vars are empty. What's wrong with this:
typedef DWORD dwat[2000];
typedef void (__stdcall* LOADHULLKEYS)(_bstr_t, dwat*, _bstr_t*);
LOADHULLKEYS _LoadHullKeys=NULL;
[...]
void LoadHullKeys(dwat* pdw_array, _bstr_t* p_bstr)
{
CString str=Planets4Path+_T("ships");
BSTR bstr=str.AllocSysString();
_LoadHullKeys(bstr, pdw_array, p_bstr);
}
p_bstr give nothing ("") back and the pdw_array is further filled with zero. :-(
[...]
typedef DWORD dwat[2000];
void LoadHullKeys(dwat*, _bstr_t*);
[...]
dwat dw_ar_result;
ZeroMemory(&dw_ar_result, sizeof(dwat));
_bstr_t BString;
LoadHullKeys(&dw_ar_result, &BString);
Another func out of this DLL works fine. Planets4Path is a pathstring (CString).
Help me please! Many thanks in advance!
Bye, ^Hawk^.
.-=> WWW: http://www.darksoft2001.de - ICQ: 129057905 <=-.