|
sorry, i get the same errors.
i' using vc++6.0
|
|
|
|
|
That makes sense. I compiled in VC6 before posting that code so it will compile.
I tried many variations on the code you posted and could not reproduce the compiler errors you posted. It is likely your error is in another place in your code.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
damn
it's the only place i use stl.
if i comment that out, everything else works
|
|
|
|
|
Ok, went back and looked at your original post more closely. THIS_FILE provides a clue so I put my code in a .cpp file and produced the errors you reported.
Then put the declarations back into a header file and instantiate a Lista variable in the .cpp file. No compile errors.
Give it a try.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
i need the 'Lista' as an atribute of a class.
#include <list>
#include <string>
struct ElementLista {
std::string jid;
std::string nombre;
std::string subscripcion;
} elem;
typedef std::list< ElementLista> Lista;
class CProtocolo
{
public:
Lista ListaContactos;
..
.
.
};
|
|
|
|
|
struct ElementLista {
std::string jid;
std::string nombre;
std::string subscripcion;
} elem;
That declares a variable named "elem" of type ElementLista at file scope which i don't think you want. Plus it can cause compile errors due to redefinition of the variable.
Using the type for a class member variable is fine.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
#include < list > before the MFC macros(*) kick in.
(*)
<small>#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif</small>
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
Hi there,
When I call the convertString function I get the 2 of the same errors on the same line: missing ';' before '.' I can't seem to find a problem with it. Can someone help me?
Thanks!
char temp2[6];
UINT temp;
temp = 129;
CRex.convertString(temp2, temp); //error on this line
/**********************************************************
void CRex::convertString(char *value, unsigned int num)
{
char convert[8] = {'0', '1', '2', '3', '4', '5', '6', '7'};
value[0] = convert[num >> 12 & 0x7];
value[1] = convert[num >> 9 & 0x7];
value[2] = convert[num >> 6 & 0x7];
value[3] = convert[num >> 3 & 0x7];
value[4] = convert[num & 0x7];
value[5] = 0;
}
|
|
|
|
|
CRex is a type of object, but not an object itself. How about:
char temp2[6];
CRex cr;
UINT temp;
temp = 129;
cr.convertString(temp2, temp);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
since there is no instance data used in convertString you could make it a static member of CRex...
class CRex{
public:
static void convertString(char* value, unsigned int num);
};
then use it like this...
CRex::convertString( temp2, temp);
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
char convert[8] is not large enough to hold your string.
Try
char convert[9] = {'0', '1', '2', '3', '4', '5', '6', '7'};
or
char convert[] = {"01234567"};
|
|
|
|
|
Your syntax is wrong. You need to make convertString a static member of CRex and call it like CRex::convertString . But why is convertString a member in the first place? IMO it's worth answering that question.
Paul
|
|
|
|
|
Thank you all for your quick responses! I followed David Crow's advice and it worked. Thank you again for the support. This is definitely the best message board I ever came across!
|
|
|
|
|
Hi.
I want to enumerate all of the processes that are running on a particular desktop. Enumerating all processes isnt the problem, its the filtering of them that is causing me trouble.
The desktop a process is to run on is specified in the STARTINFO passed to CreateProcess, however, as far as I can see, this is the only place where the desktop is specified, and the only function I can find to retrieve this information is GetStartupInfo, which will only return the STARTUPINFO structure for the calling process.
Any ideas?
To those who didn't make it, we will remember you. To those who did is back. - Megan Forbes in Black FridayAnother Post by NnamdiOnyeyiri
|
|
|
|
|
So what exactly is your question? If you are not wanting all of the processes that CreateToolhelp32Snapshot() provides a list of, what are you wanting to filter on?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
The desktop they are a part of. One of the memebers of STARTINFO is lpDesktop. If you create a desktop called CP, using CreateDesktop, then set lpDesktop to "CP", when using CreateProcess, the process runs in the CP desktop, so, if your not viewing the CP desktop, you wouldnt see the applications window appear (if it has one).
What I can get, is handles to all of the windows in running on the desktop - maybe I can use that to find the processes, and kill them.
To those who didn't make it, we will remember you. To those who did is back. - Megan Forbes in Black FridayAnother Post by NnamdiOnyeyiri
|
|
|
|
|
I've got a service.
On rare occasions, it crashes. When it does, it needs to restart.
Here's the details:
(1) it is configured in service-control to restart if failure.
(2) we don't want to rely on DrWatson or any external program to monitor it.
(3) we've tried using SetServiceStatus to signal error on shutdown.
How do we programmatically signal to the service control manager that this failed and it just needs to restart. We've had some problems where 'crash ui' get's invoked.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Peter,
Since no body is providing any direct answers I will ask a few questions.
How do you now it crashes? Does it log errors or what?
Could you define “crash”? If your service terminates abnormally then how can you signal anything since your “shutdown” routine will not be executed.
I am not familiar with the term “crash ui” what is it?
Ultimately I suggest you find the problem and fix it rather than counting on restart.
|
|
|
|
|
Ok... well that reply is me! Don't know how i managed to get logged out and post a reply at the same time. Maybe i need a beer!
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Ultimately I'd like to fix all crashes. But if something bad does happen the service needs to log what happened and restart.
A crash is a crash -- and sometimes it's an assertion. We can detect the crash and write out a minidump. But getting the service control manager to allow us to restart is the problem.
As for "crash ui" -- on a machine with no installed debugger, a message box comes up saying that you did something bad (read attemtped at 0x000000....)
MSDN support had no good answer, except they recommended to write a "service monitor" program to accomplish what the SCM won't do.
oh well.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Hi guys
Somebody has an example about to reduce the minimum size of a ComboBox
When I add a Combo box,there is a minimum size and I'd like to have one smaller (I talk about height) than this.
Do you know a derived class where I could see how to do this?
Best Regards
Doc
|
|
|
|
|
You can adjust the height within the resource editor. If you click on the down arrow portion it outlines the minimum size.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? - David Williams (Little Britain)
|
|
|
|
|
You might want to try SetItemHeight for the combo.
|
|
|
|
|
i want to draw into a windows menu but i
can't find a way to get a device context
for it. more specificially, i want to
make a rectangular menu of icons. windows
doesn't seem to support rectangular menus,
so instead i am making a menu with 1 owner
drawn item. i draw the menu when i get the
WM_DRAWITEM message. i can select the
correct option because i can call
GetCursor() when processing WM_MENUSELECT.
what i can't do is update the highlighting
while the mouse moves. i can process
WM_EVENTIDLE messages, but when handling
this message i have no way of drawing into
the menu. WM_DRAWITEM provides a DC, so I
know one exists in the system. Is there
any way to copy this DC and use it later,
or get the DC? Are menus implemented as
windows? Because if so i could maybe
get the hWnd for the menu or something.
Thanks, Phil.
|
|
|
|
|