|
Thanks bud. Now I at least know what it stands for
Nish
p.s. by the way your ID is okay now...
Yeah that's me down below
|
|
|
|
|
use ShellExecute to run C:\Windows\System32\services.msc
Naturally, you would use GetSystemDirectory to find the exact location.
--
David Wengier
TAC ad gone wrong: "Don't fool yourself, you're a bloody idiot."
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
David Wengier wrote:
Naturally, you would use GetSystemDirectory to find the exact location.
Not required.
ShellExecute(this->m_hWnd,"open","services.msc",
"","",SW_SHOW);
That will do.
It searches the default paths.
Nish
Yeah that's me down below
|
|
|
|
|
Nish [BusterBoy] wrote:
Not required
I would be embarrased to have gotten that wrong, except I dont program in C++ so ner :p
--
David Wengier
TAC ad gone wrong: "Don't fool yourself, you're a bloody idiot."
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
David Wengier wrote:
I would be embarrased to have gotten that wrong, except I dont program in C++
Actually it's me who should have gotten embarassed cause I didn't know what adara meant by MMC till he told me
Nish
Yeah that's me down below
|
|
|
|
|
|
I am developing an ATL server that will run on several remote systems. How can I pick a server to connect to at run time? I know that I can use DCOM configuration to specify the implementation location before running my application but I want to allow a user to select from a list of computers or IP address that house the server while the client is running. How do I tell ATL where the server is located at run time?
Thanks.
|
|
|
|
|
Take a look at the COSERVERINFO structure in CoCreateInstanceEx.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
What would I have to do to use high color bitmaps in a CToolbar...?
I created a app with the wiz and tried changing the bitmap to a high color, but because CToolbar uses the 192,192,192 RGB color of 16 color toolbar bitmaps as a substitution color i'm assuming high colors won't work...?
Cuz well they didn't when I tried, unless i'm doing something wrong...?
I'm thinking I should just design a toolbar from scratch (CControlbar) and handle the loading of the bitmaps and all that stuff.
Should I pick apart CToolbar in MFC or does anyone know really cool toolbars I can use as example.
Anybody suggestions...?
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You can use CToolBarCtrl::SetHotImageList and CToolBarCtrl::SetImageList to set the double color 24 bit toolbars
Nish
Yeah that's me down below
|
|
|
|
|
I just figured that out.
However i'm in need of something to do so I figure i'll tackle a custom 24 bit toolbar just for the heck of it.
Thanx Nish.
Is that your Johnny Denver...fever...??? what was it...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
HockeyDude wrote:
Is that your Johnny Denver
Johnny Bravo
Nish
Yeah that's me down below
|
|
|
|
|
Hi.
I would like to know how to change (repaint) a new color for a CButton object, both group and/or options.
For example:
...
CButton mBtnGreen;
...
mBtnGreen.Create("Green", WS_CHILD | WS_VISIBLE | BS_CHECKBOX
CRect(CPoint(0, 0), CSize(25, 50)), this,
IDC_BTNOPT_GREEN);
...
By default, the color of option (button) "Green" is light gray, like cream. I would like to change the color of the background of the button and/or text. By default, the text is black.
I tried repaint the entire client area, but MFC ignores the button areas.
Thanks,
Kuphryn
|
|
|
|
|
1) ownderdrawn
2) Subclass
Chris has an article that should meet your requirements nicely.
Custom button
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Anyone have any idea how to find how much space my CObject derived class is taking or will take up once its serialized?
I've serialized an object then manually written raw data at the end of the file. This works fine, but when I read it back, i figured I could serialize the object and pick up where the file pointer left off, but nope.
I forgot that CArchive allocates a buffer and reads in chunks so, i can't assume that the file pointer is immediately after the object i just serialized.
So, i need to find out what the actual disk space of my object is - any ideas?
Marcus Spitzmiller
"Ha ha, Stupid bloropope.." - Homer
|
|
|
|
|
I seriously wouldn't advise that Marcus.
It's not a good idea.
You might end up corrupting the serialized objects
Nish
Yeah that's me down below
|
|
|
|
|
Hmmm....I'm in a pickle, then.
Maybe you've tried this sort of thing, then. Basically I'm writing an object to a file as a header then appending various other files to create a large file. Basically, minus error checking:
fOut.Open(strFileOut,
File::modeCreate|CFile::modeWrite|CFile::shareDenyNone, &Error);
//the header
CArchive ar(&fOut, CArchive::store);
m_objInstrument.Serialize(ar);
//then i append the files
for(int i = 0; i < arFileNames.GetSize(); i++)
{
strFileName = arFileNames.GetAt(0);
arFileNames.RemoveAt(0);
fIn.Open(strFileName, CFile::modeRead, &Error))
dwLength = fIn.GetLength();
BYTE * pBuf = (BYTE *)malloc(dwLength);
fIn.Read(pBuf, dwLength);
fOut.Write(pBuf, dwLength);
fIn.Close();
free pBuf;
}
fOut.Close()
So you're saying this is a bad idea? Wait..I just noticed the CArchive::Write method...Interesting. I'm going to give this a try, but in the meantime if you have any suggestions, please feel free to let me know.
Marcus Spitzmiller
"Ha ha, Stupid bloropope.." - Homer
|
|
|
|
|
Here is something you could try:
CMemFile file;
CArchive ar(&file, CArchive::store);
pYourObject->Serialize(ar);
ar.Close();
DWORD dwSizeOfYourObject = file.GetLength();
file.Close();
I haven't tried it, so may be this would give you a size that is a multiple of nGrowBytes (parameter of the constructor of CMemFile, 1024 by default).
Hope this helps,
David Defoort
|
|
|
|
|
Thanks, David - I'll give that a go, and get back to you.
Marcus Spitzmiller
"Ha ha, Stupid bloropope.." - Homer
|
|
|
|
|
what does this mean?
Run-Time Check Failure #2 - Stack around the variable 'Alt' was corrupted.
also what is a stack overflow really and how are they caused and prevented?
Thanks.
Steve
Not all who wander are lost...
|
|
|
|
|
I do not know the answer to your first question.
stack overflow is when you run out of stack space in your process. They can be caused in a number of ways, but the reasons including calling a recursive function that recurses until there is no more stack space, a bad message loop is created and an endless number of function calls are created until there is no more stack space. Your stack pointer gets corrupted.
Why they are really bad is that each time you call a function, it creates a stack frame at the current stack pointer (SP). All of the stack variables that are created in your function are allocated on the stack as well as the parameters that are passed into the function. If you run out of stack space, then you lose the ability to make function calls and allocate stack varaibles.
|
|
|
|
|
Basically it is a new feature in VC7.
Let us say that Alt is a 10 byte character array. (char Alt [10]). If you write to the 11th byte, you will get this error.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Wow
That's indeed a cool feature.
Its amazing it wasnt there in VC 6.0.
We dont usually think of corrupted stacks.
Nish
Yeah that's me down below
|
|
|
|
|
There are 3 new debugging options that are nice. (But slow)
/RTCc - Checks for loss of precision. (i.e. char a = 10000)
/RTCs - Initialize local variables to non-zero. Detect over-runs and under-runs of arrays on the stack. Stack pointer verification (i.e. calling a __stdcall routine using __cdecl which has totally different stack requirements.)
/RTCu - Reports when a variable has been used prior to initialization. This is a run-time check and not compile time.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
C:\Windows\Desktop\Project3\Partition.cpp(178) : error C2440: 'type cast' : cannot convert from 'int (__thiscall Partition::*)(void)' to 'int'
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
int MemoryManager:: searchList(int pID)
{
LinkedList<partition>* current;
LinkedList<partition> first = Li.info();
current = &first;
Partition tempPartition = current->info();
while((current != NULL) && (((int)tempPartition.getProcessID) == (int)pID))
{
current = current->next();
}
return 0;
}
<\pre>
could anyone tell me how do i fix this thank you.
|
|
|
|