|
You should use the CBS_SELENDOK message. While CB_SELCHANGE does what you want, you get this while a mouse is selecting a item from the list, so you may get multiple selectons before an actual item is selected by the user.
If you vote me down, my score will only get lower
|
|
|
|
|
Thanks Roger,
I tried to handle CBS_SELENDOK message and the return string is still an empty string. The handler function looks like below:
void CMyDlg::OnCbnSelendokMycombo()
{
UpdateData(TRUE);
CString szMyCombo;
m_MyCombo.GetWindowText(szMyCombo);
if (v_szMyCombo.IsEmpty())
return;
}
</code>
both szMyCombo and v_szMyCombo return empty strings. v_szMyCombo is the CString value variable for the combo box. Again, if I change the combo box style to "Drop List", the return string is correct.
Any other ideas?
|
|
|
|
|
Hi!!! I would like to ask you all, if you know how to Save an Image coming from the ClipBoard to a .jpg File... thanks alot!!!
|
|
|
|
|
try to serach fo cximage library in codeproject.that will solve your problem
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
thanks for the info... but, i only wanted to retrieve the image from the ClipBoard and Save it in a .jpg File...
|
|
|
|
|
|
The image data on clipboard must be uncompressed DIB format. First try to save image in *.bmp format. Then use ICImageCompress API to compress .bmp to .jpeg
|
|
|
|
|
Hi!
I am newbie to programming in VC and really need some urgent help with executing command lines using VC.
i have a commandline encoder called encoder.exe . From MS-DOS prompt, I can execute the encoder by the following command line:
encoder hello.wav
where hello.wav is an input file to the encoder.exe and is found in the same directory as encoder. 2 files, hello.ogg and hello.phn will be generated by the encoder.
my problem is now how to execute the command line in VC? real sorry for this seemingly simply qn. i m a poor web searcher and after surfing the net for 1 whole day, i can hardly understand how i can even get started.
|
|
|
|
|
I am not sure this is what you are asking but if it is... go into the Project/Settings and set the Debug/Program Arguments to:
hello.wav
Then start the debugger.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
i guess it will work like this..
system("encoder hello.wav");
|
|
|
|
|
Hi!
Thanks to all for the prompt replies!
system("encoder hello.wav");
the above line works and it's great! thks!
I've also tried the following and it works too
SHELLEXECUTEINFO ShExecInfo = {0};<br />
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);<br />
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;<br />
ShExecInfo.hwnd = NULL;<br />
ShExecInfo.lpVerb = NULL;<br />
ShExecInfo.lpFile = "oggenc.exe";<br />
ShExecInfo.lpParameters = "test.wav";<br />
ShExecInfo.lpDirectory = NULL;<br />
ShExecInfo.nShow = SW_HIDE;<br />
ShExecInfo.hInstApp = NULL;<br />
ShellExecuteEx(&ShExecInfo);
this might useful as the command prompt does not flash across the screen when executed
thanks again!
|
|
|
|
|
yea! but its much longer
and dont forget to close the handle..
if(ShellExecuteEx(&inf)) {
WaitForSingleObject(inf.hProcess,-1);
CloseHandle(inf.hProcess);
}
|
|
|
|
|
hey thanks so much!
i'm still pretty new to VC executing commandline and will be most thankful if anyone has any useful website or articles to share
|
|
|
|
|
hi!
i wonder if anyones knows how to execute commandline using javascript? I'm doing a website that needs to using a commandline encoder....
|
|
|
|
|
I am creating a tab dialog with several tabs.
After inserting the property sheet with 2 tabs, I tried to add some controls to Property Page 1.
If I double click on a control (say, a button) on Property Page 1, VC complains: Cannot add new member.
I thought it was because I hadn't created a class for it, so, I used Class Wizard create a CPage1::public CPropertyPage. Nothing changed !
Again, I opened Class wizard and double clicked on IDC_BUTTON1, then let VC create the new function OnButton1(). In the body of this function, I just MessageBox("Button")
However, when I ran the program, the Property Page1 showed up with the button, but when I clicked on it, nothing happened. And still, when I clicked on other controls, I received the same complains by VC: Can not add new member
Could any one tell me what's wrong with my program & give me step-by-step instructions on how to create a tab dialog ? For some reason, Googling CPropertySheet Tutorial didn't produce any good results.
Thanks so much for any help.
|
|
|
|
|
Hello everyone.
I'm trying to properly read an id3v2 tag.
I've been trying for days now to figure it out but I cant seem to get it right.
here is what i have so far:
<br />
#include <iostream><br />
#include <string><br />
#include <fstream><br />
<br />
int main(int argc, char * argv[])<br />
{<br />
if (argc != 2) {<br />
cout<<"usage: id3v2 filename.mp3\n";<br />
exit(0);<br />
}<br />
<br />
ifstream in;<br />
in.open(argv[1]);<br />
<br />
char header[10];<br />
in.read(header,10);<br />
header[10] = '\0';<br />
<br />
if(header[0] == 'I' && header[1] == 'D' && header[2] == '3'){<br />
int hSize = ((header[3] & 127) << 21) |<br />
((header[4] & 127) << 14) |<br />
((header[5] & 127) << 7) |<br />
(header[6] & 127);<br />
<br />
int versionMajor, versionMinor;<br />
versionMajor = header[3];<br />
versionMinor = header[4];<br />
<br />
bool unsynchronisation,compression,experimental,extended,footer;<br />
unsynchronisation = false;<br />
compression = false;<br />
experimental = false;<br />
extended = false;<br />
footer = false;<br />
<br />
switch(versionMajor){<br />
case 2:<br />
unsynchronisation = (bool)(header[5] & 0x80);
compression = (bool)(header[5] & 0x40);
break;<br />
<br />
case 3:<br />
unsynchronisation = (bool)(header[5] & 0x80);
extended = (bool)(header[5] & 0x40);
experimental = (bool)(header[5] & 0x20);
break;<br />
<br />
case 4:<br />
unsynchronisation = (bool)(header[5] & 0x80);
extended = (bool)(header[5] & 0x40);
experimental = (bool)(header[5] & 0x20);
footer = (bool)(header[5] & 0x10);
break;<br />
}<br />
<br />
int sizeOfFrames;<br />
sizeOfFrames = hSize - 10;
<br />
<br />
cout<<"sizeOfFrames="<<sizeOfFrames<<endl;<br />
cout<<"\n\n";<br />
<br />
while(sizeOfFrames > 0){<br />
char frameId[4];<br />
char frameData[6];<br />
int frameSize;<br />
<br />
in.read(frameId,4);
in.read(frameData,6);
<br />
frameId[4] = '\0';
frameData[6] = '\0';
<br />
frameSize = ((frameData[0] & 127) << 21) |<br />
((frameData[1] & 127) << 14) |<br />
((frameData[2] & 127) << 7) |<br />
(frameData[3] & 127);<br />
<br />
if((frameSize > 0) && (frameSize < sizeOfFrames)){<br />
<br />
char tagInfo[frameSize];<br />
in.read(tagInfo,frameSize);<br />
tagInfo[frameSize] = '\0';
<br />
cout<<"frameId="<<frameId<<"\n";<br />
cout<<"frameSize="<<frameSize<<"\n";<br />
cout<<"tagInfo=";<br />
for(int x=0;x<sizeof(tagInfo);x++)<br />
cout<<tagInfo[x];
cout<<"\n\n";<br />
<br />
}<br />
sizeOfFrames -= frameSize;<br />
}<br />
if(versionMajor == 2){<br />
;
}<br />
}<br />
system("pause");<br />
return 0;<br />
}<br />
Sometimes it will read a bunch of garbage in from the file and print out
unexpected results, and other times it reads the id3 tag just fine.
for example: i used winamp to modify the id3v2 tag of one of my mp3 files adding the year. Then i ran this code again and it produced the unexpected results. A different mp3 file already had the year in its id3v2 tag, and when i ran this code, the program read the id3 tag just fine.
I'm almost sure that the frames have to be read differently depending on which version the tag is. I'm not sure if thats the problem or how to go about doing that.
I found someone else's code from another website that i have been trying to go off of to figure this out.
you can find it here:
http://tebl.homelinux.com/projects.php
just scroll down and click on "ID3V2"
and then click on "id3v2.c"
(sorry i cant give a direct link)
I compiled and ran the code from this website, and it reads the id3 tags for mp3 files just fine!!
So this just adds to my frustration.. I have someone else's code in front of me that works, and i still cant figure this out writing it on my own.
one thing though, i want to use fstream to do this because im most comfortable with it, and i dont want to use any structures or classes.
Just trying to write it flat and easy until i can understand everything.
Could anyone help me with the problems in my code?
I cant seem to figure out what im doing wrong.
Thanks for your time.
|
|
|
|
|
ifstream in;
in.open(argv[1], ios::in | ios::binary);
That's the first thing is saw.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
thanks, i forgot that flag. That helped a little bit. The problem is when i get the frame size sometimes it is incorrect. Or my loop is setup wrong?
This is how im determining the size of each frame of the id3 tag.
int frameSize = ((frameData[0] & 127) << 21) |
((frameData[1] & 127) << 14) |
((frameData[2] & 127) << 7) |
(frameData[3] & 127);
I got this code from another program and dont really understand it very much.
like ((frameData[0] & 127) why 127? and then followed by << 21 why 21?
how were these numbers were pulled out of the hat?
is this correct in determining the frame size?
|
|
|
|
|
Hi Dears,
I read application that use two view , first with GDI+ and Second with OpenGL.
Is there any conflict between these ?
and Can i do that ?
Best Regards,
|
|
|
|
|
|
Hi Dears,
I wanna know , how i can access serial and parallel? and if i start to do that
with subject i should learn.
Best Regards,
|
|
|
|
|
mostafa_pasha wrote:
how i can access serial and parallel?
CreateFile()
mostafa_pasha wrote:
with subject i should learn.
I don't understand the question. Developing applications that use communication mechanisms generally requires a broad range of topics.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hello Friends,
This time I got another question for you.
In the Settings, we have got two options either we can go for Debug mode or Release Mode.
What are the main differences between the Debug Mode and the Release Mode? Which mode we have to choose?
Thank you
Bye friends.
|
|
|
|
|
DEBUG mode adds information to the build for debugging purposes. RELEASE mode does not contain this information and is therefore much smaller and likely faster as well.
Actually there is quite a bit more to it than that. You would have to do some studying on the subject to become versed in it.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Comparing Debug and Release Mode
Debug mode compiles and links the code such that it can be run with the debugger. This lets you single step through the source code, set breakpoints, and examine variables during execution. Release mode code cannot be run under the debugger with full source code information available.
Compiling for debug turns off all optimizations in order to make debugging easier. This makes the code slower and much larger than release mode. When you compile in release mode, you can choose the optimizations that the compiler performs. Optimizations can generate faster code, or make the resulting .EXE smaller, or any of a wide variety of choices for performance tuning.
Debug code cannot be distributed, because it runs with the debug libraries for the 'C' runtime, MFC, etc. The debug libraries may not be distributed, since they are licensed as part of the development package. Release mode code runs with the release libraries, which you are allowed to distribute.
The debug versions of the runtime libraries behave differently from the release versions. The heap functions (new , delete , malloc , free , and so on) change how they allocate memory so that they can detect when you have overrun allocated buffers or make other allocation errors. Functions in the libraries tend to check their arguments and ASSERT when you've supplied an invalid value. These error checks are not used in the release libraries, which means these errors can go undetected until the program crashes.
Which Should I Use?
Typical practice is to start out developing and testing your program in debug mode. When you think you've got the program working correctly, and you have tested it thoroughly, compile it for release and test it again. When your program is compiled for release, it may behave somewhat differently from the debug version. It will probably run faster. It will probably use less memory than the debug version. If the program is multithreaded, you may see threading problems that you did not see in the debug version, due to the timing changes.
Software Zen: delete this;
|
|
|
|