|
hey all,
I am new to this area.
Iam trying to create a combobox with vertical scroll enabled.
I want to have some 9 items listed in the combobox. How do I list the items?
In the property page of that combobox,
enabled the "droplist" ,vertical scroll.
How do the items get displayed on the combobox after build of the program?
Any guide/help?
|
|
|
|
|
If you are using VS 2003, open dialog editor, select your combo-box, go to the Properties panel, and enter your items in the Data field. Separate items with semicolons.
|
|
|
|
|
You need to add the items to the combo box using
m_combo.AddString();
If you are not able to see the contents of the combo box ,select the combo box in resource editor.
Click on the arrow
Drag the combo box down with a click on the lower border.
That's it . You will see the contents when you click on the combo box
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I want to include some files in my project.but i dont want to place those files in my project folder.how can i include a file without place that in current project folder.
E-Ramu
|
|
|
|
|
Check in the project settings, there is an option in which you can specify additional include directories (it is in the C/C++ tab)
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
While including the file give the entire path.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
#include "C:/path/to/header.h"
Yes, forward slashes are OK and are preferable, because you don't run into problems with \ being the C escape character.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
Hi,
If you're using Visual Studio (>6.0) you can for instance setup the "other include dirs" of your project to be "$(SolutionDir)headers" then create a "headers" directory to put your include files under the directory where your solution file is.
I do the same kind of thing with the libraries .lib (into lib directory) and the binaries .exe .dll (into the bin directory).
|
|
|
|
|
I am not sure what you mean. If you mean including it in the project files list, then you have two choices. Include it through the project settings or include it through the "#include statement". If it is a source file, then you can include it like so "#include "filename.extension"; of course in a Microsoft development enviroment the user can alway open the file and modify it if they really want to (if not write protected).
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I want to import and use resources such as sound clips, dlls, etc inside my MFC program. How do I do this?
|
|
|
|
|
Do the Following way.
HINSTANCE hRes = NULL;<br />
hRes= LoadLibrary("ResourceD.dll");<br />
if(hRes)<br />
AfxSetResourceHandle(hRes);
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
_kal_ wrote: I want to import and use resources such as sound clips, dlls, etc inside my MFC program. How do I do this?
Use #import preprocesser Directives
as follows
#import "path of dll or typelib" no_namespace, raw_interfaces_only
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I want the sound clip to be a resource that is in my project itself. I want my executable to play the sound clip when click a button. The sound should be embedded in the executable itself and it should not locate it physically on the hard disk and play. is there any sample article which demonstrates this?
|
|
|
|
|
The following steps can be used with Resource Workshop:
1) Resource->New->NewType
2) Type in "ID_SOUND" or "ID_WAVE".
3) If you type yes for creating a resource id make
sure you have access to that symbol. For now
press No.
4) Resource->New and choose "SOUND" resource type.
This will bring up a text editor. Edit the text to
look similar to the syntax mentioned in the
section above.
NOTE: Wave files usually takes a lot of memory which means you might have very large resource files.
Now, let us examine how to access the wave file and play it
from the application. The following code can be used to load
and play the resource.
LPCSTR sound;
hResource = LoadResource( hInst,FindResource( hInst,MAKEINTRESOURCE(ID_SOUND),"SOUND" ) );
sound = ( LPCSTR )LockResource( hResource );
sndPlaySound( sound, SND_MEMORY );
UnlockResource( hResource );
FreeResource( hResource ); In the code above our resource type is "SOUND" and the resource
identifier ID_SOUND. We first use FindResource API function to
find the resource. This function returns a handle to the
resource. This handle is passed to the LoadResource which
returns a handle to a copy of the resource in memory. The
LockResource is next used to get a pointer to the resource. Once
a pointer is available, the latter can be used in a call to the
sndPlaySound() function. The second parameter, SND_MEMORY, is
used to denote that the first parameter is a pointer an in memory
copy of the wave file.
You have to include mmsystem.h header and link to winmm.lib library
wrote:
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
hi all,
how to print in tabular format with 4 col IN A PRINTER LIKE THIS
----------------------------------------------------------------
----------------------------------------------------------------
| | |
----------------------------------------------------------------
| | |
----------------------------------------------------------------
| | |
INSIDE EACH BOX MY TEXT SHOULD BE APPEARED
anyone know plz tell me
-- modified at 8:00 Thursday 15th June, 2006
|
|
|
|
|
That's not very clear. Where do you need to print it ? On the screen ? You can simply use cout and make a tabulation inside your text.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
printf("%04.04s%04.04s%04.04s", "a", "ab", "abc");
or
CString cs;
cs.Format("%04.04s%04.04s%04.04s", "a", "ab", "abc");
But take UNICODE into consideration and adjust the code for UNICODE if you need to.
Use minus-sign to right-justify. ("%-04.04s")
|
|
|
|
|
kakan wrote: Use minus-sign to right-justify. ("%-04.04s")
That should be left-justify.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I should have checked that. Sorry.
|
|
|
|
|
GANsJob wrote: how to print in tabular format with 4 col
anyone know plz tell me
You may use C++ IO manipulaters for same.
for e.g. setw(size) sets the width of the stream you are suppose to output on console.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
can anybdy gimme a code snippet for implementing socket arrays...
|
|
|
|
|
shuchigo_jane wrote: can anybdy gimme a code snippet for implementing socket arrays...
Here is the Array
#define SOCKET_COUNT 10<br />
CSocket socArray[SOCKET_COUNT];
Ask the question in details you will get answers in details..
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi everybody,
I want to disable a list view item. I know that I should use SetItemState method, but I don't know how.
thank you in advance.
|
|
|
|
|
Disabled how? You can set the LVIS_CUT style so icon is grayed, and use custom draw to change the text color to gray.
If you mean disabled as in not selectable, that feature isn't built in to the control.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|