|
|
Hi,
I have a dialog with a bitmap background. When I put my radio buttons on the dialog, I cannot see the bitmap under the rectangle created by the radio button. I would like to see the bitmap under the radio buttons?
I can change the color if I want with:
HBRUSH RightDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = ShapedDlg::OnCtlColor(pDC, pWnd, nCtlColor);
if ( pWnd->GetSafeHwnd() == GetDlgItem(IDC_RADIO1)->GetSafeHwnd() &&
CTLCOLOR_STATIC == nCtlColor )
{
// m_bkbrush is a CBrush member variable
m_bkbrush.CreateSolidBrush ( RGB(255,0,0) );
pDC->SetBkMode ( TRANSPARENT );
return m_bkbrush;
}
return hbr;
}
but what can I do if I have a bitmap unstead of solid color?
any ideas?
Regards
Mykel
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Can you explain me how to use a buffer with no fixed lenght?
I need something like this:
CFile tmpFile(fileName, CFile::typeBinary | CFile::modeRead);
int fileLenght = tmpFile.GetLenght();
tmpFile(pBuf, fileLenght);
What kind of type is pBuf?
Can I use a LPBYTE?
Thanks!
PS: I've got to put the whole file (plain text) content in a CString variable.
Can you help me?
thanks!
|
|
|
|
|
use CStdioFile, it reads a line at a time to a CString
-c
To vote with no response is to follow the way of the coward.
|
|
|
|
|
I would use a loop to keep reading the file.. something like this.
CFile tmpFile;
CString fileName = "C:\\sometext.txt";
CString strStorage;
if(tmpFile.Open(fileName,CFile::modeRead))
{
char cBuf[1024];
UINT uBytesRead;
while(uBytesRead = tmpFile.Read(cBuf, sizeof(cBuf)-1))
{
cBuf[uBytesRead] = NULL;
strStorage += CString(cBuf);
}
tmpFile.Close();
}
I didnt compile this so it may have typo's.. Should point you in the right direction..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Create a small buffer then read the read and write the data using a loop some thing like this:
UINT uRead;
CString cs;
const UINT tmpRed = sizeof(tmpBuf)/sizeof(TCHAR) - sizeof(TCHAR);
do {
uRead = c.Read(tmpBuf,tmpSize);
if( uRead > 0 )
{
tmpBuf[uRead] = _T('\0');
cs += tmpBuf;
}
} while( uRead );
Trust in the code Luke. Yea right!
|
|
|
|
|
Sorry for this, but I do have no experience in visual c++.
I want to build an interface with four dialog windows. I know how to start the first dialog. But then, the main dialog has three buttons (A,B,C). When clicking on A, the main dialog window should be hidden an a new dialog window (WA) appears, after working wiht WA and click (RETURN TO MAIN) window WA disappears, and the main window appears. The same thing happens with buttons B and C.
If somebody can give me a hand I will appreciate it.
Thanks,
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|
|
When you press the button but before you show the new dialogbox call ShowWindow(SW_HIDE) and when the new dialogbox closes (returns control) then call ShowWindow(SW_SHOW).
That should do it, but you may have to create the new dialogbox with a NULL parent window for it to work.
Trust in the code Luke. Yea right!
|
|
|
|
|
I want to use a program that work on all windows platform without aditional library. So I use win32 project without using MFC and ATL. (Use Standanard Windows Library. ) Is that garanty that I don''t need any extra dll with my exe file?
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
It depends on what you mean by "extra." If in doubt, use the Dependency Checker tool.
|
|
|
|
|
Is that one of VS tools?
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
|
Sorry for bothering you again. Would you please tell me its exact exe file? I can't find it.
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
Assuming you installed it, look in the Microsoft Visual Studio 6.0 Tools menu. There, you'll find Depends and a whole mess of other nifty tools!
|
|
|
|
|
DavidCrow wrote:
Microsoft Visual Studio 6.0 Tools
Oh, Does it exist on VS.NET? I have VS7.
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
I couldn't tell you as I don't use that tool. With the information provided to you thus far, you should be able to ascertain if it is available.
|
|
|
|
|
It depends on which functions you are using. If you can run it on Windows 95 it should work..
Trust in the code Luke. Yea right!
|
|
|
|
|
I want to use on win98 and higher. I use some shell objects and sockets.
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
You just have to make sure the functions you are calling are supported [all that information is in the MSDN library]. You do have one other option: get BoundsCheck (or download the trial version from NuMega) and run a compliance report on you DLL (or App.), that will give you your answer.
FYI: Depends is under the Visual Studio 6.0 Tools->Depends.
Trust in the code Luke. Yea right!
|
|
|
|
|
John R. Shaw wrote:
FYI: Depends is under the Visual Studio 6.0 Tools->Depends.
Does it live in VS.NET?
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
I do not use .NET so I would not know.
Trust in the code Luke. Yea right!
|
|
|
|
|
|
Thanks.
Mazy
No sig. available now.
|
|
|
|
|
I have migrated the application to the .NET application. However, the resource file is not valid. When I click at the RC file from the Resource View pane, a popup message comes up saying "error RC2135:file not found:MENU". Then other similar messages pop up when I lick at the OK button. Then I tried to expand the RC, underneath it it says open in another editor.
-Elizabeth
Eilzabeth
|
|
|
|
|
what is the best way to create a windows shortcut file to the user's desktop from my application?
Any help would be great! thanks..
|
|
|
|