|
in the OnButton() function.....just add the command......
UpdateData(TRUE);
this command will update all the vaues(m_check1,m_check2.....etc) of the checkboxes made by the user on Dialogbox.....
after this u can use the
if( m_check1==TRUE)//OR SOMETHING LIKE THAT
hope that helpz....
cheerz.....
|
|
|
|
|
if(m_check1.GetCheck()==1){
//active when m_check1 is check
}
else if(m_check1.GetCheck()==0){
//active when m_check1 is uncheck
}
|
|
|
|
|
Buddy,There are two way to detect that.
firs--t Create a Event handller for each CheckBox
or
Group all the Check Boxes and Give a First Checkbox(determine it with tab order)a integer ,and this integer value determine which check box is selected (0 - first,1 for second and so on).
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hi all,
I want to get Driver Names of the harddisk .Can u tell me how to do that using C++?
Thanks in advance.
|
|
|
|
|
pubududilena wrote:
Driver Names of the harddisk
Whats That,WHta do u want Drives names of hardisk or something else
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hi,
..Sorry for my mistake..I want to get names of Drives of the Hard Disk.
Suppose that my computer has 3 Drives namelly Drive C:,Drive D:,Drive E:
So I want to get no of Drives in the Hard and names of Drives..
thanks in advance
|
|
|
|
|
|
Hi
I tried to do it for getting name of the current driver that the program is running and to show how much free_space in Bytes left
Check this code I think it will help you ..(_getdrive)
You can delete what ever you don't need
/*---------Function Current_Disk_Freespace---------------*/
/*The Function print the free space of the current disk */
/*Input- none. */
/*Output-Don't return a value
/* just print the Value in Mega-Bytes */
/*need to be included*/
#include <windows.h>
#include <direct.h>
#include <stdio.h>
#include <tchar.h>
#include <iostream>
using std::cout;
#include<iomanip>
using std::setprecision;
/**********************/
void free_space_message()
{
struct _diskfree_t df = {0};
unsigned uErr,uDrive,current_drive;
double result=0;
char Letter=0;
for (uDrive=1; uDrive<=26; ++uDrive)
{
current_drive = _getdrive();
//check for the current disk that is working
if (current_drive==uDrive)
{
uErr = _getdiskfree(uDrive, &df);
Letter = uDrive + 'A' - 1;
//Calculate the value to Mega-Bytes
result=double(df.avail_clusters)/(1024*1024)*double(df.sectors_per_cluster*df.bytes_per_sector);
printf("%c:",Letter);
cout.precision(0);
cout<
|
|
|
|
|
Hi,guys:
I got a serious error when developing a DLL for my teammates' DELPHI application. Any help is appreciated.
Environment: Windows2000 AS, VC++6.0SP5.
Related code:
typedef struct _tag_MyPackage
{
int len;
char *data;
}MyPackage;
When I got some data,
MyPackage *mp = new MyPackage;
mp->data = new char[length of the data]
memcpy(mp->data, ...);
EnterCriticalSection(&m_cs);
mylist.pushback(mp);
LeaveCriticalSection(&m_cs);
When something happens, below code is executed in another thread,
EnterCriticalSection(&m_cs);
iterator = mylist.begin();
MyPackage *mp = *iterator;
memcpy(A_Pointer_Defined_Before, mp->data, mp->len);
if (mp != NULL && mp->data != NULL)
{
delete [](mp->data);
delete mp;
}
mylist.erase(iterator);
LeaveCriticalSection(&m_cs);
return;
My program runs prefectly in much time, but, in some condition it fails at this line.
delete [](mp->data);
The error message:
Program:\work\myapp\test.exe
File: dbgheap.c
Line:1044
Expression: _CrtIsValidHeapPointer(pUserData)
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
And I also found it fails only when the length of data is a bit long, say, 220000bytes. Some other short length such as 100bytes/1000bytes/50000bytes are all successfully performed.
Thanks for your patience and any replies.
|
|
|
|
|
how to hide my computer in LAN, another user can't browse.
thanks
Nho'c Ti`
|
|
|
|
|
don7cry wrote:
how to hide my computer in LAN, another user can't browse.
Disable File & Printer Sharing.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
if do that with your idea,use could browsing my computer with empty folder
I want nobody can't show my comp in browse of Explorer
Nho'c Ti`
|
|
|
|
|
Unplug your network cable
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
First of all Password protect you PC then disable any folder you are sharing on network and disable remote access to you computer in My Computer>Properties.Enable Windows firewall.Use some other firewall.
|
|
|
|
|
forgot one thing
Look in administrative tools and from there Security policy something like that i dont remember exactly and remove all users except you,System,Administrators from the list of those who can access your system.And dont remove yourself otherwise you will not be able to access your drive.
|
|
|
|
|
I want to do something when the audio device is recoding.
How to detect the beginning and end of recoding?
Does Windows post a notification message or event?
Jesa
|
|
|
|
|
|
The WIM_OPEN and WIM_CLOSE message will not broadcast to all application.
I want to know that other application is using audio device to record.
But WIM_OPEN and WIN_CLOSE message seem to be use for CALLBACK function, doesn't it?
Will Windows post a message to notify all applications when audio device is recording?
Jesa
|
|
|
|
|
how to change the icon of C++ exe files
|
|
|
|
|
the same way you do for any other exe icon.
It doesnt matter what language its written in.
bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
that calculate large integers (till 100 digits)
with tohse operations only: + , - , *
with simple code !!!
without libraries except for:
stdio.h
stdlib.h
malloc.h
|
|
|
|
|
Blast, I cann't find it! Do a search on the Norton series of books. Years ago I found a book that showed how to do this precisly (so we all could understand it). I use it to write my own C code (much more flexable) for creating caculators and graphing programs.
There is an article at CP that will help you, just do a search.
As for 100s of digits, well that is a whole nother subject!
INTP
|
|
|
|
|
Does anyone know of a good place that has a tutorial or complete "working" programs that use C++ Serial I/O Comm routines? I have found some stuff, but all have many errors which doesn't help me since I dont know much of it to begin with. I am using MSoft's Visual Studio.NET just to let you know in case some code isnt directly compatible with it.
Thanks
P.S. I found a C++ Serial Comm Library from "WSC" but all it had was a .lib file (obviously a library) and a header file. Now I never worked with libraries before in c++ so I didnt know how to use it. What I did was include both in my original source file and it came with so many errors I didnt even try to fix them because as I said I dont know enough about how to use serial comm in c++.
P.P.S. I do know How serial comm works in general just not how to incorporate it into a c++ program.
|
|
|
|
|
CNewbie wrote:
Now I never worked with libraries before in c++
How did you write any programs then?
In the old days that was normal, but DOS is almost dead and very few peaple try to access the hardware directly any more.
The MSDN has "Serial Communications Functions" listed, I do not know if that helps!
There is an article at CP some where, I do not beleave it is the one you found (but is sounds like it).
Google "CreateFile Serial Comm", it gave some good hits.
Sorry I was of no more help, this use to be easy until modern Windows came along (security and all that). Now it appears so complicated that I have to look it up (each time) before tying it.
INTP
|
|
|
|
|
For my current application (MFC C++ dialog)I was generating my own database, just a large array of type Struct (name, address, cost, code etc - CStringArray, CStrings, ints and doubles ) and initialing it at startup via a Tab delimited file. The program will then add more records as required.
The reason for moving to mySQL is one of speed and its free.
I was just using the CStringArray class to store the names of items and do all the searching; e.g. string searches and the array was getting quite large and I was getting worried about speed as the database grows.
I have just unstalled mySQL 4.1 onto my PC (runs a dos window - that's as far as I have got), and I have just started reading the syntax & commands for SQL. Does anyone know of any good introductions/tutorials, i.e. sample projects using mySQL with an MFC C++ Visual Studio .Net 2002 program. Also I would like to populate the mySQL database with this Tab delimited file is that possible?
So any information/tutorials most welcome.
A sample project using mySQL would be great, as from web searches they seem to be problems with different versions of Visual Studio.
|
|
|
|