|
thanks danny,
I am using CEdit btw,
that will insert the text ok,but the text is always placed at the start of the sting, what i need is to place that text
where the cursor is positioned
hope that make sense
si
|
|
|
|
|
You need GetSel() to get the selection. Here's an example:
int startChar, endChar;
m_var.GetSel(&startChar, &endChar);
CString temp;
m_var.GetWindowText(temp);
temp.Insert(startChar, "Text to be inserted");
m_var.SetWindowText(temp);
} This will insert the text at the zero-based index indicated by startChar. Remember, the first argument to Insert() is where the text will be inserted.
Hope this helps!
Danny
The stupidity of others amazes me!
|
|
|
|
|
si_69 wrote:
it will update a name into the text box, where the current cursor position is
You'll need to use CEdit::ReplaceSel() for this.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
We've got an application i'm working on that utilizes COM Variants and Excel (values are read in from a text file and output into Excel).
Everything is hunky dory when the user is under US International Settings. However, when our European friends try out the product, there are some strange results - one of which i'm curious about here.
The process works like this: we read in some data, send it to Excel, read it back out (probably not the most efficient, but it handles some interpretation of the data we need rather effectively and my boss keeps me on a tight budget, so i just stick to what is quickest to do), format the data according to user specifications, and save it back into the Excel file.
The problem is what Excel says about international data when it is read back out - in particular, international numbers.
To demonstrate, here is what happens in the US:
Value: 1,000.00 -> Read in as a number in the VARIANT object -> Output to Excel correctly.
In Germany:
Value: 1.000,00 (notice the number formatting change) -> Read in as a BSTR(!) in the VARIANT object -> Output to Excel as text instead of a number.
i've monkied around setting my Regional settings to Germany, etc., but no luck. Any advice on this one? COM seems to want to stay whitebread American, and i'm having trouble broadening its horizons.
Thanks!
-- modified at 10:34 Tuesday 4th October, 2005
|
|
|
|
|
Please could someone help with the following:
I have a PC with 2 processors. I am writing two application in VC++.
I want one application to use CPU 1 and the other to use CPU 2.
How can I do this in code?
Please could someone post some sample code or point me in the right direction.
Really appreciate it.
Regards
Rich
|
|
|
|
|
I have no idea how to do this, but can only imagine that it would not be a good idea. In any case, the word you are looking for is affinity.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Cheers for the help.
Thanks
Rich
|
|
|
|
|
Hello,
I don't think that there is a way to say that your code should execute on a certain processor. The OS will arrange that (and I'm glad that it does )
On VS2005 you can hint the compiler that certain parts of your code can execute on different CPU's simultaiously. Look here[^] for more information about OMP.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Specifically, see SetProcessAffinityMask
|
|
|
|
|
Hi
Can anybody help me.how to convert image data that is in unsigned char * to COleVariant type. i want VARIANT data type which holds unsigned char* data. i am using ADO in vc++ to store images in to Oracle database.
or any solution for storing images into Oracle database using ADO in vc++.
Thanks
|
|
|
|
|
|
//I am working in VC 6. i have certificate file "FileStore.p7b" and able to
find the
certificate in the file (CertFindCertificateInStore returns a context).
Unfortunately, my calls to AcquireCredentialsHandle always return
SEC_E_INTERNAL_ERROR. (I am using the UNISP_NAME package)
//to include private key info in my certificate context i used
CertSetCertificateContextProperty
//and set it CERT_PVK_FILE_PROP_ID ie., my private key is present in a
file("server.key").
//This function doesnot return any error. i want to know that private key
file("server.key") has
to be in .pvk format otherwise AcquireCerdentialshandle will throw
SEC_E_INTERNAL_ERROR
//code
if(!( CertSetCertificateContextProperty(m_pCertContext,
CERT_PVK_FILE_PROP_ID,
NULL,
pvData)))
|
|
|
|
|
can any one tell url of COM ebooks
|
|
|
|
|
|
Can anyone tell me how to create a huge 2d array without affecting the processing time too much?
I used double pointer to create an array 2d array[27000][27000] as following:
BYTE **array;
array = (BYTE**)calloc(sizeof(BYTE*), 27000);
for (unsigned int index = 0; index < 27000; index)
array[index] = (BYTE*)calloc(sizeof(BYTE), 27000);
Right now, I need to increase the array size to 54000X54000 or even more. However, the compiler seems to have little problem to compile along with other codes. Even it compiles, the processing time is so slow.
Does anyone have a better way to profrom this task?
Thanks!
|
|
|
|
|
An array with nearly 3 billion elements? You need a 64 bit system to cope with that!
The tigress is here
|
|
|
|
|
How much memory does your pc have? Your first array takes over 730MB so if you have less than 1GB of ram it will have to do some swapping which is 10 times slower than memory. Also the second array (54,000 X 54,000) is impossible on a 32 bit windows system as it is almost 3 GB.
Also Note:
There is a limit (because of the way dlls load) in a 32 bit windows program that is somewhere near 1.2GB. You may extend that if you create compile your program with the largeaddressaware switch turned on (google for details) and boot a capable operating system with the /3GB switch in your boot.ini file.
John
-- modified at 8:51 Tuesday 4th October, 2005
|
|
|
|
|
You probably dont need that big an array, depends on the kind of data that you will be working on.
May be you need to redesign your implementation so that it works on a small section of the array at a time and rest of the data goes in the array or maybe you need a database.
-prakash
|
|
|
|
|
Look into CreateFileMapping/MapViewOfFile - it might allow you create big "arrays".
|
|
|
|
|
Thanks for all your inputs. The reason for such huge array is storing image information. In other words, 1 array cell equals to 1 pixel and also equals to 1 mil size (may go down to 0.5 mil per pixel). For a size of 54"X54" image, it requires 54000X54000 size of array.
With your expertises, there may be another way to work this out. In MFC, there is a CDC class in which have nice functions to draw on a bitmap. Creating such huge bitmap; however, is not possible. Is there a way to make this work? All I need is drawing some figures on a roster, and then retrieving cell by cell whether being occupied with a color or not.
I may ask too much but please help if you have some possible solutions.
Thanks
|
|
|
|
|
Raymond C wrote:
I used double pointer to create an array 2d array[27000][27000] as following:
For such big array i would suggest doublly linked list. may be it complecates the stuffs but its worth. This will cosiderably improve performance.
If you can tell what for you r using this big array i can suggest.
Take it cool and just finish it.
|
|
|
|
|
Raymond C wrote:
I used double pointer to create an array 2d array[27000][27000] as following:
For such big array i would suggest linked list. may be it complecates the stuffs but its worth. This will cosiderably improve performance.
If you can tell what for you r using this big array i can suggest.
Take it cool and just finish it.
|
|
|
|
|
Hi Karmendra_js,
Thanks for your input. The reason for such huge array is storing image information. In other words, 1 array cell equals to 1 pixel and also equals to 1 mil size (may go down to 0.5 mil per pixel). For a size of 54"X54" image, it requires 54000X54000 size of array.
With your expertises, there may be another way to work this out. In MFC, there is a CDC class in which have nice functions to draw on a bitmap. Creating such huge bitmap; however, is not possible. Is there a way to make this work? All I need is drawing some figures on a roster, and then retrieving cell by cell whether being occupied with a color or not.
I may ask too much but please help if you have some possible solutions.
Thanks in many
|
|
|
|
|
How to retrive the tables from Database (.mdb) file
Plz .Urgent
Rondla
|
|
|
|
|
I was Including Shlwapi.h file in my ctAppRuleParser.cpp.. but i stuck up with the following error
i am using #define _WIN32_WINNT 0x0500 in my application.
ctAppRuleParser.cpp
F:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\Shlwapi.h(56) : error C2146: syntax error : missing ';' before identifier 'DECLSPEC_IMPORT'
F:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\Shlwapi.h(56) : error C2501: 'EXTERN_C' : missing storage-class or type specifiers
F:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\Shlwapi.h(56) : fatal error C1004: unexpected end of file found
ctcapsule.cpp
How can i solve this compilation problem.
Sunil Virmani
|
|
|
|