|
In the first NM_CUSTOMDRAW message, you need to return CDRF_NOTIFYITEMDRAW in order to get messages for each item's prepaint stage.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
How do you prevent a dialog box in an MFC app from closing when the user hits the Enter key?
|
|
|
|
|
Hi David !
Override OnOK() method in your dialog class and leave this method blank.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Override the OnOk() and OnCancel() function of the CDialog class. Another way is to map the WM_CHAR message for the dialog. I hope this helps.
|
|
|
|
|
Hi all.
I want to give telephone number to mscomm object,
So, i must use BSTR string ???
Because, SetOutput() function get VARIANT variable ...
If your reply is YES, please write example about converting char * variable to BSTR variable.
And write example about give data to BSTR variable.
Thanks.
void CTerminalDlg::OnFileConnect()
{
m_comm.SetCommPort(3);
m_comm.SetSettings("9600,N,8,1");
m_comm.SetRThreshold(255); // BITS FOR RECEIVE ...
m_comm.SetPortOpen(TRUE);
m_comm.SetOutput(/* MY QUESTION ... */);
m_comm.SetPortOpen(FALSE);
}
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
char* str = "hello world";
BSTR bstr = _bstr_t(str);
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
Now, How can i set bstr variable to the VARIANT structure ??? because i must use of VARIANT variable in SetOutput() function ...
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
_variant_t vtFld;
vtFld.vt = VT_BSTR;
vtFld.bstrVal = _bstr_t(strValue);
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Thanks alot for your useful example about using variant.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
strange the vb sample in MSDN uses Chr$(13)
not Chr$(13) & Chr$(10)
any how CR is presented by '\r' and LF is presented by '\n'
Now I know,
cheers
Alfadhly
It is Illogical to define an inventor by his invention
|
|
|
|
|
I use the following code (which works as well)
COleVariant vSend = sMessage;
m_pMSComm->SetOutput( vSend );
You will have to watch out with the GetInput function though! I noticed there can be a huge memory leak if you use the variants the wrong way. You shouldn't not do it like this:
COleVariant vInput = m_pMSComm->GetInput();
CString sBuffer = vInput.bstrVal;
but like this:
COleVariant vInput.Attach (m_pMSComm->GetInput());
CString sBuffer = vInput.bstrVal;
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Thanks alooooot, i found some good notice in your message.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Do anyone know of any library that can load different file formats like TIFF, JPEG etc. I need that urgent in my appl
|
|
|
|
|
There's a free source code library at http://www.paintlib.de/paintlib/. I've succesfully used it in an MFC/Visual C++ project. Hope this helps.
- Peter H. Helmers
phelmers@rochester.rr.com
|
|
|
|
|
And if you want Targa, we wrote that for paintlib ages ago, but they seem to be slow in version releases nowadays. The mailing list also seems to have died. A shame, because it was very good, it still does a lot of stuff GDI+ does not do natively ( although as I wrote a lot of the filter classes especially ( also not in, if you want 3x3 spatial, gamma, colour, contrast, email me )), although I don't expect it will be too hard to write my own in GDI+.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I am developing a project and is not decided what Database connectivity to use. ODBC or ADO. Can anyone tell me the pros and cons of both..
I am an amatuer and would like help in this.
|
|
|
|
|
Just a couple of thoughts...
DAO is only capabale of connecting directly to a particular set of PC-oriented databases, while ODBC is a complete architecture for connecting to different databases no matter the size.
Ususally, DAO is more efficient at accessing the native file formats it supports that ODBC when accessing the same data through the appropriate driver. ODBC is more efficient than DAO when trying to access a remote server that isn't available through DAO directly.
DAO connects to databases. ODBC connects to data sources. A DAO program would have to be written to be configurable before you could change the database you were working with. Using ODBC, users of your program could reconfigure the data source without any trouble at all.
|
|
|
|
|
Hi artee
ADO would be better if u want ease of use (coding) with the database.
But ODBC would be difficult but with a API layer less so less overhead.
Its upp to you,,but considering the problems i had to face in ODBC i would recommend ADO.
(Am i missing something?)
|
|
|
|
|
Thank you for the reply. As I see till now ODBC connectivity is quite easy as there r only object with Open, Close and Update function etc. But I was seeing ADO and it had some complex coding in it..
Is this true or am I getting something wrong. Please comment..
|
|
|
|
|
Hi,
I'm using LineDDA function, everythin work and its fine,,
but there's a problem,,
i like to veiw all the points that the LineDDA passes to my callback function..
so i wrote the foolwing codes,, but it doesn't work.
void CEdgeView::LineDDAProc(int X, int Y, LPARAM lpData)
{
CDC* pDC = (CDC*) lpData;
ofstream outfile("points.out");
outfile << X << "," << Y <<"\n";
pDC->SetPixel(CPoint(X,Y), RGB(0,0,255));
}
it only prints the center point to the outfile..
anyone knows hwo to fix it,,
the reason is that, i have to get the pixel intensity of every point along that line.
so i need to wrok with those points.
Thanks
Ehsan
Ehsan Behboudi
|
|
|
|
|
Hi Ehsan !
You should make outfile variable either global or a member of View class. Currently the file you want to log recreated any time you call this function.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Hi, I'm trying to complete a little program using the Visual Studio interface, but I still have a problem. I have one View (I used SDI) and one CResizingBar. In my view, I've insert a dialog with an activeX graph. My problem is when I'm dragging the splitter (changing size of my ResizingBar) the view and my bar always repaint. I can't use the double-buffering00 trick because my view and my bar don't have the same size. So... flicker!
I would like to do the same thing in Visual, update only when the drag is finished. I would like to have the same effect of turning off option, in control panel->display->effects-> show window contents while dragging.
Someone can help me please?
Thanks.
Martin Paradis
|
|
|
|
|
You need to paint and erasebackground on condition of a flag, set when you start a drag of the splitter.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I hope this is a simple question for everybody here :
I have given a string, e.g.
"C:\games\hl.exe +connect(ip):27015"
how can I search for the text "(ip)" and replace it with another string?
thanks in advance
|
|
|
|
|
It's very simple.
If you want find the string "(ip)" you must use the Method Find and Replace of the CString Class.
Carlos Antollini.
|
|
|
|