|
You should look at tools like GNU autoconf/automake. I don't know if they work on windows, but they help a lot in dealing with the differences between various Unix versions.
Of course if you only target one Unix (Solaris) you won't care, and even with two it might not be worth the trouble. If you want to make an attempt at supporting more (say all of them...) you will want some help.
|
|
|
|
|
How can I reach pixels of an pictureBox for changing their color attributes.
|
|
|
|
|
IPicture interface returns HDC
HRESULT get_CurDC(
HDC* phdcOut //Receives a pointer to device context
);
Use
COLORREF GetPixel(
HDC hdc, // handle to DC
int nXPos, // x-coordinate of pixel
int nYPos // y-coordinate of pixel
);
COLORREF SetPixel(
HDC hdc, // handle to DC
int X, // x-coordinate of pixel
int Y, // y-coordinate of pixel
COLORREF crColor // pixel color
);
|
|
|
|
|
I've recently upgraded (downgraded, you decide which) to VStudio 7.1 from VC6 and start development of a new app. Everything was working fine (cursing was being kept to a minimum) when the properties window decide to stop displaying properties, i.e., the window appears but with no fields - just a big blank gray window!
Any suggestions on how to get it back? (Its really tough designing dialogs without the property window!!)
Regards,
Kylur.
|
|
|
|
|
The property window displays the properties of the active dialog/class. Remember to click on the dialog or the class implementation file (Open it, and click somewhere) to update the properties window.
If this does not help, back up your projects, uninstall both VC6 and VC7, then do a fresh install of VC7. I have never experienced this problem myself, so it might be a result of unsuccesfull installation.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I've just started a new MFC program and the main window opens with a size i'd like to change.
there's no create i can find. How do i resize the window? should i do it in the CMainFrame::OnCreate?
thanks
|
|
|
|
|
see "The MFC Answer Book", E. Kain, FAQ 3.9.
Basically put a MoveWindow(...) in the OnCreate method.
Regards,
Kylur
|
|
|
|
|
Hi,
Use PreCreateWindow to set initial CMainFrame size.
////////////////////////////////////////
// Set initial window size to 200 x 200
//
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
BOOL bRet = CFrameWnd::PreCreateWindow(cs);
cs.cx = cs.cy = 200;
return bRet;
}
Oleg.
|
|
|
|
|
|
Dear all,
How to set the delay time for the ToolTips control unlimited? I used the function SetDelayTime(TTDT_AUTOPOP, iDelayTime), but it seemed that the iDelayTime couldn't be greater than 5000 miliseconds. Thanks .
Best regards.
____
Tuan
|
|
|
|
|
Hi,
I'm trying to view some resultes in a list box and I can not see all of them because I do no have a horizontal scroll bar. I checked the horizontal scroll bar in the options of the List box, but still I get only the vertical scroll bar.
tx...
Mirelutza
|
|
|
|
|
I think you have horizontal and vertical confused. A horizontal scroll bar is on the bottom, and a vertical scroll bar is on the right. A horizontal scroll bar is not going to care how many items are in the list, and a vertical scroll bar is not going to care how long each item is. See the difference?
It sounds like you need to send the LB_SETHORIZONTALEXTENT message. Or if you are using MFC, call the SetHorizontalExtent() method.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hello again,
I tried to send a message like you told me,but still it's not working. Am I doing something wrong by calling:
SendMessage(hDlg,LB_SETHORIZONTALEXTENT,25,0);
Regards
Mirelutza
|
|
|
|
|
>SendMessage(hDlg,LB_SETHORIZONTALEXTENT,25,0);
SendMessage(hListBox,LB_SETHORIZONTALEXTENT,25,0);
Message has to go to the ListBox window.
|
|
|
|
|
Hi,
The handle to the list box is an int and in the SendMessage function the firs parameter si HWND, and even if I upcast the int to HWND it's not working...
The ListBox is in the hDlg window which is a dialog box. In the dialog box I have some more objects, so if I send the message to the Dlg window is not right.
I even tried to get the HWND parameter of the listbox with getdlgitem function and still it's not working.Do you have any sugestions...???
Tx
Mirelutza
|
|
|
|
|
Hi again...
I found the problem! It was because of the third parameter! So thanx for your help!!!
Mirelutza
|
|
|
|
|
How I can catch Return Key when the focus is in a CListBox control.
I tried with OnKeyDown() method but I can't catch it.
|
|
|
|
|
|
Hi there,
You could use PreTranslateMessage, e.g.
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
BOOL bEatMsg = FALSE;
if (pMsg && pMsg->message == WM_KEYDOWN)
{
if (pMsg->hwnd == m_ctrlListBox.GetSafeHwnd())
{
switch (pMsg->wParam)
{
case 13:
bEatMsg = TRUE;
break;
}
}
}
return bEatMsg?TRUE:CDialog::PreTranslateMessage(pMsg);
}
Here's the function declaration:
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
Remember to put the declaration in your AFX_VIRTUAL(CMyDlg) macros so as not to confuse ClassWizard
Hope this helps,
Andy
|
|
|
|
|
I have a Pipe client which need to send data to the Pipe server. It used to send the data to screen via print statements. However, now it needs to use pipes to send data to another process (the server). I wish to change as little as possible on the orginial code. I don't want to have to go back and replace all of the print statements with WriteFile statements if it can be avoided.
|
|
|
|
|
So what is the problem?
Kuphryn
|
|
|
|
|
Write Your own Myprintf version and call writefile from that function and change printf to Myprintf. Copy printf from printf.c maybe available someplace
|
|
|
|
|
Can someone tell me if I have got this scheme correct for using Mutex's for controlling access to shared data (memory mapped) between two programs.
Each program creates the Mutex as follows:-
m_hMutex = ::CreateMutex(NULL,FALSE,"CSLSharedMemLock");
Each program uses the following procedure before read/write operations:-
<big>bool WaitForMutex(void)<br />
{<br />
<br />
<br />
if(m_hMutex)<br />
{<br />
if (::WaitForSingleObject(m_hMutex,INFINITE) == WAIT_OBJECT_0)<br />
{<br />
return true;<br />
}<br />
return false;<br />
}</big>
then we read data or write data and release the handle.
<big>ReleaseMutex(m_hMutex);</big>
and then
<big>CloseHandle (m_hMutex);</big>
The 2 programs (EXE and DLL) work OK without using the Mutex, but lock up as soon as I start to use a Mutex; i.e. never return from WaitForMutex in the EXE program.
I did check the value of the HANDLE and were as follows:-
In the DLL 0x00000084 and in the EXE 0x00000128 and the Mutex name is the same in both.
I want to protect the shared data, any comments?
|
|
|
|
|
Assuming you call CloseHandle() right after ReleaseMutex(), the mutex handle that is passed to WaitForSingleObject() is no longer valid.
Kuphryn
|
|
|
|
|
Does this mean that I hace to Create the Mutex again before doing another WaitForSingleObject?
So for each data access do I do the following
Create(M);
WaitForSingleObject
ReleaseMutex(m);
CloseHandle(m);
This that correct?
|
|
|
|