|
I think I had such problem once, but I can't remember clearly what the cause exactly was. You may try deleting all compiler-generated stuff (Debug\ and Release\ dirs, .aps, .ncb ...) and unused resource IDs, then build again.
Happy Easter!
BB
|
|
|
|
|
When editing the icon, did you replace every device type? If you don't know what I'm talking about, when editing the icon there is a combobox labeled device. Icons can have different sizes and color depths. Make sure to change them all.
Joel Lucsy
|
|
|
|
|
Yes, there are different icons under the different device types. That's strange.
Thank you for pointing to the solution.
|
|
|
|
|
Hello,
I have a formview in which a "play" button opens a new window where a video is played image by image. I have also created a "pause" button which should stop the video. But once I'm starting to play my video, nothing happens when I click on the pause button. If I understand well, the message sent by the pause button cannot be catched while my video is playing.
Basically, what I did is the following :
bool user_paused=false // gets true when the user clicks on
// pause
OnButtonPlay(){
while(user_paused==false){
// grab next frame
}
}
OnButtonPause()
user_paused=true;
}
Is there something that I didn't understand in the handling of messages ? Has anyone a solution to help me solve this problem ?
Thank you
Sandrine
|
|
|
|
|
You understand correctly.
You need to change the play loop to check for messages.
Have a look at this example, it's a cancellable progress bar, but it shows how to process messages in a loop.
Progress Window[^]
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Thank you, this helps a bit, but there are still things I don't understand : you are supposed to grab the message that has been picked, but I don't understand how I can know which button sent the message. In the example, it is :
msg.message==WMCHAR&&msg.wParam==VK_ESCAPE,
which I think corresponds to a keyboard key, the escape key, but in my case, it is a button that I have created so the msg.message should be BN_CLICKED, but I have several buttons, so it should grab the message for any button. How can I specify which button is concerned ?
Sorry if I bother with simple questions, but I have hard time finding simple examples for beginners.
Sandrine
|
|
|
|
|
In your message loop, get the WM_NOTIFY message which is sent by your pushing the button.
WM_NOTIFY
idCtrl = (int) wParam;
pnmh = (LPNMHDR) lParam;
Cast the lParam on a LPNMHDR (like done here on pnmh), and you have a pointer on a NMHDR structure :
typedef struct tagNMHDR {
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR;
check if the pnhm->idFrom correspond to your IDC_PAUSEBUTTON (or whatever ID you gave to the button), and if yes, your button has sent the Message (ouf).
BUT ...
I would recommend you to let the video display using its own thread, so the rest of the buttons keep available for the user (this is pseudo code):
Main
if (pause) boolean PAUSE=1
if (play) boolean PAUSE =0, boolean PLAY=1
if (stop) boolean STOP=1
...
VideoThread
while (not STOP)
if (PLAY) display next frame
if (PAUSE) while (not PAUSE)
...
~RaGE();
|
|
|
|
|
Hi,
I have tried to handle the delete key thru the OnKeyDown() method.
All other keys work perfectly fine except for the delete key.
Please help in this regard.
Thanks,
Jitesh
|
|
|
|
|
Post your code. Are you using the right key-code for the delete key ?
Debug your app and see which is the value retrieved by your code for the delete key, and compare it to the one you use.
Or is the message for the delete key not arriving at all ?
~RaGE();
|
|
|
|
|
HI Rage,
The message for Delete key is not arriving at all.
Thanx
Jitesh
Jitesh
|
|
|
|
|
hi,
I have to develop a program that reads some strings and write into the resource file at run-time.But i have no idea, how to do it(how to create an entry into the string table at run-time.
Can anybody help me regarding this.
Any help will be highly appreciated.
Thanks and regards.
|
|
|
|
|
By "resource file" do you mean the .RC file? If so, why would you want to write to this file at run-time?
|
|
|
|
|
This is not possible. You can't change it at run-time, ressources are compiled into your .exe in release.
~RaGE();
|
|
|
|
|
Hi,
you can read and update string from resource of exe using BeginUpdateResource,UpdateResource and EndUpdateResource etc... functions.
hardstone
|
|
|
|
|
Thanks a lot to David Crow, Rage and HardStone for their valuable suggestions .
|
|
|
|
|
Hi:
How can i disconnect a RAS-communication programmatically ? for example internet connection such as Norton AntiVirus after LiveUpdate.
is there any API or Message to do this ? please help me.
Best Regards.
|
|
|
|
|
There is an API for Ras communications. The functions all begin with "Ras". I think you will need to enumerate the opened RAS connections in order to retrieve a handle, and then close it.
|
|
|
|
|
Hi I hope someone can help, I am trying to convert a string of ascii characters to their decimal or hex equivalent. I am reading the characters from the serial port using the comms api, then storing them in a Cstring buffer. I then try to convert them using the following
char *szTheString = (char *) (LPCTSTR) m_sCommsOutput;
int array[100] = {0};
sscanf(szTheString,"%d",array);
This seems to interpret the whole string as a number and just stores a large number in the first array element. How can I convert each individual array element i.e. a = 30 or whatever? Any ideas would be much a appreciated.
Andy
|
|
|
|
|
I think you will have to parse the string m_sCommsput retrieving each char, and store it in the table.
~RaGE();
|
|
|
|
|
so do something like
for (int i = 0; i<=sizeof(szTheString);i++)
sscanf((szTheString+i),"%d",&array[i]);
??
Andy
|
|
|
|
|
yes. note that you can keep your original CString :
for(int i=0;i<=m_sComOutput.GetLength();i++)
{
array[i]=m_sComOutput[i];
}
mmhh... looks odd, but this should work (You make me doubt There must be a better way to do the conversion )
[edit]
Indeed, you just need to do :
char *array=(char *)m_sCommOutput.operator LPCTSTR();
..and array contains your ASCII codes... I'm dumb
[/edit]
~RaGE();
|
|
|
|
|
Not providing an example of what you are after, I can only assume. See if strtol() is of any help.
|
|
|
|
|
int nLen = strlen( szTheString );
for( i = 0; i < nLen && i < 100; i++ )
array[ i ] = szTheString[ i ];
This is very simple and it doesn't seem to me that I am understanding your question right. In case you are reading numbers as ascii characters, i.e. you have a stream of data going through your serial port, like 30, 40, 11, 100... etc., then it would be different. Could you please be more specific because I am not very sure about your question?
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
hello,
I need something like a table control to display data in line and
columns. How can I do ?
I tried a CRichEdit text but that's not the good way since I have
to used the protected property to avoid the modification of separators,
and I can't avoid insertion anywhere !!!!
Thanks,
Tabs
|
|
|
|
|
hai Anonymous,
Even i was trying for the same kind of utillity and used grid controls(an activex control utility) for this purpose . even u can try grid controls and see if it fits ur requirment.
I had some problems doing the above so if get or come across a better idea plz do share it with . I am trying to implements table just like in MS-Word.
Thanks in advance
|
|
|
|