cannot export whole class
TVMAN
faredu at 163.com
Thu Aug 31 06:05:14 PDT 2006
sorry my poor english. there are 3 bugs(questions):
1.
------------------------------------------------
export class CMyClass
{
public:
...
}
------------------------------------------------
this will not export any method in DLL.
2.
can dmd generate a "pure" header file? that is, no any code in generated .di
file.
----------------------
void test()
{
int a = 0;
}
----------------------
this function will not changed in .di file
----------------------
void test()
{
if ( .. )..;
int a = 0;
}
----------------------
this function will become
void test();
this is right
3.
"dmd -release -O ..." works not fine, when compile dwt's ole_com example,
some useful code be "optimized out". code in oleclientsite.d:
protected GUID* getClassID(char[] clientName) {
// create a GUID struct to hold the result
GUID* guid = new GUID();
// create a null terminated array of wchar
wchar* buffer = null;
if (clientName !is null) {
buffer = Converter.StrToWCHARz(clientName);
}
if (COM.CLSIDFromProgID(buffer, guid) != COM.S_OK){
HRESULT result = COM.CLSIDFromString(buffer, guid);
if (result != COM.S_OK)
OLE.error(__FILE__, __LINE__,
OLE.ERROR_INVALID_CLASSID, result);
}
return guid;
}
-------------------------------------
if (clientName !is null) {
buffer = Converter.StrToWCHARz(clientName);
}
---------------------------------------
this have optimizition error
but
-------------------------------------
if (clientName != null) {
buffer = Converter.StrToWCHARz(clientName);
}
---------------------------------------
have not optimizition error
More information about the Digitalmars-d-bugs
mailing list