|
... toMatrix(int row,int colum,CString matrix)
{
Cstring m[row][colum];//Why this line erroe?????
return ...;//
}
I need return m to other function,plase tell the way.
thank you.
|
|
|
|
|
you need to have a fixed size at compile time.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Try something like this...
// ***************************************
// Example: Dynamic Multidimensional Array
// ***************************************
// We want both array dimensions to be allocated dynamically and
// to be able to reference an element as x[i][j]
// Here's how to do it...
// ***********
// MFC Version
// ***********
// Array of ints
typedef CArray <int, int=""> CIntArray;
// Array of arrays of ints
typedef CArray <cintarray, cintarray&=""> CMultiIntArray;
void TraceDynamicArray(const unsigned int rows, const unsigned int columns)
{
CMultiIntArray aTest;
// Allocate number of rows
aTest.SetSize( rows );
// For each row
for (int row = 0; row < aTest.GetSize(); row++)
{
// Allocate number of columns
aTest[row].SetSize( columns );
// For each column
for (int column = 0; column < aTest[row].GetSize(); column++)
{
// Assign a value
aTest [row] [column] = 10 * row + column;
// Trace it
afxDump << aTest [row] [column] << "\t";
}
afxDump << "\n";
}
}
In your case you need to have
// Array of CString
typedef CArray <cstring, cstring=""> CStringArray;
// Array of arrays of CString
typedef CArray <cstringarray, cstringarray&=""> CMultiStringArray;
Kevin
|
|
|
|
|
Hello!
How can I retrieve the 'size on disk' of file (not the 'size' which is returned by the GetFileSize function)?
Thanks!
|
|
|
|
|
You'll first need to obtain the size of the disk's allocation unit. Divide the file's size by the allocation unit. Round the quotient up to the next whole number. Multiple that by the allocation unit. For example, if the size of the file is 124,356 bytes and the allocation unit is 2048 bytes:
124,356 / 2048 = 60.720703125 = 61 * 2048 = 124,928
This yields slack space of 572 bytes.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How can I obtain disk's allocation unit in C++?
ARSALAN MALIK
|
|
|
|
|
GetDiskFreeSpace(strPath, &dwSectorsPerCluster, &dwBytesPerSector, &dwFreeClusters, &dwTotalClusters);
DWORD dwClusterSize = dwSectorsPerCluster * dwBytesPerSector; This will not work on volume sizes that are greater than 2GB. For that, I would use ZwQueryInformationFile(..., FileStandardInformation) .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
how can i countact to the server from program and copy the data from the server to the program
if any one can help me of this and send me the receurce
i will be thankfull for him/her
Best regards,
|
|
|
|
|
What server?, which technology?, what type of data?
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
I am working on a function that displays all related names when the user entering name. For now, I only can search the exact entried name! However, since the users always typing very fast and more often enter name with incorrectly (ie: Joh instead of John, Cater instead of Carter ...)
Is there any existed codes to correct for them?
Thanks for any help
|
|
|
|
|
A very easy and simple method that I have used is to use the Soundex algorithm to match words that may be spelt incorrectly, but is phonetically similar.
Have a search for this in Google and you will get a few good sites. Even SQL Server's T-SQL have a Soundex function!
I Dream of Absolute Zero
|
|
|
|
|
Hello All Programmer,
I am facing a little problem,hope i found Solution here.
i have make Bold a particular Item in TreeCtrl. how to accomplish that.
Thanks
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
go via the tree item not the text itself:
use TVIS_BOLD and set the tree item to this attribute
(I can't remember how though but you can look it up.)
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
First of all use GetSelectedItem() which will return u the selected item and then create the TVITEM struct specifying the mask value as TVIF_TEXT, and hItem as the selected item and state as TVIS_BOLD.
This will bold selected item's text even at the runtime.
Work Hard and Bit of Luck is Key to Success
|
|
|
|
|
Thanks a Lot every body
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello All,
I have an application in vc++, where on a ("Synchronize")button click, some functions are executed. Now i have to(Schedule)set a particular time on a given day(weekly once) at which the same functions should get execute, which are executed when i click the button("Synchronize").
Please send me the code if possible.
Regards,
Prax.
|
|
|
|
|
Use a timer (see the "OnTimer" event) and use CTime::GetCurrentTime.
Elaine
The tigress is here
|
|
|
|
|
It sounds like you are wanting to create a scheduled task. If so, check out the ITaskScheduler and related interfaces.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
I have created a compiled help file outside our app. Now I would like to call this chm file by the press of a button (test project) or via a menu.
How can you do this?
Do you need to include this in your project or can you specify the path? (I prefer option 2).
tnx 4 your help!
|
|
|
|
|
You can always specify the file path if you want to.
See the documentation for HtmlHelp function.
This topic in MSDN will get you started - "HTML Help Tools and Features"
|
|
|
|
|
Hello Friends,
I am using CListView in which I am displaying some images, but whenever I am resizing it, then It is displaying the Horizontal Scroll bar which Should not be displayed.
I had tried ShowScrollBar(SB_FALSE) in the OnSize() member function also. but it is displaying.
I don't want this horizontal scroll bar to be present.
Please Help me.
Thank you in advance.
Neelesh J Jain.
|
|
|
|
|
|
I want to display multiline text in a CStatic text control. How can I do this? /n does not work!
|
|
|
|
|
Try \n
|
|
|
|
|
Sorry. I meant \n. I tried \n and \r and they did not work.
I am trying to display some text on the screen and need to show it in a window that sizes itself to the text but I will need to limit the width to the screen width so I may need newlines in the text.
|
|
|
|