|
Handle the WM_CLOSE message. This also gets sent if the user hits Alt+F4, if that's important.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Thank you. I thought I tried that but obviously I did not. Works great.
Brad
|
|
|
|
|
ActiveX control (COleControl) as property in other ActiveX control?
|
|
|
|
|
Hi,
I am trying to write a proxy server but have run into a major problem. When
i try to read from a connected socket, it reads a couple of times and then
i get a connection reset from peer error in the errno var. Below is a
portion
of the code. Can anyone tell me what i am doing wrong?
if (write(sockfd, tempBuffer, sizeof tempBuffer) < 0)
errexit("echo write: %s\n", strerror(errno));
bytesReceived = read(sockfd, buf, sizeof buf);
if (write(fd, buf, sizeof buf) < 0)
{ errexit("echo write: %s\n", strerror(errno)); }
/* Is it a html page or image file */
headerResult = CheckHeader(buf);
if (headerResult == 0) /* html page */
{
while (bytesRead > 0)
{
bytesRead = read(sockfd, buf, sizeof buf);
if (write(fd, buf, sizeof buf) < 0)
{ errexit("echo write: %s\n", strerror(errno)); }
}
}
else
{
while ((bytesReceived < headerResult)&&(bytesRead > 0))
{
bytesRead = read(sockfd, buf, sizeof buf);
if (bytesRead < 0)
{ errexit("echo read: %s\n", strerror(errno)); }
bytesReceived = bytesReceived + bytesRead;
if (write(fd, buf, sizeof buf) < 0)
{ errexit("echo write: %s\n", strerror(errno)); }
}
}
shutdown(fd,1);
close(sockfd);
--------------
http://www.SaudiABM.com
|
|
|
|
|
I’m a new user in Microsoft Visual C++ and I’m having a problem using SQL and stored procedure. I’m trying to create a new application using ODBC but the menu new stored procedure in DataView was disabled (not active), so I can’t create new procedures. For information, I use Pervasive.SQL Database.
So I was wondering whether anyone can tell me how to create new procedures and connect it to Visual C++, or are there any other way on using and executing SQL commands in Visual C++ ? And, can I have some example as well ?
Thank you for your help.
Kathrin
horas
|
|
|
|
|
nobody answer my question, did my question too difficult or too easy?
Kathrin
|
|
|
|
|
You might want to look at the docs for SQLExecDirect in the MSDN.
|
|
|
|
|
I want a class to have a member variable: PAVISTREAM *m_pavistream. Visual C++ does not share my viewpoint, and gives me many errors in the .h file:
syntax error : missing ';' before '*'
error C2501: 'PAVISTREAM' : missing storage-class or type specifiers
error C2501: 'm_pavistream' : missing storage-class or type specifiers
However, this works fine when I have the stream as a local variable. I'm not seeing what's wrong with this declaration. But then again, I don't know anything about the stream interface, so that could be my problem Ideas?
thanks-
jake
|
|
|
|
|
Ditch the P in front of it and make it IAviStream * m_pAviStream. Also, don't forget to include VFW.h and link with VFW32.LIB
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I am developing a program that resides in the system tray and want it to start hidden. But, I am having a slight problem. I know how to start with the main window hidden, that's the easy part. The part that I'm having trouble with is that when I start the program you can see the main window flash for a split second. I've tried removing WS_VISIBLE from the mainframe, SW_HIDE on m_pMainWnd in theApp class, adding WS_ICONIC to the mainframe style, but no go. Any help on this is greatly appreciated.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
try to resize the window to zero by using the method call MoveWindow(...)
Good luck.
|
|
|
|
|
This is a wierd situation, and the solution is even wierder. I had to do this in an app a while ago and it took me a while to solve it.
Change this:
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
To this:
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
And add this:
m_nCmdShow = SW_HIDE;
Right before you register your doc templates.
Hope this helps,
Frank
|
|
|
|
|
Thanks for the info. It surprisingly worked, somewhat. It does start hidden but when the listview refreshes the first time (2-3sec after startup) it flashes on screen. I don't see why the m_nCmdShow is any different than just passing it a simple SW_HIDE but it works better. Thanks.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Ok, after further analysis I've discovered the problem. After the view refreshes I have a function called ProcessReminders() and in it if a reminder has the dialog option set that means show the window. I call showwindow on the mainframe ((CMainFrame*)AfxGetMainWnd())
and pass it SW_SHOW which causes it to be shown but then the app hides it do to the SW_HIDE value of m_nCmdShow. If I comment out the showwindow line everything starts up how I want it to, but if a reminder is set to show the window I need it to show.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Cool...glad you got it working the way you wanted.
Cheers!
Frank
|
|
|
|
|
In the program of a recognizer, I intend to set up a timer each time I finish a stroke, if a new stroke begins before the time out then reset the timer, otherwise invoke a function to recognize the strokes and kill the timer. It seems the SetTimer() can not be linked to an object. Is there any one knows how to do it?
|
|
|
|
|
|
See my reply to this question on PocketProjects.com
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Hi forum,
Questions:
Does anyone know how to retrieve the actual column arrangement?
Does anyone know how to do the drag/drop-operation programmatically?
Underlying concept:
I know that with a cole like this you may enable Drag & Drop Column arrangement in a CListCtrl:
DWORD dwStyle = List.GetExtendedStyle() | LVS_EX_FULLROWSELECT |
| LVS_EX_HEADERDRAGDROP;
List.SetExtendedStyle(dwStyle);
This is not only cool, it even works fine (if IE4 is installed).
Now I would like to save the column arrangment for a give CListCtrl to enhance my user interface.... (see questions)
Thanks for any ideas!!!
Thomas
|
|
|
|
|
|
1. Why this returns -1:
LONG xx=MCIWndOpenDialog(m_hMCIWnd), where hMCIWnd is a valid handle to the window created by calling:
m_hMCIWnd=MCIWndCreate(this->GetSafeHwnd(),
AfxGetInstanceHandle(), WS_VISIBLE|WS_CHILD|MCIWNDF_SHOWALL|MCIWNDF_NOTIFYSIZE|MCIWNDF_NOTIFYPOS,NULL);
No open dialog is shown.
2. Problem 2: Why "Open" selected from the popup menu lunched from the menu button doesn't do anything?
Jerzy
|
|
|
|
|
I'm using some code to attempt to open an AVI stream. The code compiles in visual c++, but gives me 3 fatal linking errors. These are the errors:
error LNK2001: unresolved external symbol _AVIStreamLength@4
error LNK2001: unresolved external symbol _AVIStreamReadFormat@16
error LNK2001: unresolved external symbol _AVIStreamOpenFromFileA@24
Debug/Capture.exe : fatal error LNK1120: 3 unresolved externals
The _AVI symbols are the names of the 3 functions I attempt to call - I assume they are in vfw.h, which I include. Ideas?
thanks-
jake
|
|
|
|
|
|
I'm using Windows NT 4.0 and Visual C++...
Anyone knows how to verify if a process is running in other machine whitout use registry key handles ?
|
|
|
|
|
Hi All,
How can I apply a shading to text in a Rich Edit Control?
CRichEditCtrl::SetBackgroundColor() changes the background
color for the entire CRichEditCtrl window, but how do I
just apply a shadding (or background color) to a selected
piece of text? Word is able to do it.
-Michael
|
|
|
|