Author |
Topic  |
|
StarWing
Junior Member
 
13 Posts |
Posted - Mar 05 2008 : 03:53:36 AM
|
1626, Programing with wtl8.0,underline and Wrong characters.
If you can't get Image,please go this link: http://hi.baidu.com/starwing/album/item/fa2061d01b513e9fa0ec9c0f.html
Sorry, forgot to make picture public. now it's all right... By the way, can anyone advice me where can i upload images except baidu.... |
Edited by - StarWing on Mar 10 2008 03:38:46 AM |
|
feline
Whole Tomato Software
    
United Kingdom
19135 Posts |
Posted - Mar 06 2008 : 4:16:13 PM
|
The wrong characters, we are working on a new build that might fix the problem. Can you try the new version, when it is posted, and see if that helps?
For the underlining, can you please post the code, or a code sample, that shows the problem? I don't want to retype the code from the screen shot to test it. |
zen is the art of being at one with the two'ness |
 |
|
StarWing
Junior Member
 
13 Posts |
Posted - Mar 06 2008 : 10:39:30 PM
|
#include <atlbase.h>
#include <atlwin.h>
//the files below is a part of WTL8.0 final version
#include <atlapp.h>
#include <atlmisc.h>
#include <atlcrack.h>
//in resource.h
#define IDR_BKG 101
#ifndef ULONG_PTR
#define ULONG_PTR unsigned long*
#endif
#include <GdiPlus.h>
#pragma comment(lib,"Gdiplus.lib")
using namespace Gdiplus;
typedef CWinTraits<WS_OVERLAPPED,
WS_EX_LAYERED|WS_EX_TOPMOST|WS_EX_TOOLWINDOW> CSampleWinTraits;
class CSampleWindow : public CWindowImpl<CSampleWindow,CWindow,CSampleWinTraits>
{
public:
CSampleWindow()
{
if (m_token == NULL)
{
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup( &m_token,&gdiplusStartupInput,NULL );
}
}
~CSampleWindow()
{
if (m_token != NULL)
{
GdiplusShutdown(m_token);
m_token=NULL;
}
}
public:
BEGIN_MSG_MAP(CSampleWindow)
MSG_WM_CREATE(OnCreate)
MSG_WM_DESTROY(OnDestroy)
MSG_WM_LBUTTONDOWN(OnLButtonDown)
MSG_WM_RBUTTONUP(OnRButtonUp)
END_MSG_MAP()//this is a macro,which color is wrong.
//sometimes when the function name "OnCreate" underlined,
//adding a "}" here can fix the problem--and of course,
//the complier error
//all the macros "MSG_WM_XXX" above are declared in atlcrack.h
//others are declared in atlwin.h
private:
int OnCreate(LPCREATESTRUCT)
{
//BLENDFUNCTION struct was declared at wingdi.h,but now the member
//of m_Blend underlined
m_Blend.BlendOp=0; //the only Blend Op defined in Windows2000
m_Blend.BlendFlags=0; //nothing else is special...
m_Blend.AlphaFormat=1; //...
m_Blend.SourceConstantAlpha=255;//AC_SRC_ALPHA
pImage=LoadFromResource(_T("PNG"),IDR_BKG);
ATLASSERT(pImage!=NULL);
Refresh();
return 0;
}
void OnDestroy()
{
PostQuitMessage(0);
}
void OnLButtonDown(UINT uFlags,CPoint& p)
{
SendMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(p.x,p.y));
}
void OnRButtonUp(UINT uFlags,CPoint& p)
{
DestroyWindow();
PostQuitMessage(0);
}
private:
Image* LoadFromResource(_U_STRINGorID type,_U_STRINGorID nID)
{
//CResource was declared at atluser.h,but now all member of
//resource underlined
CResource resource;
if (!resource.Load(type,nID))return NULL;
HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, resource.GetSize());
CopyMemory(GlobalLock(hMem),resource.Lock(),resource.GetSize());
GlobalUnlock(hMem);
CComPtr<IStream> pstm;
CreateStreamOnHGlobal(hMem,TRUE,&pstm);
// load from stream
Image* pImg=Image::FromStream(pstm);
ATLASSERT(pImg->GetLastStatus() == Ok);
return pImg;
}
BOOL Refresh()
{
CRect rct;
GetWindowRect(rct);
//CSize is declared in atlmisc.h(not the CSize of MFC),
//the CSize::Width() and CSize::Height() underlined,and
//the same member of CRect(also in atlmisc.h) underlined,too
CSize view(rct.Width(),rct.Height());
CClientDC dcScreen(m_hWnd);
CDC dcMem=CreateCompatibleDC(dcScreen);
//same problem with CSize::cx and CSize::cy
CBitmap bBuff=CreateCompatibleBitmap(dcScreen,view.cx,view.cy);
//CDC is declared in atlgdi.h,not MFC's,but the SelectXXXX member
//functions of CDC are all underlined,CDC is a typedef of CDCT<false>,
//is this the reason?
dcMem.SelectBitmap(bBuff);
Graphics gr(dcMem);
//same problem with gr and pImage
gr.DrawImage(pImage,0,0,pImage->GetWidth(),pImage->GetHeight());
return UpdateLayeredWindow( m_hWnd,dcScreen,&rct.TopLeft(),
&view,dcMem,&CPoint(0,0),0,&m_Blend,2);
}
private:
Image* pImage;
BLENDFUNCTION m_Blend;
static ULONG_PTR m_token;
};
ULONG_PTR CSampleWindow::m_token=NULL;
CAppModule _Module;
//when i paste this function from another cpp file,all vars of this
//function underlined, but after I reopen this file, they are all disappeared
//you can view the image when they're underlined at my blog
int CALLBACK WinMain(HINSTANCE hInst,HINSTANCE,LPSTR,int nCmdShow)
{
AtlInitCommonControls(ICC_WIN95_CLASSES);
_Module.Init(NULL,hInst);
CMessageLoop theloop;
_Module.AddMessageLoop(&theloop);
CSampleWindow test;
test.Create(NULL);
test.ShowWindow(nCmdShow);
test.UpdateWindow();
int ret=theloop.Run();
_Module.Term();
return ret;
}
//the codes are all right when you reopen the cpp file, but after you typed
//some other codes, some right code are underlined...
//I also use AStyle, is that course so many underlined? I found that the
//underlines all appeared after i called AStyle with Visual Studio
//"AStyle.exe --style=ansi -wyoOVXnm0 $(ItemFileName)$(ItemExt)"
//the code passed in Visual Studio 2005 SP1 with Windows Vista.
//the line below added to .rc file
//IDR_BKG PNG "bk.png"
Thank you for your interest in this issue. |
Edited by - StarWing on Mar 06 2008 10:43:20 PM |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19135 Posts |
Posted - Mar 07 2008 : 09:57:32 AM
|
Something odd is going on here. You are seeing a lot of problems, but I am only seeing one item underlined as a mistyped symbol.
Can you please go to:
VA Options -> System Info -> Copy Info
and paste the details (from the clipboard) into this thread. This will give us the basic information about your setup.
I am wondering if VA knows how to find the WTL header files. If it cannot find them, this might explain some of the problems you are seeing. |
zen is the art of being at one with the two'ness |
 |
|
StarWing
Junior Member
 
13 Posts |
Posted - Mar 08 2008 : 01:23:15 AM
|
VA_X.dll file version 10.4.1626.0 built 2008.01.17 Licensed to: VA X: StarWing. Support ends 2008.12.25 DevEnv.exe version 8.0.50727.867 msenv.dll version 8.0.50727.867 Font: Fixedsys 12(Pixels) Comctl32.dll version 6.10.6000.16386 Windows Vista 6.0 Build 6000 2 processors
Platform: Win32 Stable Includes: G:\\+?+?-?-?+?++-++?\\+?+?-?+?-?-?+?+++?+?\\C++\\#Common; D:\\Development\\Microsoft Visual Studio 8\\DirectX SDK (April 2007)\\Include; D:\\Development\\Microsoft Visual Studio 8\\Vista SDK\\include; D:\\Development\\Microsoft Visual Studio 8\\Vista SDK\\VC\\include; D:\\Development\\Microsoft Visual Studio 8\\VC\\include; D:\\Development\\Microsoft Visual Studio 8\\VC\\wtl\\include; D:\\Development\\Microsoft Visual Studio 8\\VC\\atlmfc\\include; D:\\Development\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include; D:\\Development\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;
Other Includes:
Stable Source Directories: D:\\Development\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc; D:\\Development\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm; D:\\Development\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl; D:\\Development\\Microsoft Visual Studio 8\\VC\\crt\\src;
I think VA can find the header files, because when i selected "turn to define" or "turn to declare", VA's behaviour is normal. |
Edited by - StarWing on Mar 08 2008 01:29:23 AM |
 |
|
Ivan A. Fotan
Ketchup Master
   
Ukraine
67 Posts |
Posted - Mar 08 2008 : 07:01:04 AM
|
WTL's macro BEGIN_MSG_MAP (and BEGIN_MSG_MAP_EX) makes VAX crasy and all members declared after message map are unreachable for VAX. I had report about this problem a long long time ago. but this problem was never fixed. looks like VAX developers don't use WTL, and it is out of their interest.  |
IAF |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19135 Posts |
Posted - Mar 08 2008 : 08:26:35 AM
|
StarWing if you place the caret into the file names in the #include lines:
#include <atlapp.h> #include <atlmisc.h> #include <atlcrack.h>
does VA show the correct path in the definition field? I am not seeing any sign of WTL in your stable include directories list.
Ivan do you have a simple code sample I can use to test this problem? Personally I do not have any experience with WTL.
It is possible that adding some form of "helper" macro to VA's stdafx.h file will help with this problem. |
zen is the art of being at one with the two'ness |
 |
|
StarWing
Junior Member
 
13 Posts |
Posted - Mar 08 2008 : 11:28:13 PM
|
D:\\Development\\Microsoft Visual Studio 8\\VC\\wtl\\include; the wtl header file folder is here.
yes, it shows. and when I move mouse to any syntax underlined. the tags works well. the only problem is just underlining. I think it's just the problem of BEGIN_MSG_MAP(BEGIN_MSG_MAP_EX), you can see this marco in my code. I think one of the reason is, After the marcoes, i didn't put a ";", so VAX think it is a wrong function define...
|
 |
|
feline
Whole Tomato Software
    
United Kingdom
19135 Posts |
Posted - Mar 10 2008 : 10:34:25 AM
|
Do you have a test project that shows this problem that you would be able to send me?
If so please submit the files via the form:
http://www.wholetomato.com/support/contact.asp
including this thread ID or URL in the description, so we can match it up.
You are seeing a lot of problems that so far I cannot reproduce. If we are both looking at the same test solution then that eliminates a couple of variables. |
zen is the art of being at one with the two'ness |
 |
|
Oswy
New Member

United Kingdom
4 Posts |
Posted - Jul 10 2008 : 04:28:32 AM
|
Feline, have you managed to get some sample code for this WTL problem. It's something that has been a problem here, for many years. So if you need a sample project, I can zip one up for you. I can't post it in open forum, as it is part of a commercial development. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19135 Posts |
Posted - Jul 10 2008 : 10:30:46 AM
|
If you have a sample I can look at that shows problems this would be very useful. I know some of our users work in WTL fairly successfully.
Any files you send me will only be used for testing purposes, and will be kept confidential. |
zen is the art of being at one with the two'ness |
 |
|
Oswy
New Member

United Kingdom
4 Posts |
Posted - Jul 12 2008 : 11:45:12 AM
|
If you can email me an address to send the zip file to, I'd be grateful. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19135 Posts |
Posted - Jul 14 2008 : 09:04:57 AM
|
Please submit the files via the form:
http://www.wholetomato.com/support/contact.asp
including this thread ID or URL in the description, so we can match it up. We had to disable the main support email address due to the amount of spam it was getting. |
zen is the art of being at one with the two'ness |
 |
|
Oswy
New Member

United Kingdom
4 Posts |
Posted - Jul 14 2008 : 12:18:27 PM
|
OK - will do. If I can't get it posted today, I'll do it Wednesday 16th. |
 |
|
Oswy
New Member

United Kingdom
4 Posts |
Posted - Jul 18 2008 : 05:22:15 AM
|
Feline, You should have email, containing a sample, that shows the problem. Should it be relevant, this sample was built with VS8 |
 |
|
|
Topic  |
|