|
Alright, I've managed to get buttons and all that working just fine, but I can't figure out how to get just a bitmap in the toolbar... In the google toolbar, for example, they have that lovely google logo over a button... I'd like that, but without the button. I've even gone so far as to make a button, and make it TB_INDEFINITE (or whatever it is, I'm not looking at my code), but I don't want it greyed out like that. I want it full color, but not clickable at all. I mean, I can have a button, but I don't want it to "click". Any thoughts, anyone?
|
|
|
|
|
Vermithrax wrote:
Any thoughts, anyone?
Custom draw on a separator sounds like your best bet. Alternately, you could float a static control over a separator.
Zno one puts flowers on a flower's grave
|
|
|
|
|
Hi,
I have following questions:
1. How do I create a directory in MFC?
2. When my application exists I want to delete the directory. How to do that?
3. In the directory I want to keep a feh html files. Users can look at the htmls when the application is running. When the applications exists I want to do the following
a) check any of those html files are open...How?
b) close them ...how?
c) delete them...how?
e) delete the parent directory.
Please advise.
|
|
|
|
|
|
|
hey well This can be done very easy. Just u make use of the system(command)
This system function is used to execute the dos commands. So u have to specify like system("md directoryname"); This will execute the dos command so that ur directory would created to delete do the same. to open the file just use _open to read or write the file just use _read or _write. I hope u better refer the msdn where u could be clear man. Just try this i hope this would be helpfull for u.
Bye .....
Shanmuga Sundar.V
|
|
|
|
|
Hi,
I'm writting an app the writes an undo log to disk. 99 times out of 100 this will be fine, but I want to detect when the disk space is running low.
I imagine that XP sends a message, when/before the 'low disk' prompt is displayed to the user, is this true, and can anyone tell me what message I need to catch?
I'd also like a solution that will work on 98SE and 2000, but I don't want to have to be checking disk space regularly. Can anyone suggest a better way?
tia,
hugh
|
|
|
|
|
You will have to Create a Disk Cleanup Handler
search MSDN for "Creating a Disk Cleanup Handler"
or try this URL
here[^]
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Is there any way to fix toolbar to stay no more than 2 rows when you make window smaller just like microsoft word. Right now when you make window smaller tool bar aligned to left size becomes 4 rows.
Thanks in advance
|
|
|
|
|
Look at an example in MSDN!
Hello World!
|
|
|
|
|
i'm trying to communicate with a relay box connected with a serial cable. you send a command of N1 to open the first relay, N2 to open the second, etc... i've tested it with hyperterminal and it works fine. i'm usin a c++ mfc app in vs.net03. i've just added code to my program, if there are any settings that i have to set, then i don't know about them. i'm using the CSerial class
http://www.codeproject.com/system/serial.asp
portName and relay are both CStrings. anyone know what's wrong??
CSerial link;
link.Open(portName); //either COM1 or COM2
//set the port settings
link.Setup(CSerial::EBaudrate(9600), CSerial::EDataBits(,
CSerial::EParity(NOPARITY), CSerial::EStopBits(ONESTOPBIT));
if(relay[0]=='1')
relay.Delete(0,1);
link.Write(relay); //writing "N1" or whatever
//find time for pump to stay open
runtime=drinklist[num].amount[x]*MULTIPLIER;
Sleep(runtime*1000);
relay.Delete(0,1);
relay.Insert(0,"F");
link.Write(relay);
link.Close();
thanx
|
|
|
|
|
From you example:
link.Setup(CSerial::EBaudrate(9600), CSerial::EDataBits(,
CSerial::EParity(NOPARITY), CSerial::EStopBits(ONESTOPBIT));
From http://www.codeproject.com/system/serial.asp:
serial.Setup(CSerial::EBaud9600,CSerial::EData8,CSerial::EParNone,CSerial::EStop1);
Just a thought!
INTP
|
|
|
|
|
those two lines are the same, or so the example says. any other suggestions. i'm really stuck here
|
|
|
|
|
When working on serial communication I have found it usful to run a terminal program on another machine and capture the data output from my program. If it receives garbage, then it is a port setup problem (or bad serial port). If it receive nothing, then either I selected the wrong output port or (heaven forbid) I forgot to make sure the port open successfuly.
I hope this will at least help a little, since I have not used CSerial. I tend to write my own using file I/O (on Win32 platforms).
INTP
|
|
|
|
|
Hi,
Could you please let me know how you can runa terminal program to capture the output from another program?I am in the process of developing a serial communication between a laptop and PDA.I have to send data from the lpatop which has to be read by the PDA.
Thanking you for your time,
Deepa.
John R. Shaw wrote:
When working on serial communication I have found it usful to run a terminal program on another machine and capture the data output from my program. If it receives garbage, then it is a port setup problem (or bad serial port). If it receive nothing, then either I selected the wrong output port or (heaven forbid) I forgot to make sure the port open successfuly.
I hope this will at least help a little, since I have not used CSerial. I tend to write my own using file I/O (on Win32 platforms).
INTP
|
|
|
|
|
I have not used CSerial either.
In order to use a terminal program, such as hyper-terminal (comes with all PC versions of windows), you will need to make null-modem cable or you may buy one at a computer supply store like radio shack. The wiring for a null-modem cable can be found on the net or in a book on serial communications. If you are doing your serial communication using a USB port, you may also need a USB to 9-pin serial cable or 2. When you setup the teminal side, you need to make sure that it is not doing something funky with that data (like replacing CR with CR/LF). The data must be saved without modification (received as binary not text). Once you have set the serial-port properties, then all you need to do is select receive file. The terminal program will sit there and wait until data starts arriving at the port, at which time it will start coping the data to the given file (for later analisys).
Well, I hope this helps you!
Good Luck!
INTP
|
|
|
|
|
if I have open handle of the registry key and want to get the full path against this key, Is there any way for getting this path.
|
|
|
|
|
Hi,
Look for the following APIs on MSDN
RegOpenKeyEx
RegQueryValueEx
Pankaj
Without struggle, there is no progress
|
|
|
|
|
I think I am unable to deliver my point
look at this example
if i get the handle to the key like this
HKEY hSubKey;
hRootKey=HKEY_CURRENT_USER;
CString csSubKeyName(AppEvents\\EventLabels);
RegOpenKeyEx(hRootKey,csSubKeyName.operator LPCTSTR(),0,KEY_ALL_ACCESS,&hSubKey);
Now I have the handle of Sub key in hSubKey, what I want to do now is to find full keyPath against this handle which is
HKEY_CURRENT_USER\AppEvents\EventLabels
but I dont how to get this full path
|
|
|
|
|
still waiting for any comments
|
|
|
|
|
Hi,
I want to link my code with a static library mysqlclient.lib. How d I do this?
Karteek
|
|
|
|
|
Project->Settings->Link
Object/Library Module
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
or just write in your code
#pragma comment(lib,"yourlib");
which does very much the same
|
|
|
|
|
I Use CListCtrl and do exactly these steps:
Make some columns, then add some elements into the controll, then delete them and delete all the column. Then i repeat the same action some time. And i lose some memory on this operation.
Does anybody know what problem do I have with memory leak???
Please Help...
There are some expressions frome my code:
It is a function
void CChanelsSchedul::OnChanelChanged()
{
if(m_ADODatabase.IsOpen())
{
CMainFrame* mainframe = reinterpret_cast<cmainframe*>(AfxGetMainWnd());
CChanels* chanels = reinterpret_cast<cchanels*>(mainframe->m_wndSplitter.GetPane(0,0));
CListCtrl* lcontroll = &(chanels->GetListCtrl());
POSITION pos = lcontroll->GetFirstSelectedItemPosition();
int ID = chanels->ID[lcontroll->GetNextSelectedItem(pos)];
CADOParameter Chanel_ID(CADORecordset::typeInteger,sizeof(int));
Chanel_ID.SetValue(ID);
m_ChanelsSchedulList.DeleteAllItems();
int itemCount = m_ChanelsSchedulList.GetHeaderCtrl()->GetItemCount();
for(int i = 0;i
|
|
|
|
|
Please use <pre> before code and </pre> after code, to preserve code format.
If you break out some of the code and place it in helper functions, you should find it much easier to solve the problem.
If you are not using one of the memory checker programs, then I recommend you download a trial copy of BoundsChecker or MemoryCheck (ect...).
INTP
|
|
|
|