|
Guys,
How can I get text info into the systray? Something like the clock. All the examples I see are to put icons there but I need to put a small amount of text there (and it would be great if I could change the color of it too - maybe even make it scroll.)
Thanks!
|
|
|
|
|
There's no support for this in the API. If your text can fit on a 16x16 icon, then you can create an icon dynamically with the text on it. Otherwise, you'll have to be extremely creative, possibly finding the system tray window, and creating a child window inside it. It's not that simple either. You might even have to subclass the taskbar so that you can stop the taskbar's default tray positioning, which means writing a DLL and using either SHLoadInProc() or a system-wide hook to get into explorer's address space...
If you manage it, write an article . You might want to find another way of showing the information though. It's probably not worth the effort of reprogramming Windows.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I have an an application that is a Popup Dialog box in a dll. I'm using MFC 6.0.
my problem is I'm trying to load a menu bar icon on the sucker, and I just can't get it to load. I thought I do this:
SetIcon(::LoadIcon(NULL,MAKEINTRESOURCE(IDR_MAINFRAME)),FALSE);
in the OnCreate Overrideable in my CDialog-derived class. Doesn't work though. It always returns 0x000000 for the HICON.
any suggestions on how to do this? I'm sure I'm just putting it in the wrong place or performing the operation wrong.
Any insight, comments or suggestions are greatly appreciated.
Thanks!
|
|
|
|
|
in debug(watch) window enter the following
"@err, hr"
What is the value of that expression after the line above is executed?
|
|
|
|
|
As it turns out,
when using the LoadIcon you must get the HINSTANCE of the dialog in the dll, not the application HINSTANCE. That fixed my problem.
thanks for the help though!
|
|
|
|
|
Hey my name is Renaud and I have a serious DirectX related problem… any help??
I build this full screen menu with directX...This Directx menu can cycle through various DirectX games and launch each one. When the user selects the game he wants to play the menu application clears out all the surfaces and then launches the new direct x game and then closes the menu app.
The problem is the same game cannot be played twice thought the menu without getting a DirectDraw error ... I believe the error is created while the game is trying to SetCooperativeLevel... so you can launch the game through the menu the first time, but the second time it crashes...weird eh?
I am completely clueless on how to fix this.
well anyway any feedback would be greatly appreciated!!
Thanks
Renaud Richard
|
|
|
|
|
What version of the DirectX interfaces are you using? Since you mention DirectDraw, I'm guessing DX7.
What is the HRESULT return code from the call to SetCooperativeLevel() , and what flags are you passing to the dwFlags parameter?
- Mike
|
|
|
|
|
Hello,
I need to enable/disable secondary monitor from my program.
I found out how to get information about monitors, but nothing about how I can automatically extend desktop to the monitor or undo such action.
I need to enable/disable my secnodary monitor time to time, and I could not find a FREE program which would do it for me, so I want to write my own.
Thanks.
Regards, Alexander.
|
|
|
|
|
I think I've done this with the ChangeDisplaySettingsEx API call some time ago.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
It looks like it is possible to do so with this function, I still hope to find plug-and-call solution, so I would not have to read help. Maybe someone has an example?
Thanks.
|
|
|
|
|
Hi,
If I have in my *.h:
double** m_GLdouble;
and in my *.cpp:
m_GLdouble = new double*[m_Size * 12];
when it's time to delete, do I have to do?
for(int i = 0 ; i < m_Size * 12 ; i++)
{
delete m_GLdouble[i];
}
delete m_GLdouble;
->or<-
delete [] m_GLdouble;
m_GLdouble = NULL;
Also is there a way to return a pointer such a way that the receiving function cannot modifie the returned object? Something like:
Object* myClass::myReadFunction()
{
return m_Object;
}
void otherClass::otherfunction()
{
Object* pObj;
pObj = m_myClassObj->myReadFunction();
//Is there a way to make pObj impossible to modify?
}
hope you understand
Thanks
Everything's beautiful if you look at it long enough...
|
|
|
|
|
The way have allocated memory to the pointers, I suppose that one delete statement should be sufficient.
Reg. your second question,
may be you can consider using
const Object obj;
obj=&m_myClassObj->myReadFunction();
Harsha
----------------------------------
http://www.ece.arizona.edu/~hpg
----------------------------------
|
|
|
|
|
For every new, you'll need a matching delete. So if your allocation looked like:
double **m_GLdouble;<br />
m_GLdouble = new double*[m_Size * 12];
the deallocation would be:
delete [] m_GLdouble;
But if you also had allocations for each of those pointers:
for (int x = 0; x < (m_Size * 12); x++)
{
m_GLdouble[x] = new double;
} you'd have to delete those before deleting m_GLdouble itself. The deallocation would be:
for (x = 0; x < (m_Size * 12); x++)
{
delete m_GLdouble[x];
}
delete [] m_GLdouble;
|
|
|
|
|
Hi guys
I'm converting some code from Watcom C to Visual C++ and the compiler tells
me this.
C:\AppDoc.cpp(508) : error C2664: 'qsort' : cannot convert parameter 4 from 'int (const short *,const short *)' to 'int (__cdecl *)(const void *,const void *)'
None of the functions with this name in scope match the target type
My declarations are
In AppDoc.h
int accept (const short int *a, const short int *b);
In AppDoc.cpp
qsort((void *)order,BLQ_EIGHT,sizeof(short int), accept);
int AppDoc::accept (const short int *a, const short int *b)
{
return (q[*b].accept-q8[*a].accept); //q is an struct
}
What I have to change to make this work?
Best Regards
Dr.Pi
|
|
|
|
|
Change the accept function to take void *s. Then, in the accept function, cast the void pointers to whatever you need them to be.
onwards and upwards...
|
|
|
|
|
Hi basementman
Thanks for your fast answer but now the error has changed
C:\AppDoc.cpp(508) : error C2664: 'qsort' : cannot convert parameter 4 from 'int (const void *,const void *)' to 'int (__cdecl *)(const void *,const void *)'
None of the functions with this name in scope match the target type
Do you know why it sais this?
Best Regards
Dr.Pi
|
|
|
|
|
You may be using a different calling convention by default. Look at your Project Settings/C++/Code generation category and see what is selected for the calling convention.
onwards and upwards...
|
|
|
|
|
Hi man
Sorry my ignorance about this but In Settings->C/C++->Code Generation->calling convention I have a __cdecl *
Is this wrong? right?
I don't know how to make this work, and worse I don't know why is not working.
Best Regards
Dr. Pi
|
|
|
|
|
Sorry I've made a mistake typing
I typed
return (q[*b].accept-q8[*a].accept); //q is an struct
and it has to be
return (q[*b].accept-q[*a].accept); //q is an struct
The call is this line
qsort((void *)order,BLQ_EIGHT,sizeof(short int), accept);
Best Regards
Dr.Pi
|
|
|
|
|
This should get you close:
int accept( const void *p1, const void *p2 )
{
short int *n1,
*n2;
n1 = *((short int *) p1);
n2 = *((short int *) p2);
return n1 - n2;
}
...
qsort((void *) order, BLQ_EIGHT, sizeof(short int), accept);
|
|
|
|
|
Several problems :
1. int AppDoc::accept(...)
qsort requires a C function, you can not pass a non-static class method.
2. The prototype does not match that specified for qsort.
In particular qsort requires the function to look like :
int compare(const void *elem1, const void *elem2);
You can get around this via casting of elem.
3. (related to 1) If you are going to define a C compare function in a C++ header/source file then you need to wrap the declaration in (to prevent C++ name mangling) :
#ifdef __cplusplus
extern "C" {
#endif
int compare(const void *elem1, const void *elem2);
#ifdef __cplusplus
}
#endif
4. You are passing indicies to an array of struct q, chances are you want to sort q, in which case you need to pass the q array to qsort and pass pointers to the q struct to the compare function. I don't know what order is ?
5. (not a problem, but change anyways) You have a method named accept in AppDoc and a field named accept in struct q ... stop it.
...cmk
|
|
|
|
|
Hey, I want to export some object paintet (MFC OnDraw-function)to a bitmap. When I use BitBlt Dialogs appear in the final bitmap too...
I'd like to have only my painted Objects....
|
|
|
|
|
I'm inheriting a project which has a lot of static libraries (hardware control). Can I just create a dll (using VS wizard) and link the static libaries into one dll with no troubles?
Bit of a newbie in this arena....I haven't worked with DLLs much.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
Are you trying to write wrapper functions for all the functions in the static libraries or do you just want to use the functions in the static libraries in the DLL? If you can make it a bit more clearer, I will be able to help you out...
|
|
|
|
|
No wrapper necessary. I'd like to just them as they are...just in the DLL.
The static libs are fine as they are...I'd just like to have open one time, in one instance in memory instead of building them in to every test program I'm going to write which uses them.
Appreciate your advice.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|