|
You should post this question in the Managed C++ forum.
|
|
|
|
|
As Cedric said, there is a managed C++ forum - and you should be using it.
But in C/C++, this would work:
class CTwo;
class COne
{
...
CTwo *m_pTwo;
CTwm m_Two;
};
class Two
{
...
COne *m_pOne;
COne m_One;
};
I hope that helps,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
|
1/ It's a codeguru article - did you get any luck on codeguru's forums?
2/ I've had good success with a codeproject article:
http://www.codeproject.com/KB/miscctrl/colour_picker.aspx[^]
3/ I've written my own combobox like control, where you can put anything you like in the little boxes...
http://www.codeproject.com/KB/miscctrl/generic_picker.aspx[^]
4/ If you look at the code on the original codeguru article, you'll see it handles WM_DRAWITEM, and there will be a couple of lines where it draws the coloured box - just replace that with your own code.
5/ Didn't I already point you at our combobox section? We have several other owner draw combo boxes that you can learn from.
6/ Good luck!
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
hey guys my project is about how to limit the download and the upload from the internet, and it will be run on a server connected on many pcs, so the server will organize the limit of each pc, and manage the download and upload, and if one exceed it limit it sends a warrning message.
But i face a problem during implementation in c++, first i used the buffer to control the limit, but i don t know how i can know if any pc use the internet browser to download or upload and how i can get the data from the internet browser and transfer it to bytes and store it in the buffer:
this is my code:
setlimit(int limit, int nbofpc)
{
Float limitbypc;
Limitbypc = limit/nbofpc;
For(int i=0; i<nbofpc;i++)>
Char buffer limitbypc;
Return 0;
}
if(download)
{
void downloadlimit( )
{ AnsiString IP;
For(int i=0; i<nbofpc;>Switch (IP)
{Case ‘10.15.1.157’: bufferlimitbypc = fputs(data);
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t download more"); break;
Case ’10.15.1.158’: bufferlimitbypc = fputs(data); break;
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t download more"); break;
……………
Case’10.15.1.164’: ……….; break;
}
}
Return 0;}}
if(upload)
{
void uploadlimit( )
{ AnsiString IP;
For(int i=0; i<nbofpc;>Switch (IP)
{Case ‘10.15.1.157’: bufferlimitbypc = fputs(data);
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t upload more"); break;
Case ’10.15.1.158’: bufferlimitbypc = fputs(data); break;
If(sizeof(data)) == sizeof(buffer)
WriteString ("you can’t upload more"); break;
……………
Case’10.15.1.164’: ……….; break;
}
}
Return 0;}}
thanks
joseph
|
|
|
|
|
So you have a plan and have made some assumptions. The assumptions are without form and the Plan is completely without substance. The darkness is upon those that read your post. Verily we say unto you:
"It is a crock of sh*t, and it stinketh".
"It is a pail of dung and none may abide by the odor thereof."
|
|
|
|
|
Haven't you already asked this same question twice already? Could it be that no one has an answer/solution? Could it be that not everyone has had a chance to see it (CP is accessed by folks all over the globe)? What language is it in? While it will unlikely make any difference as to whether you receive a response or not, you might consider formatting the code snippet so that it is more pleasing to the eyes. Folks help out for free here in their own time. Not having to spend time deciphering code is considered a plus.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
while without a third-party software
|
|
|
|
|
I think it's not supported.
You can right click on #include statement and opt for "Open Document" menu
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Hello Followait,
This macro[^] does what you need. But its tested only in VC6. Try it in vc2008. Good Luck!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
|
Hi,
Is there any way to get informed about the files or folder that is being deleted.
Is window send any message when file is deleted?
|
|
|
|
|
|
Hello MPTP,
one option is to use ReadDirectoryChangesW() . For sample, check this link[^].
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I want to track if and only if Directory or file is deleted...
Is there any way?
|
|
|
|
|
Hi All
I got example of get file size from MSDN.But i have a problem to write out put in file.How to convert struct values to CString or any other solution.
Example code is here
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
int main( void )
{
struct _stat buf;
int result;
char timebuf[26];
char* filename = "crt_stat.c";
errno_t err;
result = _stat( filename, &buf );
if( result != 0 )
{
perror( "Problem getting information" );
switch (errno)
{
case ENOENT:
printf("File %s not found.\n", filename);
break;
case EINVAL:
printf("Invalid parameter to _stat.\n");
break;
default:
printf("Unexpected error in _stat.\n");
}
}
else
{
printf( "File size : %ld\n", buf.st_size );
printf( "Drive : %c:\n", buf.st_dev + 'A' );
err = ctime_s(timebuf, 26, &buf.st_mtime);
if (err)
{
printf("Invalid arguments to ctime_s.");
exit(1);
}
printf( "Time modified : %s", timebuf );
}
}
How can i write it's values buf.st_size in file.
Plz help me
|
|
|
|
|
I'm not quite sure what you're after, but in pure C stuff, you can write values to a file like so:
FILE *f;
...
f = fopen ("c:\\myfile.abc", "w");
...
fprintf (f, "Some Integer: %i\n", nMyInt);
...
fclose (f);
I hope that puts you on the right path,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Something like this:
CString csOut;
csOut.Format("File size : %ld\n", buf.st_size);
Then use CStdioFile::WriteString() to write to a file.
|
|
|
|
|
|
ahm, can you help me to do my project. i need some codes using c++ program for our project. can i?
|
|
|
|
|
merry jermamae arcilla wrote: ahm, can you help me to do my project.
Who's "ahm"?
merry jermamae arcilla wrote: i need some codes
Sorry, no codez here.
merry jermamae arcilla wrote: can i?
Don't know.
|
|
|
|
|
merry jermamae arcilla wrote: i need some codes using c++ program for our project.
This is all I could gather on such short notice:
void main( void )
{
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
You didn't have to be so elaborate. Too much information
|
|
|
|
|
Tempting as it is to make a joke reply, it's already been done.
As a serious reply:
Have a look at the forum posting guidelines, it will help you get answers next time you post.
Next, what does your project do? If you're doing a programming course, you should make sure you use the skills you've been taught. If someone here gives you lots of help, your tutor will be very suspicious of the high quality complex code you hand in. I'd mark you down for cheating if I was him / her.
When you have something specific you're struggling with, feel free to come back and post. We try not to answer homework questions directly, but I do try and give people hints to the right direction. If we just gave you all the answers, you wouldn't learn anything, so this course would be a waste of your time, and a waste of any employer giving you a job when you didn't learn the material.
I'm going to assume you're better than that, and wish you success on your project and course.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Well said. I just hope that the OP is going to read (and understand) your reply.
|
|
|
|