|
There are heaps of ways to save bmp's, some here on CP, others mentioned in the FAQ. To get the bitmap off the control, you can just use BitBlt, either from the screen DC, or see if it's possible to get a DC from the control ( I think so, but I can't remember ).
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
you cannot grab the window if it is minimized; the window must be visible and on top of the other.
|
|
|
|
|
hey how do I know which tab is selected? i handle to tab change message but i cant figure out which tab it not active.
thanks in advance
luke.
|
|
|
|
|
hey i firgured it out, now i feel dumb for asking so don't worry,
Luke
|
|
|
|
|
hey is there a way to make the apps built in vc.net use the last version of MFC not 7.0 or which ever it is that comes with vc.net?
thanks, bye
luke.
|
|
|
|
|
No.
Why would you want to do this? If you don't want to distribute the MFC7 dll's then you can always link MFC as a static lib.
Michael
Life’s not a song.
Life isn’t bliss.
Life is just this.
It’s living. -- Buffy the Vampire Slayer: Once more, with feeling
|
|
|
|
|
Hi,
currently I work with a CSocket derived class to poll UDP servers and receive some packets from them. But there's one function CSocket does not seem to provide: A timeout for the receive function. I want my program to wait no longer than 1 second for the server packet receival. Is there a way to accomplish this?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You might want to try using CAsyncSocket instead. From the MSDN, it appears to give you more control over blocking.
Another option would be to have a 'watchdog' thread. Each time the receive thread tries to read a packet, it should reset the watchdog timer. The watchdog thread waits for the watchdog timer to expire. If the timer ever expires, the watchdog thread handles the timeout condition, perhaps by terminating the receive thread, closing the socket (which will return an error to the receive thread), or whatever action is appropriate to your application.
Software Zen: delete this;
|
|
|
|
|
Thanks!
I tried a simple timer (without a second thread). Seems to work fine however
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all
I am wondering where i can find some information or example about how to create a new moniker of a program, especially url moniker. i've read the articles in MSDN about moniker, but it doesn't tell how to implement the interfaces and others.
anybody can provide me some articles or books i can find that in?
|
|
|
|
|
I am new to programming but I need to make a message box pop up on my screen everday at 5pm. From what I understand I need to use the ontimer function to do this. I was given some instructions on how to do it in the past but I didn't understand enough of the terms to do what was being talked about. Does anyone have some source code with some simple instructions that show how I could do this? Thank you very much. Mavrock
|
|
|
|
|
Well, you can use WM_TIMER, but I wonder if you'd be better off figuring out how to poll the system clock. Obviously you still need to use a timer, but it would be more reliable than trusting the timer alone. Create an MFC project, dialog based, hit CTRL_W to bring up the class wizard, add an OnTimer message handler. In your initial code add something like:
SetTimer(42, 60000, NULL);
Then in your OnTimer, check the timer id to see if it's 42, if it is, check the time and then either reset the timer for another minute, or show your message box.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
How can i detect the current system XP color scheme...
|
|
|
|
|
I'm working on an ATL Control for performing some graphic operations to be deployed to users in VB. I've got all my properties persisting etc, but while the control is in the development environment, and a property is changes, how do I get the windows to redraw ??
Currently the form containing the control must be closed, and then reopened.. There must be a better way.
This control doesn't use MFC.
|
|
|
|
|
Never mind, after further searching I found the answer.
You have to Call FireViewChange() after changing a property value.
http://msdn.microsoft.com/library/en-us/vcmfc98/html/vcconexampleimplementingpropertypage.asp?frame=true
|
|
|
|
|
just wondering, how to "calculate" average "request per second" given the number of employee in an organisation?
i need this figure so that I can conduct a test with Application Test Center
Thanks.
norm
|
|
|
|
|
What do you mean ? Are you asking about asp page requests ( I'm guessing based on what else you've been asking about ) ? If so, this is the wrong forum, and there is no real way to answer it. Are the employees going to use your system non-stop ? How long will they look at each page ? There are a lot of variables to consider.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Just want to general direction. I wish SQL server to notify a windows service i write everytime table schema has been altered as opposed to having the service to periodically poll the database via ADO or ODBC (that'll work, but a bit amateur). Yet one other option is to monitor transaction log for ALTER DATABASE. Is it true that this must be done thru DMO? and direct access to trn files should be avoided?
i was thinking triggers, but they are for insert/update/delete
is there any "trigger" for schema change, say, drop column? ALTER DATABASE? Once this problem is solved, I can communicate with a Windows Service via one of the following mechanism...
OPTION 1: OLE Automation Procedures: Allows standard OLE automation objects to be used within a standard Transact-SQL batch. So, I'll use a stored procedure to invoke a COM server to inform the windows service that table schema has been changed.
For instance:
sp_OACreate progid, | clsid,
objecttoken OUTPUT
[ , context ]
OPTION 2: xp_cmdshell (security concern)
OPTION 3: DTS to export schema to a flat file.
Unfortunately, All requires some sort of mechanism that invoke the store procedure or DTS package. And Triggers cant do the job.
Any suggestion?
norm
|
|
|
|
|
Hi,
I just need to need how to play a midi instrument sound... Please, not how to playback midi-files - just how to play different notes!!!
I have currently got a working program using only MFC that reads the midi-in, but I might switch to directX if that is easier to implement...
(I am trying to write a program that reads tones from midi-in, and then plays three notes tango-style based on the note hit on the midi-keyboard...)
Thanks alot,
|
|
|
|
|
Is there a sure fire way of predicting a dialog's rectangle without creating it?
Happy programming!!
|
|
|
|
|
I've not done this, but it appears you can find this information out by loading the dialog resource into memory without actually creating the dialog. Look up the functions FindResource , LoadResource , and LockResource for how to load the dialog resource into memory. Look up function CreateDialogIndirect and structure DLGTEMPLATE for information on what the memory looks like.
Software Zen: delete this;
|
|
|
|
|
I'm having difficulty with implementing a custom MFC control on an eVC Pocket PC dialog-type application. I create a custom control derived from CStatic following the methods of the CDoubleListPicker custom control example I found on this site, and when I run the program I can see the caption fine, but not the sub-controls that are created in my custon control.
Just to check on this problem, I took the CDoubleListPicker application and ported it to eVC, basically taking out things that aren't supported by the eVC environment, like the about box and resizing of the dialog. When I run this program, I have the same problem that none of the internal controls of CDoubleListPicker appear. I really made an effort to only take out the code that the compiler gave errors on, so I don't think I took out anything critical.
I will admit that I am only running this on the emulator, as my new device has not arrived yet, but I wanted to get a head start on programming...
Here's the class that I created, as well as what I think are the most critical functions.... Note that in the app I added a CStatic object to the dialog using the graphical dialog editor, and associated this control with the variable m_FileChooser of type CFileChooser (the custom control class).
Any help would be appreciated.
class CFileChooser : public CStatic
{
public:
CFileChooser();
public:
#define ID_BASE_ID ((UINT)-1)
enum {
ID_DIR_DROP_BOX = (ID_BASE_ID - 1),
ID_FILE_LIST_BOX = (ID_BASE_ID - 2),
};
public:
public:
virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
protected:
virtual void PreSubclassWindow();
public:
virtual ~CFileChooser();
protected:
void DoSizing();
int CreateChildControls();
CComboBox m_dirDropBox;
CListBox m_fileListBox;
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg void OnEnable(BOOL bEnable);
DECLARE_MESSAGE_MAP()
};
int CFileChooser::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatic::OnCreate(lpCreateStruct) == -1)
return -1;
if (!CreateChildControls())
return -1;
return 0;
}
void CFileChooser::PreSubclassWindow()
{
CStatic::PreSubclassWindow();
SetWindowText(_T("FileChooser"));
ModifyStyleEx(WS_EX_STATICEDGE, 0);
CreateChildControls();
DoSizing();
}
int CFileChooser::CreateChildControls()
{
if (m_dirDropBox.GetSafeHwnd() != NULL)
return TRUE;
CWnd* pParent = GetParent();
if (pParent == NULL)
return FALSE;
CRect rc(0, 0, 0, 0);
if (!m_dirDropBox.Create(DW_DROP_STYLE, rc, pParent, ID_DIR_DROP_BOX))
return FALSE;
if (!m_fileListBox.Create(LBS_MULTIPLESEL|DW_LIST_STYLE, rc, pParent, ID_FILE_LIST_BOX))
return FALSE;
BOOL bEnable = IsWindowEnabled();
BOOL bShow = (GetStyle() & WS_VISIBLE);
m_dirDropBox.EnableWindow(bEnable);
m_dirDropBox.ShowWindow(bShow ? SW_SHOW : SW_HIDE);
m_fileListBox.EnableWindow(bEnable);
m_fileListBox.ShowWindow(bShow ? SW_SHOW : SW_HIDE);
return TRUE;
}
void CFileChooser::DoSizing()
{
if (m_dirDropBox.GetSafeHwnd() == NULL)
return;
if (GetParent() == NULL)
return;
CRect rc;
GetWindowRect(&rc);
GetParent()->ScreenToClient(&rc);
m_dirDropBox.ShowWindow(GetStyle() & WS_VISIBLE ? SW_SHOW : SW_HIDE);
m_dirDropBox.MoveWindow(rc.left, rc.top, rc.Width(), DROP_BOX_SIZE);
rc.top += BOX_CTRL_GAP + DROP_BOX_SIZE;
m_fileListBox.MoveWindow(rc.left, rc.top, rc.Width(), rc.Height());
RedrawWindow();
m_dirDropBox.RedrawWindow();
m_fileListBox.RedrawWindow();
}
- Kati
|
|
|
|
|
In order to do this so my edit control can be resized everytime the text changes I assume I have to use SendMessage(hwndEditCtrl, EM_SETMARGINS, EC_USEFONTINFO, NULL); I have yet to accomplish this task...Can anyone give some advice as to how to approach this problem?
|
|
|
|
|
You can size the edit control with MoveWindow or SetWindowPos.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
|