|
One solution would be to not show the updated tree until it has been fully populated. Another (faster) approach is to only show those nodes that are actually visible. In other words, don't show a node's contents until it has been expanded.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
Please do not repost..
Regards,
Sandip.
|
|
|
|
|
I've written an application in VC6 that extends the capabilities/features of VSS. How can I include this application as an "Add In" in Visual Source Safe 6.0 ?
|
|
|
|
|
can anybody give me the source code for implementing worker thread model using boost library
|
|
|
|
|
Usually "please give me code" is not supported. Check out the documentation [^] instead.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ya...but can u atleast suggest how to go for it.
|
|
|
|
|
search "AfxbeginThread" in MSDN
You know some birds are not meant to be caged, their feathers are just too bright.
|
|
|
|
|
I want to implement it using boost.
|
|
|
|
|
I am try to deal with 16-bit bmp file with CImage class.
but when I load a 16-bit bmp file with CImage::load(LPCTSTR pszFileName) and get bits-per-pixel value by CImage::GetBPP, the return is 32 .
CImage imgOriginal;
hResult = imgOriginal.Load(m_FileName);
if(FAILED(hResult)){
}
int iBpp = imgOriginal.GetBPP();
I am using VS2008 in Windows Xp.
I can not find any comment about this from msdn, Could anyone tell me what happened in CImage::Load?
for a 16-bit bmp sample file, see : http://wvnvaxa.wvnet.edu/vmswww/bmp.html[^]
|
|
|
|
|
iBpp is 16 for me.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks very much for answer my qustion.
1.Did you test in windows xp? I tryed it again, and is still 32.
2.And I finded another stranged thing: If I right click that sample 16-bit bmp file to see it's property, It's 32 too.
Maybe this two things is connected, And if your OS not show 32-bit, That could be my OS problem.
|
|
|
|
|
fitatc wrote: 1.Did you test in windows xp? I tryed it again, and is still 32.
I first tested only on Vista Ultimate SP1. This morning I tested on
XP Pro SP3...same result... 16bpp
fitatc wrote: 2.And I finded another stranged thing: If I right click that sample 16-bit bmp file to see it's property, It's 32 too.
Are you sure you downloaded the right file?
I right-clicked the 16bit sample from the link and saved
it to my harddrive to test.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
// --- file's property --- //
Mark Salsbery wrote: Are you sure you downloaded the right file?
I right-clicked the 16bit sample from the link and saved
it to my harddrive to test.
Yes, I check it by Read it in Hex, it's 16.
42 4D 42 40 00 00 00 00 00 00 42 00 00 00 28
00 00 00 7F 00 00 00 40 00 00 00 01 00 10 00
03 00 00 00 00 40 00 00 00 00 00 00 00 00 00
...
but, In my OS, the file property is still 32.
I think it's may be my OS's problem, XP-Professional Version 2002 Service Pack 2.
And since I works in japan, my OS is janpanese version of WindowsXP.
// --- CImage --- //
Others in MSDN forum advised me not to use CImage, because it's for display.
And I find that I can't get "the type of compression" by CImage class,
So, is it possible that Cimage class change the "BI_BITFIELDS compressed 16-bit bmp"
to "uncompressed 32-bit bmp" in CImage::load?
|
|
|
|
|
fitatc wrote: Others in MSDN forum advised me not to use CImage
CImage just wraps a DIBSection and uses GDI+ for loading
and saving images. If that's what you need it can be used
for anything DIBsection-related, not just for display.
fitatc wrote: is it possible that Cimage class change the "BI_BITFIELDS compressed 16-bit bmp"
to "uncompressed 32-bit bmp" in CImage::load?
It's possible, but I don't know why it would be changed.
Run it in the debugger and step into the CImage::Load() code.
I did, and it looks like it is possible (in
CImage::CreateFromGdiplusBitmap()) to be converted to a
32bpp bitmap but that code is bypassed.
This shouldn't be OS related - GDI+ didn't change for years
before Vista.
It could be the version of CImage you're using however.
What Visual Studio version are you using?
Step into the code - it doesn't change magically
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: It could be the version of CImage you're using however.
What Visual Studio version are you using?
My visual Studio version is: 2008, Version 9.0.21022.0 RTM.
I steped into the code, as your said, It seems like the point is in
Bitmap::Bitmap(
IN const WCHAR *filename,
IN BOOL useEmbeddedColorManagement
)
{
...
lastResult = DllExports::GdipCreateBitmapFromFile(filename, &bitmap);
}
but I am not very familiar with GDI+, so I determined to study it for my question.
Thanks very much for your help, and I know how I can deal with the question like this now.
|
|
|
|
|
fitatc wrote: Bitmap::Bitmap
What is this? I thought you were using CImage?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: What is this? I thought you were using CImage?
Yes, I just steped into the CImage::Load()
It's like below:
atlimage.h
inline HRESULT CImage::Load( LPCTSTR pszFileName ) throw()
{
if( !InitGDIPlus() )
{
return( E_FAIL );
}
Gdiplus::Bitmap bmSrc( (CT2W)pszFileName ); ---- ★
if( bmSrc.GetLastStatus() != Gdiplus::Ok )
{
return( E_FAIL );
}
return( CreateFromGdiplusBitmap( bmSrc ) );
}
I steped into ★, because all the BMP data it's used below is from here,
and I get:
inline
Bitmap::Bitmap(
IN const WCHAR *filename,
IN BOOL useEmbeddedColorManagement
)
{
GpBitmap *bitmap = NULL;
if(useEmbeddedColorManagement)
{
lastResult = DllExports::GdipCreateBitmapFromFileICM(filename, &bitmap);
}
else
{
lastResult = DllExports::GdipCreateBitmapFromFile(filename, &bitmap); --- ★★
}
SetNativeImage(bitmap);
}
★★:this is what I posted in last time, sorry for confusing message.
|
|
|
|
|
Oh it was Gdiplus::Bitmap
Anyway, CreateFromGdiplusBitmap() is the method you want to step into.
That's the one that may change the format to 32bpp, but it doesn't
for me.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Also, if after stepping into the CImage loader code
you find it does't do what you want, it's pretty easy to
load BMP files yourself - much easier than other file
formats with complicated compression.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am calling a PostMessage function froma worker thread and passing it a user defined window message. Since i have to update the control's which cannot be done as part of thread. Therefore I want to send a sturcutre along with the PsotMessage().
Is it Possible to pass a structure in PostMessage() and if Possible please tell how.
Thanks In Advance
Dhiraj
|
|
|
|
|
Dhiraj kumar Saini wrote: Is it Possible to pass a structure in PostMessage()
yes
Dhiraj kumar Saini wrote: and if Possible please tell how.
Send:
Dynamically allocate memory your strucuture first
Fill structure
Pass structure
Read
When you receive the message, read type cast the parameter in the respective pointer
read the data
delete the pointer
struct DATA
{
int EventID;
CString ModuleName;
CString ThreatName;
} info;
info* ptr = new info;
ptr->EventID = Whatever;
ptr->ModuleName = Whatever;
ptr-> ThreatName = Whatever;
PostMessage(WM_MYMSG, reinterpret_cast<wparam> (ptr) , static_cast<lparam> 0);
info* ptr = reinterpret_cast<info*> wParam;
info obj;
obj.EvenID = ptr->EvenID;
obj.ModuleName = ptr->ModuleName;
obj.ThreatName = ptr->ThreatName;
delete ptr;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have used the following code but it is giving eroor
Please tell whats the problem
VisitorDetails stVisitorPrDetails
m_vSiteVisitor[n].GetDetails(stVisitorDetails);
PostMessage(WM_GET_DATA,reinterpret_cast<wparam> (stVisitorPrDetails) , static_cast<lparam> 0);
and
LRESULT CMainDlg::OnGetData(WPARAM wParam,LPARAM lParam)
{
VisitorDetails stVisitorDetails;
stVisitorDetails = reinterpret_cast<visitordetails> wParam;
return 0;
}
the errorr are:
Error 25 error C2061: syntax error : identifier 'wparam' c:\documents and settings\shy\desktop\sourcecodes 8-09-08\source code 06dec2007\maindlg.cpp 525
Error 27 error C2061: syntax error : identifier 'wParam' c:\documents and settings\shy\desktop\sourcecodes 8-09-08\source code 06dec2007\maindlg.cpp 1927
Error 28 error C2146: syntax error : missing '(' before identifier 'wParam' c:\documents and settings\shy\desktop\sourcecodes 8-09-08\source code 06dec2007\maindlg.cpp 1927
Please Help
|
|
|
|
|
Dhiraj kumar Saini wrote: Error 25 error C2061: syntax error : identifier 'wparam' c:\documents and settings\shy\desktop\sourcecodes 8-09-08\source code 06dec2007\maindlg.cpp 525
Error 27 error C2061: syntax error : identifier 'wParam' c:\documents and settings\shy\desktop\sourcecodes 8-09-08\source code 06dec2007\maindlg.cpp 1927
Error 28 error C2146: syntax error : missing '(' before identifier 'wParam' c:\documents and settings\shy\desktop\sourcecodes 8-09-08\source code 06dec2007\maindlg.cpp 1927
In the above I see wparam , then wParam , i.e. it seems you have to choose one between the two different names for your variable...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Dhiraj kumar Saini wrote: Is it Possible to pass a structure in PostMessage()
Yes.
Dhiraj kumar Saini wrote: if Possible please tell how
Pass a pointer to the structure as LPARAM. for instance:
static MyStruct ms;
UINT MyWorkerThread( LPVOID pParam )
{
ms.iProgress = 10;
PostMessage(hWnd, WM_MY_MESSAGE, (WPARAM)0, (LPARAM)&ms);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|