我在visual c++ 6.0
中創建了Win 32 dynamic link library
項目,而我編寫了下面的代碼,它在編譯時顯示了一些錯誤。無法在Visual c + + 6.0中使用字符串格式
for(i = 0; i < (int) len; i++)
{
strTmp.Format("%C", m_Track1Buffer[i]);
strASCII += strTmp;
}
當我編譯上面的代碼顯示了我以下錯誤:
error C2228: left of '.Format' must have class/struct/union type
我有包括以下在我的代碼header files
:
#include <string.h>
#include <cstring>
#include <iostream>
#include "stdafx.h"
#include <stdio.h>
#include <String.h>
#include <mmsystem.h>
#include <winsock2.h>
#include <windows.h>
從
除了請告訴我爲什麼我不能在上述項目中使用CString
。我還包括alstr.h
,但它並沒有幫助我。
當你問一個15歲的編譯器的問題時,你需要發佈更好的repro代碼。最好的猜測是你只是忘了聲明strTmp。 –
顯然你沒有將strTmp聲明爲正確的類型 - 但是你沒有發佈該代碼,所以我們無法提供幫助。 – Hogan