|
prithaa wrote: But the selected item is not transferred in a variable.
Do you want the cursor selection of the combo box to be transferred to a variable or the actual data? If you want the cursor selection, use:
SendMessage(hComboBox, CB_GETCURSEL, 0,0);
where hComboBox is the window handle to your combo box.
If you want to get the actual data, use:
SendMessage(hComboBox, CB_GETLBTEXT, SendMessage(hComboBox, CB_GETCURSEL, 0,0),&text_buffer);
See MSDN for more on CB_GETLBTEXT[^]
where hComboBox is the window handle to your combo box, and text_buffer is a char which receives the data.
Hope this helps!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
U can use this code
CComboBox m_combo;//in header file
m_combo=(CComboBox *)GetDlgItem(ID_OF_COMBOBOX);
so now you can use m_combo as member variable , if you use this u don not need
DoDataExchane()
Good Luck
|
|
|
|
|
Hello,
Thanks
For now my problem is solved and I could get the value from the combo box without DoDataExchange() because I do not know subclassing .
But is it possible to do the subclassing part and is it as simple as calling
SubclassDlgItem() for my combo box and then using the id in DoDataExchange() for value of data.
Thanks
Prithaa
|
|
|
|
|
|
prithaa wrote: But is it possible to do the subclassing part and is it as simple...
Why do you think that the dialog needs to be subclassed?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for all your replies,
I thought subclassing enables to handle windows controls (messaging) on a dialog box which is made without resources .so I should subclass the windows controls on the dialog. Also I am not able to use DoDataExchange() function without subclassing.
Prithaa
|
|
|
|
|
prithaa wrote: ...a dialog box which is made without resources .
Are you creating this dialog at runtime? Is there something not known about it at design time?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
Thanks for your replies .
I am not creating dialog at runtime it is created in design time.
Pritha
|
|
|
|
|
prithaa wrote: ...it is created in design time.
Then how does it not have any resources?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Records
1. Catalogue No 7 Digits (First 4 digits being the year,
Last 3 digits being the unique record key.
Eg. 2007123
2. Title < 30 Char
3. Author < 30 Char
4. Format 1 Char 4 diff format, namely <S>, <L>, <O>, <P>
Create a function, named CreateBook. When called, it will allow the user to enter the records. Details are to be saved into a file named Book.dat.
Structure of File
<createdate><no of bks>
<catalogue no><title><author><format>
<catalogue no><title><author><format>
<catalogue no><title><author><format>
<catalogue no><title><author><format>
.
.
.
.
<catalogue no><title><author><format>
Where createdate is the date when the file is being created.
Describe the test for Catalogue No, the Purpose of the test, and …. Screenshots
Additional information is to be added.
- Classification Non Fiction/ Fiction
- DeweyNo For eg, Fiction has a deweyno of 999.999
- Genre For eg, Comedy, Romance…
Draw Classes, showing their relationships to solve the OOP technique, showing clearly the attributes and methods.
help pls
-- modified at 6:53 Saturday 7th July, 2007
|
|
|
|
|
How do you want this data to be stored? In a database file or just a text file with your own formatting and syntax?
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
gnowkeenz wrote: Draw Classes, showing their relationships to solve the OOP technique, showing clearly the attributes and methods.
Better get started. Turning in late homework is a no-no!
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hai Good Morning...
I need to update the xml file dynamically in vc++. i did parsing to the xml file then i displaying the parsed values in treectrl. now i am goin to edit the values in the ctrl...which means i will rename the values or deleting the values if i did these changes in treectrl i need to update the same values in XML file also....
any idea....
pls reply me
|
|
|
|
|
Hope this helps...
MSXML2::IXMLDOMDocumentPtr m_pXmlDoc;
if(m_csFilePath.IsEmpty()) return false;
_variant_t varString = _T(m_csFilePath);
m_pXmlDoc->save(varString);
return true;
|
|
|
|
|
hai joan...
Thanks
|
|
|
|
|
Hi
i introduce a laibrairie in my project, whene i compile there are error :
D:\Program Files\Microsoft Visual Studio 8VC\PlatformSDK\include\wspiapi.h : (44)error C2894: templates cannot be declared to have 'C' linkage
please help me to resolve this pb.
Thank you verry mutch
|
|
|
|
|
Strange - I don't see anything related to templates in there.
If I include that file anywhere in my projects it compiles fine.
What's the code at and around the offending line?
Mark
This episode brought to you by the number 5
|
|
|
|
|
I must intruduce WinPcap to capture Paquets, fot that i add in Linker>Input : WinPcap.lib and in C/C++>Preprocessor : WIN32;_DEBUG;wpcap and in Forme1.h i introduce #include "Pcap.h"
all this was defined in http://www.winpcap.org/docs/docs_40/html/group__wpcapsamps.html[^]
please help me to resolve this problem
Thank you verry mutch
|
|
|
|
|
WPCAP should be all capitals, right?
You can't show the offending lines of code? Please?
I don't have pcap.h, so I can't try it, but I imagine windows header files need to be included
before or after it because of some name conflict or something. You may want to change where you
include that file. I can only guess without seeing it.
Mark
This episode brought to you by the number 5
|
|
|
|
|
Do you by any chance introduced such code in you project:
extern "C" {
#include "SOMEHEADER.h"
}
where SOMEHEADER may be wspiapi.h or any header file that may use wspiapi.h.
|
|
|
|
|
Whene i click on error it's show this line : template < typename __CountofType, size_t _N >
I don't add Wspiapi.h, i just adding pcap.h and inc.h, i don't see a Wspiapi.h in Solution Explorer!!
Thank you verry mutch
|
|
|
|
|
I see the template declaration in the newer wspiapi.h and I downloaded WinPcap.
Including pcap.h worked fine for me.
Where are you including pcap.h?
This episode brought to you by the number 5
|
|
|
|
|
I am trying to convert an HICON to a PNG in memory. I am able to do this operation but on certain icons, like the XP Drive Icons or anything that uses XP shadowing, I get blotchy edges for the shadow. It looks like the transparency on the shadow is not being converted properly.
Below is how I am doing the conversion. I am wondering if more manual labor is required and if anyone knows what that could be. I am not a graphics expert.
In my application, the HICON handle is from a call to SHGetFileInfo. I am retreiving a file's 16x16 icon, including overlays, which I need in PNG format.
// encoder is "image/png"
int sh_icon2img(unsigned char *out, int outl, HICON icon, CLSID encoder)
{
int size;
ULONG ul;
IStream *s = NULL;
Bitmap *bmp;
ULARGE_INTEGER lisize;
LARGE_INTEGER offset;
if(CreateStreamOnHGlobal(NULL, TRUE, &s) != S_OK)
{
return -1;
}
/* create the Bitmap object and save to stream */
bmp = new Bitmap(icon);
bmp->Save(s, &encoder, NULL);
delete bmp;
/* get stream size */
offset.QuadPart = 0;
if(s->Seek(offset, STREAM_SEEK_END, &lisize) != S_OK)
{
s->Release();
printf("Failed to get the size of the stream!");
return -1;
}
size = (int)lisize.QuadPart;
/* seek back to beginning of stream */
s->Seek(offset, STREAM_SEEK_SET, NULL);
// provided buffer is too small
if(outl < size)
{
s->Release();
return -1;
}
if(s->Read(out, size, &ul) != S_OK || size != (int)ul)
{
s->Release();
return -1;
}
s->Release();
return size;
}
Thanks in advance.
|
|
|
|
|
Hello,
I have written a mathematical matrix class
for VS C++ 6 and I would like to publish it
in your site in the form of a library (*.lib).
Maybe later I release the code too.
However I am facing serious problems with my linker
an I 'm not sure if I will ever manage to publish it (at least in
a reasonable amount of time) without your help. So,
I would like to ask you if you could help me a bit.
I am willing to refer your name in my article.
Although, it may take me some time to write it.
As far as I have understood, it is the MFC (used by my
class) that conflicts when I try to use my compiled
*.lib file. I tried to change the settings of my linker
(/NODEFAULTLIB) but I do not find the process familiar!
I have uploaded the *.lib file and the header file so that
you can test it on your own. It is at:
http://rapidshare.com/files/41398859/LIB.zip[^]
The process of compiling it into a LIB file seems to be OK.
I will sum it up if you want:
I added my header file and my cpp file into the project
(Win32 Static Library) and I just built the lib files
with no errors.
Then I created a new MFC app (Dialog, MFC statically linked -
I don't know if that matters), I added the header file and the
lib files into the project, I added the
#ifdef _DEBUG
#pragma comment(lib, "mat_lib_DEBUG.lib")
#else
#pragma comment(lib, "mat_lib_RELEASE.lib")
#endif
in the code file using my class. But it just does't work.
If you manage to compile a project while using an object
please upload the project, so that I can see what I was
doing wrong. If you wan't you may write sth here too.
To use an object of the class write:
CKelLib::CKelMatrix m,n(2,1);
double p[4][4]={{1,2,3,4},{3,6,9.2,12.9},{7,14,21,27},{3,4,9,12.3}};
m.Initialize((double*)p,4,4);
Any kind of help would be appreciated.
Thank you.
kostas KEL
|
|
|
|
|
KEL3 wrote: But it just does't work.
what makes you think it doesn't work?
|
|
|
|