|
Thanks! How could I've missed that one?
/ mike
|
|
|
|
|
Hi All,
Is there any way to change the background color of a TextBox and the text Color?
Thanks in Advance.
Sangeetha
|
|
|
|
|
|
You can also check http://www.codeproject.com/editctrl/enhfocusedit.asp. Not meant to be a self-plug, but I really do not see the need for (1) a potential dynamic memory allocation whenever a paint cycle happens, or (2) the need to draw the text yourself...
You can just handle the correct messages, and let Windows do all of the work for you. Functions of interest in the code are CFocusEditCtrl::CtlColor(...) and CFocusEditCtrl::OnEraseBkgnd(...). The code also handles Disabled and Read-Only edit controls.
-=- James.
|
|
|
|
|
Season greetings to all .
In my MFC-app I have a logon-dialog that presents the user with a list-box to select between (hardcoded) odbc-connections.
My question is: Is there a way to list the defined obdc-connections in this list-box instead of whichever is hard-coded?
HarryS - Norway
|
|
|
|
|
use SQLDataSources and SQLDrivers to enumerate data sources and odbc drivers via code
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
How would I get the list of offline and online users into list boxes in my program if I wanted to make an MSN messanger client with more features than what MSN has at the moment?
Are there any resources people can tell me about using the MSN commands like Block Sender, etc etc??
Thanks
Ashman
www.settlers.net
|
|
|
|
|
does anybody know where i can download the MFC help file. In .hlp or html format.
|
|
|
|
|
When you BUY visual studio, it comes with it.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
How do I tell at runtime if am in an sdi/mdi or dlg app?
i.e are there some #defines I can use.
If so - what are they?
-cheb
|
|
|
|
|
I wonder why you thought it was an easy question
Anyway first do this
AfxGetMainWnd
to get a pointer to the main window
now call this function on the CWnd* returned
GetRuntimeClass
you'll get the class name using the m_lpszClassName member
now use IsDerivedFrom and pass the CRuntimeClass* for CDialog, CFrameWnd and CMDIFrameWnd till one of them matches
got it?
Nish
p.s. I haven't tried it out yet, so there might be somethin I missed...
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Sounds good.
I thought it would be easy as I assumed that there would be #defines buried in MFC some where for sure.
I just did not know where.
Anyway, thanks this is a good robust solution.
-cheb
|
|
|
|
|
I don't know if there are any #defines, but you might try:
AfxGetMainWnd()->IsKindOf( RUNTIME_CLASS(CDialog) );
AfxGetMainWnd()->IsKindOf( RUNTIME_CLASS(CFrameWnd) );
AfxGetMainWnd()->IsKindOf( RUNTIME_CLASS(CMDIFrameWnd) );
I haven't, though, given this a try, so I can't guarantee it will work.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hello!!
I am building a TAPI application in which there is one server and many clients.i.e. N client machines would be connecting and communicating with 1 server machine. Once the connection is established, server would be accepting the data sent by the clients and then the same data would be again sent back to the same client who sent it to the server, through modem. The application should have the capability to do data transmission and receive simulnateously with n-clients.
The application is supposed to run on Win 98,WinNT, WIN 2000 and Win XP. I am using C programming and TAPI 2.0. I do not want to use COM/DCOM. Can you please tell me if it is possible to build an application of n-clients and 1 server using language C, TAPI 2.0 and without COM/DCOM.
I already have built an application for data communication between single client and single server.
Data transmission is done through the COM port to which the modem is connected.
Can anyone please help and advise as to how I could go on to build a n-client 1 server TAPI application.
Any help would be higly appreciated.
Thanks
Sandeep
|
|
|
|
|
Hi,
Sorry, i don't have an answer for ur problem. Actually i wanted ur help. i'm trying to create an application with TAPI to send data between a single client and a single server. Can u guide me through that. I'm new to this TAPI programming , so can u pls list me the various TAPI functions which can be used.
Pls help.
vini
|
|
|
|
|
I am trying to do this:
...
CString strMsg;
...
char *pBuffer = new char[nLen+1];
...
strcpy(pBuffer,(const char*)strMsg);
...
I get error C2440: 'type cast' : cannot conver from 'class CString' to 'const char *'.....
How do I get this to work?
Thanks
-Matt Newman
-Politically Correct Sensoring Service
-We make sure you don't f*** up in public
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
If you're using UNICODE, then why not use a TCHAR instead of a char?
CString strMsg = _T("Test me");
TCHAR *pBuffer = new TCHAR[100];
_tcscpy(pBuffer, (LPCTSTR) strMsg);
cout << pBuffer << endl;
HTH,
Jon Sagara
"There are lies, damned lies and statistics."
-- Mark Twain.
|
|
|
|
|
This Worked. Thanks for the help.
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
try using wcscpy [the wide version of strcpy]
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I assume you're doing this in a Unicode build? CString holds TCHARs, so in your case it's got WCHARs (wide characters, a.k.a. Unicode chars), and CString has no facility for converting between character sets.
Use one of ATL's conversion macros:
USES_CONVERSION;
strcpy ( pBuffer, T2CA((LPCTSTR) strMsg) ); T2CA() converts from a TCHAR string (Unicode string in Unicode builds) to a const ANSI string.
--Mike--
My really out-of-date homepage
"Not our fault we are intellectually superior to the rest of the office." -- Paul Watson in the Lounge, 12/12/2001
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Hey, I was looking at all the sample programs on this site and even downloaded a few. When I try looking at them in my C++ program all the folders appear on the right hand side of the screen with nothing on the left side. There is no DSW or DSP files in these samples. Is there anything that I can do to try these programs?
|
|
|
|
|
If the zip contains only cpp and h files you prolly downloaded some CPP class source. Just add the cpp and h files to your existing project. The article would explain how to use the class.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Thanks a lot, I appreciate it!
|
|
|
|
|
OK code snippet:
void CPro1WinTUSDlg::OnMainButton()
{
if(OnSearchforRadio()){
CSearchingDlg SearchingDlg;
SearchingDlg.DoModal();
}
else{ //if(OnEnterdataRadio()){
CSureToEnterDlg SureToEnterDlg;
SureToEnterDlg.DoModal();
}
}
I want my button to invoke dialog 1 if radio 1 is selected and dialog 2 if radio 2 is selected. I changed the OnEnterdataRadio() and OnSearchforRadio() functions from type to void to BOOL. Everything compiles but when the button is pressed, regardless of which radio is selected the button is invoking the Seaching dialog.
I'm a newbie at all of this, so please be gentle with the flames.
Digital Khaos
"Every problem has a solution" -unknown
|
|
|
|
|
Digital Khaos wrote:
I'm a newbie at all of this, so please be gentle with the flames.
Really ?
Anyhow, I can't see what you're saying here - you've not shown us the functions that matter, OnSearchForRadio and OnEnterDataRadio, but I presume they are functions added through the Resource Editor and relate to radio buttons ? If so, you need to create an integer variable for the first radio button in your group, it will be a 0 indexed number that indicates which button is checked. You'll need to call UpdateData() first.
My advice may be totally wrong based on the absence of enough info, so if it doesn't seem right, just post the rest of the code and I'll try again....
BTW BOOL is a typedef'd int, created for C programmers ( C does not have type bool ). Use bool if that's what you want, or int if you want an int.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|