|
Thats is possible but it is more error prone because the function cannot know if array was fixed size or dynamically allocated. So if someones passes a dynamically allocated array then size array using this method will always be 1. So you have to be very careful that about calling such function.
-Saurabh
|
|
|
|
|
I'm confused. At the time of passing the array, array size(number of elements) are fixed. I'm not going to use like in a looping function to pass. In such a case as you said I'm in a big trouble.
Whats your comments.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Okay I might be wrong but I think when you said you don't want to pass size of array as an argument, this is what you want to do.
void foo(int* array)
{
int x = sizeof(array)/sizeof(array[0]);
//
// Process array here.
//
}
So I was wrong in other post and the problem is that x will always be 1.
-Saurabh
|
|
|
|
|
If you created the array yourself, you now its size. So I don't really understand the point. Could explain why you want to calculate the size instead of just using the same number you put in your array (if you defined it as a constant for example) ?
On a side note, you might want to look at existing container classes like std::list or std::vector.
|
|
|
|
|
Just fine, as you said I feel that vectors are specially useful than arrays. I just try to find it.
Came to my mind this is, in Java(I've much familiar than C++) using a single line I can get this.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Recent Platform SDKs have a _countof macro that you can use instead of defining your own.
|
|
|
|
|
Hi all.
Need some help. I'm not long in MFC.
How to get size of dialog in template?
I'm deriving from CFormView and I need to know what is the size of dialog in template.
I can do this before or after window creation, but I don't know how in both times.
Thanks
|
|
|
|
|
progDes wrote: I need to know what is the size of dialog in template.
You can use CDialogTemplate member functions GetSizeInDialogUnits and GetSizeInPixels .
Here is a note from MS on this class' parent file (afxpriv.h)...
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
|
Hi all,
i m working on VC++ 2005, MFC-SDI type application. I m using .chm file as a help file.
when i click on Menu of application then help file is opened.
In help file 3 more category present like Contents,Index,Search,Favorite and more.
I want all these categories are shown in Menu bar and when i click on puricular menu item then help file should be opened according it.
For example: When i click on Contents menu item then help file should be opened on content tab of help file, same for other.
Please tell me how can i do this.
I m waiting for ur valuable suggestions.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I've been working on MPI system where the compiler does not support vasprintf. Is there anyway i can get around this problem? Is there anyway that I can replace vasprintf with vsprintf or sprintf? Thanks
|
|
|
|
|
hi, i want to access all the notification items in the notification area(system tray)... i was searching in msdn and i couldn't find any...
what is the interface or functions to access the notification area... it is to see all the running programs there... and to hide some icons if needed... i am using win32 api's... and not mfc... .
|
|
|
|
|
Jach Mullan wrote: i want to access all the notification items in the notification area(system tray)... i was searching in msdn and i couldn't find any...
what is the interface or functions to access the notification area... it is to see all the running programs there... and to hide some icons if needed... i am using win32 api's... and not mfc... .
An article by Nishant on this topic -> http://www.codeproject.com/KB/applications/ShellTrayInfo.aspx[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
in winxp, the directory name length limit is 244
in win98, the directory name length limit is 250
why isn't 255? why file name length limit is 255?
in FAT32 file system, FAT directory structure's DIR_Name cannot use 0x22, 0x2a, 0x2b,0x2c,0x2e,0x2f,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x5b,0x5c,0x5d,0x7c,
FAT Long directory Entries 's LDIR_Ord cannot use also???
How many long file name or long directory name can use FAT Long directory Entries structureS?
sorry my bad english.
Thanks.
|
|
|
|
|
can someone please show me what i need to add to my program to get visual styles to work in vista and using vs2008.
|
|
|
|
|
|
Hi..
Please have a look on Manifest concept...
All d best...
Jagdish Bhimbha
S/W Developer
|
|
|
|
|
i have tryed adding a manifest but in vs2008 something isnt the same because nothing happens.
|
|
|
|
|
Hi,I finished Audio Capture and Receive with directsound.There is a netmeeting, I use a thread to receive a client data and decompress separately .
Now I use G729a.lib(got it from codeproject) to decompress,but It can not decompress multiply channels at the same time.
Could you send me Audio Compress code and instruction?
Thanks a lot.
|
|
|
|
|
|
In my program I selected Context Help and MFC gladly included the help mecahnism, but I have found it easily to created my HTML Help Files using HTML Help Workshop; which I have done. But I can't fiquire out how to get my program to forget the Wizzard's Help file and accept mine instead. I've seached MSDN and they just tell you how to create it in HTML Workshop, and if you have VS 6.0 They show how to include it in your program. But nothing on VS2008. Anybody know How?
Help!
A C++ programming language novice, but striving to learn
|
|
|
|
|
I need to be able to copy a User's Electronic Serial Number of the CPU he is installing a program on. Does anyone know how to do this?
I'm programming in MFC VS2008.
Thanks for your help.
A C++ programming language novice, but striving to learn
|
|
|
|
|
What if the user disabled that feature in the BIOS?
|
|
|
|
|
I'm tring to prevent multiple system installations.
A C++ programming language novice, but striving to learn
|
|
|
|
|
Larry Mills Sr wrote: I'm tring to prevent multiple system installations.
Could you elaborate? Do you want to prevent multiple copies of the software on the same machine?
|
|
|
|