|
///////This example for Delete/Insert / read and count And Create
//But you dont need to create list becuase you have control in your form
CListBox m_List2;
m_List2.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,100),this,1);
m_List2.AddString("1");
m_List2.AddString("2");
m_List2.AddString("3");
m_List2.AddString("4");
//For Delete from ListBox
m_List2.DeleteString(0);//Delete 1//m_List2.GetCurSel()
//////For GetItems
CString Str,temp,Str2,Str3;
CStringArray m_String;
for(int i = 0;i< m_List2.GetCount();i++)
{
m_List2.GetText( i, temp);
Str.Insert(0,"\\"+temp);//insert in location 0
Str3.Insert(Str3.GetLength(),"\\"+temp);//insert in location end
Str2=Str2+"\\"+temp;//insert 1\2\3
m_String.Add(temp);//insert to array
}
|
|
|
|
|
hai ,All
In a recent interview I have faced a question ,
Whatis the difference between C and C++ structure.
krishna
|
|
|
|
|
In the simplest cases - nothing. C++ ws designed specifically so that C code will compile and have the same meaning as it does when compiled with a C compiler.
However, semantically, in C++ a structure is identical to a class, except its default access specifier is public: instead of private: . In practice therefore, a C++ structure can have member functions, operators, base classes and virtual functions, just like a class. If you're writing code to interoperate between C and C++, you may need to bear this in mind - C++ will add a virtual table pointer if you have virtual methods which the C code won't know about. Similarly if you derive a structure from a base class (or structure), there will be extra information in your structure that the C structure won't have. These are issues if you need to maintain the exact same binary format as a C program (for example, if you call C functions with pointers to structures.)
Syntactically there's a difference too. In C++ the structure name is treated as a proper type name, whereas in C the name must always be prefixed with struct . In C it's common to typedef the structure:
typedef struct tagFoo { ... } Foo;
Foo foo;
This is valid in C++, but the typedef is unneccesary. However if you want to have source code that interoperates between the two languages (ie compiles as both C and C++) you'll need to use the C-style syntax.
Matt Godbolt
Engineer, ProFactor Software
StyleManager project
|
|
|
|
|
That's a really good explanation. Very clear
|
|
|
|
|
1. you can add keywords in C++: public, protected, private
2.you can add fuctions in side struct in C++;
(struct is similar to class in C++ except default members are public).
3. instance can be created directly without type struct.
E.g. if MyStruct is a struct, u can
MyStruct ms; //OK in C++ but error in C.
in C, u must say:
struct MyStruct ms;
maybe something more - inherented?.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
-- modified at 3:00 Friday 7th April, 2006
|
|
|
|
|
If during a build that is meant to be for unicode only UNICODE is defined in the preprocessor definitions and not _UNICODE, might that have negative consequences?
Why are there 2 different definitions anyway?
Thanks for any insight in this issue..
Davy
|
|
|
|
|
GDavy wrote: If during a build that is meant to be for unicode only UNICODE is defined in the preprocessor definitions and not _UNICODE, might that have negative consequences?
Why are there 2 different definitions anyway?
_UNICODE is for TCHAR support.
More Information[^]
Nibu thomas
Software Developer
|
|
|
|
|
UNICODE is for the Windows header files and _UNICODE is for the CRT.
Steve
|
|
|
|
|
Hi all,
In my MDI application, I have 10 toolbars. Initially nothing will be visible. They are selected from the menu "Toolbar". Now lets say, I open one toolbar. Then I goto print preview. Once I closed print preview, all toolbars are visible. How does it happen? If anyone could help me, I'd be grateful.
Thanks in advance,
Sarvan AL
|
|
|
|
|
this is a probelem of your code - only solution is to check ur code - i.e. add a message-box at show toolbar fuction to see why invisible toolbars are shown.
only guess: if u use "swith-case", do u have "break" for every bar?
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
Hi includeh10,
I've solved it now. But I had to maintain the display status of all toolbars explicitly. This is how I am doing:
CMainFrame::OnPaint()<br />
{<br />
....<br />
if(m_bHideToolBars)<br />
{<br />
HideAllToolbars() ;<br />
m_bHideToolBars = FALSE ;<br />
RecalcLayout() ;<br />
}<br />
....<br />
}<br />
CMainFrame::HideAllToolbars()<br />
{<br />
m_tb1.ShowWindow(m_bVisibleTb1) ;<br />
m_tb2.ShowWindow(m_bVisibleTb2) ;<br />
m_tb3.ShowWindow(m_bVisibleTb3) ;<br />
...<br />
}<br />
CMyView::OnEndPrinting(..)<br />
{<br />
...<br />
((CMainFrame*)AfxGetMainWnd())->m_bHideToolBars = TRUE ;<br />
}
Sarvan AL
|
|
|
|
|
I can not find good documents about Format of true-type-font file.
could you give me some links or comments?
thx
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
Here.[^]
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
thanks,
but-
main link inside your link is invalid.
I navagated to other links there and found only software, which is not about file format.
could u give me a direct link to file-format?
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
includeh10 wrote: main link inside your link is invalid.
Huh? The first link on that page is to here: http://www.microsoft.com/typography/otspec/[^]. It works perfectly for me and the second link on that page give the file format...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
OpenType is an extension of TrueType - currently I should learn basic - TrueType, not OpenType - for start.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
That page covers both. If you're wanting to learn about font files, TrueType is a legacy, older format that Microsoft doesn't directly support any more. Learn OpenType as well.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi
How to use a DLL developed in VB.NET in VC++, i am using VC2005 IDE
|
|
|
|
|
It needs to be a COM dll, then you can use it via COM. Unless it's a VB 2005 DLL, then you can create a C++/CLI project, which means your C++ project is reliant on the .NET framework, and you can then add it as a reference.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I think you'll have to wrap the DLL in a COM callable wrapper (CCW).
Steve
|
|
|
|
|
Do you know where I can get a printable version of the MSDN Winsock 2 Reference? My eyes hurt when i have to read online much so I like to print out and read offline instead.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/winsock_reference.asp
Thanks
|
|
|
|
|
buy a very dark screen-filter, which is very useful for your eyes - I am using it now.
Before I used the screen-filter, I got big headache if watched online too long every day. it is fine now.
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
Install a virtual printer (such as virtual pdf printer),
then press ctrl+P in Firefox for save it to virtual printer.
|
|
|
|
|
Have you checked the refresh rate of your display? That is a common cause of headaches after long periods, try to get it up to 80-85Hz.
The tigress is here
|
|
|
|
|
"Windows Sockets 2 Application Programming Interface" at
ftp://ftp.microsoft.com/bussys/winsock/winsock2/wsapi22.doc[^]. I think there are pdf'd versions of it around, if you search for them.
But even though it's written for Winsock 2.2, it was released in August of 1997. So, some parts are clearly out-of-date (e.g., SO_RECVTIMEO is supported currently, even though the above 1997 release says it's not).
So, at the end of the day, you will still need to check at the on-line docs for complete currency.
Best regards,
Mike
|
|
|
|