|
use std::vector for your 'dynamic array'. you can insert anywhere in the array (no 'overwriting'); you can get the size of the array with myvector.size(); it will handle cleanup and will generally make your life better.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Okay where is the inlcude file for vectors and also how do i add an item to it? thanks
~~~~~~~~~~~~
~~NICHOLAS~~
~~~~~~~~~~~~
|
|
|
|
|
#include <vector>
using namespace std;
vector<CString> myVect;
myVect.push_back(_T("Nick"));
myVect.push_back(_T("Parker"));
-Nick Parker
|
|
|
|
|
Okay now how do i iterate through the elements and get their value??
~~~~~~~~~~~~
~~NICHOLAS~~
~~~~~~~~~~~~
|
|
|
|
|
Use an iterator:
vector<CString>::iterator myIter;
-Nick Parker
|
|
|
|
|
|
If you are using MFC (you did not say) then just use class CStringArray.
Trust in the code Luke. Yea right!
|
|
|
|
|
I have a program which read the serial port. I have it running okay on Windows 2000, but when I tried on Windows95, this is the error message I got:
"Linked to missing export KERNEL32.DLL:Cancello"
"A device attached to the program is not functioning"
What can be wrong? TIA!
|
|
|
|
|
|
thank you!
I will let my partner know that I am not supporting Windows95 then.
|
|
|
|
|
If you want, you can try to use Rational Purify Plus in order to check which functions are used by your application that are usupported for Win95, you can download the demo version and check it.
Else you can check it by yourself by checking all the functions used in MSDN in order to know the OS required for that function...
There are a lot of ways to know which OS you are using (where your app has been installed) and you could write an application that work in different ways depending on the OS.
Hope this helps.
|
|
|
|
|
Hi,
do you know where I can get the list of key events handled by a CTreeCtrl ?
For instance, in the Explorer, you can use '+' to expand and '-' to collapse.
I searched MSDN, but didn't find it.
Any ideas, links ?
TIA,
Stephane
www.exotk.org
|
|
|
|
|
Is it possible to have multiple FrameWnds in a SDI App? What i want to do is have my main SDI FrameWnd(which contains a splitter and views within the splitters), and call up a dialog that contains a splitter window and different views of my current open document. So i thought i would just be better to have the that Dialog actually be an aux FrameWnd. Can you have multiple frame windows? I want my mainframe to stay my mainframe but i want to bring this other FrameWnd up when needed (modelessly). Is this possible in MFC Doc/View?
|
|
|
|
|
Hi
Yes you can. You must destroy the old frame and create the new one. Look for the swsplit.exe sample in the Microsoft knowledge database. This shows you how.
Woody
|
|
|
|
|
Hi...
I'm looking for a C function which detects a key pressed. For example a function like IsKeyPressed() which returns a boolean... The function must return immediately without waiting until a key is pressed.
Thanks for your help
Hello World!!!
from Raphaël
|
|
|
|
|
|
|
thanks a lot...
Hello World!!!
from Raphaël
|
|
|
|
|
GetAsyncKeyState() is a Windows function that will tell you the state of a particular key.
|
|
|
|
|
Knowing that IE supports gzip'd files, is the API, hidden or otherwise, available in Win32?
Todd Smith
|
|
|
|
|
gzip in IE is a custom protocol handler. Lookup the registry at this place : HKCR \ PROTOCOLS \ Filters \ gzip (as well as deflate).
If for any reason you want to take advantage of the built-in IE gzip library, then I believe you have to host the protocol handler, as explained here[^]. But, getting the library gzip.org might just be as fine....;)
|
|
|
|
|
I want to insert a new line between subjects in a CString variable.
For example, instead of
"Grade A Grade B Grade C"
I want the text saved in a database as
"Grade A
Grade B
Grade C"
I tried doing something like this
str1 + '\n' | str2 + '\n' + str3
But this does not insert a new line.
-Elizabeth
Eilzabeth
|
|
|
|
|
Elizabeth Chang wrote:
I tried doing something like this
str1 + '\n' | str2 + '\n' + str3
Can you please post the exact code you are using?
What database are you using? Some databases may expect a carriage-return line-feed pair for the end of a line (that is "\r\n" or 0x0d0a).
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
The string "\r\n" works on both saving to the database (Oracle) and displaying on a CEdit control. Here is the syntax I used:
str1 + "\r\n" + str2 + "\r\n" + str3
Thank you.
-Elizabeth
Eilzabeth
|
|
|
|
|
Check out <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/vcrefcstringinsert.asp">CString::Insert</a>[<a target=_blank title='New Window' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/vcrefcstringinsert.asp">^</a>]
-Nick Parker
|
|
|
|