|
Thanks I will try that...
Not worried about handling DBCS strings. We build our software in all UNICODE, with a few exceptions where the interfaces call for DBCS. Then we worry but I have a good handle on that.
I also wrote a quick application to allow me to actually psudeo translate all the resources and insert DBCS characters in preparation for actually localizing the software.
The only thing I couldn't figure out was why the property pages and the wizards would always truncate the English version of the dialog boxes when running on a Japanese OS. The strings which would normally be wide enough on an English wizard would be too wide for the Japanese wizard. If I expand the size of the English dialog resources without expanding the controls, then they would fit. However this made it look bad in English.
I think this solution will help and I will try it.
Thanks,
Brian
If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
|
|
|
|
|
Hi guys
Sorry for the silly question, but what's the way to change the name of the actual document in a document/view application?
Doc
|
|
|
|
|
See CDocument::SetTitle().
onwards and upwards...
|
|
|
|
|
I've re-written Franky Braem's Filemonitor control using ReadDirectoryChangesW to return the full paths only of files ADDED to a particular directory . It apparently seems to work, but I noticed that when I use the control in other applications (in this case one written in VB6) to report multiple simultaneous files added to any subdirectory of a given directory, the control randomly duplicates the full filename of a notification in other notifications, that is, if I add files A, B, C, D and E to a directory at the same time, the control might report that I've added files C, B, C, D and D (the number of notifications is correct, but the returned values quite frequently aren't.)
I've made no changes to the interface, but needed to declare a global handle to the completion port and a global buffer to hold the directory info which I needed to share between the methods of the control and the thread created to wait on the notifications.
What could be wrong here?! Please help...
|
|
|
|
|
How do i perform this conversion
My a CDialog object to a Hwnd
Engineering is the effort !
|
|
|
|
|
What do you mean, converting a window derived class to a handler ?!?
Maybe you want to get a handler to the window? That's already available in m_hWnd!
SkyWalker
|
|
|
|
|
You can't "convert" a CDialog to a HWND , but you can access it's window handle by calling GetSafeHwnd() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I used unix g++ to compile a lapack library, the result library is in .a extension.
Could I use it in window VC++?
thanks
|
|
|
|
|
No. The format of a Windows .lib is not the same as a .a . (Neither is a .dll the same as a .so ).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Does anyone has experience in using clapack in visual c++ 6?
Could you teach me how to link it and use it in VC?
thanks
|
|
|
|
|
|
Hi Guys,
Iam working on Vc++, & came across a problem.Hope someone could help!.
Iam Using device Context for diplaying things to the view.
Initially,I write a "text" to the view using "TextOut" method - See Code:
& Then using the "BRUSH" object to fill the rectangle with that colour,using "FillRect" method.Now the "text" which was displayed in the same postion before is not Visible anymore .
My need ,is after writing a "Text" to the view & filling the rectangle containing the text with a colour,want the underlying "text" to be visible(which is not the case now).
Ofcourse,I know that If I set the BackgroundColour atfirst & then write the "text" to the screen,then the "text" will be visible.
But I would not be able to do so co's of some restrictions in my Project...
I want the text "Shading test" to be displayed with the blue background colour.Constraint being,I can't Fill the rectangle with the colour & then draw the text.....
Would be nice if someone could suggest something to do in this regard with respect to the code below.
Thanks......
pDC->SetBkMode(TRANSPARENT);
CRect rect;
GetClientRect(rect);
rect.SetRect(0,0,800,800);
pDC->Rectangle(CRect(0,0,800,800));
SIZE size;
size.cx = 1000;
size.cy = 1000;
SetScrollSizes(MM_TEXT,size);
pDC->TextOut(50,20,"Shading Test");
CRect rect1;
rect1.SetRect(10,10,300,100);
pDC->Rectangle(CRect(10,10,300,100));
CBrush brushBlue(RGB(240,248,255));
CBrush* pOldBrush = pDC->SelectObject(&brushBlue);
pDC->FillRect(rect1,&brushBlue);
|
|
|
|
|
I suggest that you rework your code so that you can fill the background before writing the text out!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
In one of my apps I need to present the user with a Directory structure (like in windows explorer) . I want to allow the user to only select the folder . Based on this I need to do further actions . Can the usual CFileDialog class serve this purpose ? .
|
|
|
|
|
|
OnDisplay()<br />
{<br />
char str[MAX_PATH ];<br />
BROWSEINFOA lpbi;<br />
lpbi.hwndOwner=this->m_hWnd;<br />
lpbi.pszDisplayName=str;<br />
lpbi.lpszTitle="Test";<br />
lpbi.ulFlags=0;<br />
CoInitialize(NULL);<br />
OleInitialize(NULL);<br />
SHBrowseForFolder(&lpbi);<br />
<br />
<br />
}
For some reason the call to ShBrowseForFolder crashes .
|
|
|
|
|
I found something like this,
and it works for me...
CoInitialize(0);
BROWSEINFO bi;
char cc[MAX_PATH];
bi.hwndOwner=m_hWnd;
bi.pidlRoot=0;
bi.pszDisplayName=cc;
bi.lpszTitle="";
bi.ulFlags =0;
bi.lpfn =0;
bi.iImage=0;
LPITEMIDLIST p;
p=SHBrowseForFolder(&bi);
if(!p)
return;
SHGetPathFromIDList(p,cc);
SetDlgItemText(IDC_E_PATH,cc);
IMalloc *pm;
SHGetMalloc(&pm);
pm->Free(p);
|
|
|
|
|
Thank you for the help
I wasnt doing this
bi.pidlRoot=0;
hence the crash .
Another question
using LPITEMIDLIST p how do I get the FilePath ?
|
|
|
|
|
act_x wrote:
Can the usual CFileDialog class serve this purpose ? .
Yes, but SHBrowseForFolder() is going to be easier.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
Setting the edit box text via SetWindowText does not work inmediatelly if you set it from one of the handlers of your dialog. Instead, the update will happen only after the handler ends its run.
void CDemoDlg::OnNewBnClicked()
{
m_newBtn.EnableWindow(FALSE);
GetDlgItem(IDC_STATUS_EDIT)->SetWindowText("New"); <font color=#AA0000>
...
<font color=#AA0000>
...
m_newBtn.EnableWindow(TRUE);
}
If I replace the Edit Control with a static control, the text is updated inmediatelly. (Before the button control is enabled)
I guess that the answer is the use of SendMessage and PostMessage.
Is there a way to update an edit control inmediatelly and not wait till the handler ends?
Any hint? (I need an edit control there)
Another example:
void CDemoDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
HWND hwnd = pScrollBar->GetSafeHwnd();
if (hwnd == m_mainCursorSliderCtrl.GetSafeHwnd())
{
int pos = m_mainCursorSliderCtrl.GetPos();
if (pos != m_mainCursorPosition)
{
CString text;
m_mainCursorPosition = pos;
text.Format("Main:%d", pos)
GetDlgItem(IDC_STATUS_EDIT)->SetWindowText(text);
GetDlgItem(IDC_STATUS_STATIC)->SetWindowText(text);
UpdateListControlData();
}
}
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
The list control and IDC_STATUS_EDIT is update only when the slider-bar stops, while the IDC_STATUS_STATIC is updated on real-time.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Is it possible to create nested directories using CreateDirectory()?How exactly?
|
|
|
|
|
|
Hi all,
I've written a program (with bits taken out of various Articles on here) which captures the screen and then saves the screen shot as a bitmap.
I've got this working as a standalone executable however I now need to be able to do this from within a dll. The problem I've got is that as soon as I get to the line in the dll where I use a pointer to the CWnd* from the calling application I get a crash. At first I thought it was case of the CWnd pointer going out of focus so I tried GetSafeWnd but I get the same error (the reason I'm passing this in is that I need it for the creation of my dc and also to get the screen size).
Does anyone know what I'm doing wrong and how to correct it (I'm using MS VC++ 6.0)
TIA,
Andy
|
|
|
|
|
managed to solve this by not passing a CWnd pointer into the dll. WHat I've done is to call GetDesktopWindow within the dll, this returns a valid CWnd* which I can use
|
|
|
|
|
The crash occurs as thread local storage is used for CWnd objects. It is possible to pass the windows HWND (using CWnd::GetSafeHwnd() ) and then wrap that up in a new CWnd object within the DLL if desired.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|