|
Thank!
|
|
|
|
|
I have use the sdk to create and show a skined window , and it runs well . But the only problem is since I create the window using the WS_POPUP style( is this the reason ?) , there isn't any icon being shown when the application has been minimized ( I have set an icon in the window class ), what I need is that when I minimized my skined-window , an specified icon should be shown on its left side , the bar on the taskbar( you know , most of the window do like this. )
How can I do this ?
|
|
|
|
|
Look up WS_EX_TOOLWINDOW vs. WS_EX_APPWINDOW. Use the latter to get a tab ("button") in the taskbar.
|
|
|
|
|
I have found the key , just add the WM_SYSMENU to the window style , then let the window draw the icon for you .
|
|
|
|
|
Hello world...
Anybody have a good idea to control the errors in a program?
I often return an error ID from a function...
I've already use Exception but I found that not very usefull...
I've tried with a specific thread which uses a loop. Like this:
volatile int error = 0;
CEvent g_eventStart;
UINT CatchErrorThread(LPVOID pParam)
{
CWnd* MyDlg = CWnd::FromHandle((HWND)pParam);
do {
::WaitForSingleObject(g_eventStart, INFINITE);
g_eventStart.ResetEvent();
switch(error) {
case 0:
break;
case 1:
MyDlg->MessageBox("error message 1", "catch error", MB_ICONERROR | MB_OK);
break;
case 2:
MyDlg->MessageBox("error message 2", "catch error", MB_ICONERROR | MB_OK);
break;
default:
MyDlg->MessageBox("unknown message", "catch error", MB_ICONERROR | MB_OK);
break;
}
} while(error != 0);
return 0;
}
There is not another solution to make pass the errors???
Anybody have another solution???
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
Pretty hard to tell what this code is supposed to accomplish. Is the variable error assigned somewhere? It appears to be undefined in your code. Maybe you need something like
int error = g_eventStart.ResetEvent();
although that is just a guess. The code you presented would, of course, not even compile, unless error is some kind of global, set by the ResetEvent method?
<small>
You wrote:
I've already use Exception but I found that not very usefull...
I've tried with a specific thread which uses a loop. Like this:
</small>
This makes it sound like you are trying to use a thread in a loop to perform the same function as exception handling. Sorry, but that makes absolutely no sense. Handling errors is one topic, but I fail to see what a separate thread has to do with anything.
I think you should try harder with exceptions.
|
|
|
|
|
My aim is to catch an error ID and display a message error corresponding to this ID. I try to find any methods who can help me...
My code before work correctly...
the variable error is global.
When a error occure (for example a NULL handle is an error), I do this :
if(!MyHandle) {
error = ERR_001;
g_eventStart.SetEvent();
}
The advantage is that I can do that in my program anywhere.
But, yes, I'm a not an expert with Exception...
Thus this thread with his loop is doing the same thing as Exception!
I didn't know that!
What methods use you to catch error?
thanks
Hello World!!!
from Raphaël
|
|
|
|
|
You could do something like this...
in the calling program
try {
int x = SomeProcedure();
...
}
catch (CMyException *e)
{
LogError(e->nMyErrorNum....
delete e;
}
int SomeProcedure()
{
n = new CMyClass();
if (!n) {
CMyException* pErr = new CMyException(TRUE);
pErr->errNum = ERRORNUMBERIWANTTOUSE;
throw pErr;
}
...
Define class CMyException
class CMyException : public CException {
int nMyErrorNum;
...
Hope this helps
|
|
|
|
|
Thanks for this advice...
Hello World!!!
from Raphaël
|
|
|
|
|
Toolbars position on parent size
I have a problem with the position of the toolbars. For a better discription, open wordpad. Dock the toolbars side by side so that they both are in the same row. Now resize the main frame window so that to reduce the size from the right side to the left. Reduce to the smallest possible horizontal width. Notice that the second toolbar that you docked on the right of the first one has moved down. Now resize to increase the size. Notice that the toolbar is NOT moved back to right of the first toolbar. i.e. to its original position before reducing size.
I need to reposition it when the size is increased. Also, I need the docking support on all sides of frame, dynamic size and dock state toggle on double click, so simple rebar cannot be used.
MS Office uses the msoCommandBar which does all the desired, but i cant use it as i dont have its class, control or documentation.
The environment I am using is Visual C++ 6.0 with sp5.
Any ideas how this can be done?
The "Best" is what you can never achieve.
|
|
|
|
|
I want to display the jpeg file in the window.How to do this.Is it possible to use load bitmap function.I tried to import the jpeg file,but when i import it is asking resource type.i dont know what to give the resource type.Can anyone tell me how to solve this.
|
|
|
|
|
|
I havent looked at the other suggestion. But I suspect this is a more modern solution. Check out http://msdn.microsoft.com/msdnmag/issues/01/10/c/c0110.asp, there is lots of useful stuff here aswell.
"Life begins at 140"
|
|
|
|
|
I am developing a mediaplayer by customising Windows Mediaplayer Control. The mediaplayer should have the ability to detect whether there is already an audio playback running on the Windows 98/2000. If there is one running, the mediaplayer should stop it and start to run its own.
I know there is a property in Mediaplayer control which is called AudioStream, the value of which has been set to -1 be default. But I don't know how to make use of it.
Any help are greatly appreciated.
DJ
|
|
|
|
|
Hi All,
I need to create a program that would first check whether a minimum password length has been set or not,if it is not set then the program would set the minimum password length.How do I solve this problem.
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
Try Netxxxxx APIs,Such as NetUserxxx,NetGroupxxx,sorry,I don't know clearly
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Thanks for the help.
Abhishek
Learning is a never ending process of Life.
|
|
|
|
|
For replace the Ctl+Alt+Del SAS, I wrote a dll name mygina.dll,and copy it to system directory, wrote registry just make it usable;and some trouble come!, for to debug, I wrote "DebugBreak()" before I want break, But when the windows boot up, I got a "need replace gina.dll" message,why? and how can I break the code and to debug it?
|
|
|
|
|
Is this supposed to be funny or what?
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
I just want debug my gina.dll, but if I put a debug version on system directory, I will get a dialog box that tell me "you need replace the gina.dll", and system hang up, only goto reboot.
I mean how can i debug the gina.dll?
|
|
|
|
|
Hi...
Can please someone help me...how do i want to open the compiled help file (*.chm) in VC++
Rgds
|
|
|
|
|
As far as i am aware you can't open CHMs in visual studio. Use Microsoft HTML Help Workshop, or help authoring tool such as HyperText Studio or RoboHelp.
Dave
|
|
|
|
|
I know that we can open it using the HTML workshop...how i want to called it in the VC++ application
|
|
|
|
|
The HtmlHelp() API function works well for me.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
The Htmlhelp api will Do the job but dont ferget to #define the IDs in the HMTL workshop.
|
|
|
|