|
|
|
After changing to Visual Studio.Net and C++ V7 (and from WinNT to Win2K), I cannot change the application icon of my Visual C++ 7.0 application.
On my developer machine, I can only see the standard MFC icon, although this was explicitly removed from the app's resources.
When the application is installed on another machine, it correctly displays its custom icon.
Any ideas ? Thank you !
|
|
|
|
|
If you move your .exe out of the release directory, is the icon still wrong ?
~RaGE();
|
|
|
|
|
Yes, in the app. The desktop link (I made one) displays the correct icon !
|
|
|
|
|
The desktop link uses the 32*32 icon, whereas the app (in the explorer) uses the 16*16 one. Did you change both of them (Check that ComboBox in the ressource editor...)
~RaGE();
|
|
|
|
|
1. Have you Rebuilt All?
2. In Doc/View architecture, distinguish between application and document icon (the link may display custom application icon, and the document icon may still be wizard-generated.
Regards,
BB
|
|
|
|
|
(1) Yes, I rebuilt
(2) It is not the problem with app/doc icon, but the app has the MFC default icon.
|
|
|
|
|
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.
|
|
|
|