|
topsort algorithm using minimal vertex...Please do show me some example as well guidance.Thank you.
|
|
|
|
|
what does your textbook say ?
|
|
|
|
|
Chris Losinger wrote: what does your textbook say ?
Wow! They have talking text books now! Man when I was in school we had to READ them.
|
|
|
|
|
No. Do your own homework.
______________________________________
Computer programmers are like umpires.
No one knows your name until you screw up.
|
|
|
|
|
Have you tried calling TopSort(array, vertex::minimal) ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi all, i have a class derived from CDialogImpl<>,i want to catch the Message WM_Keydown, and identify if that key is esc then dont close the dialog.
i have managed to do that in MFC application using Pretranslate function but that function is not working in ATL class,
i have tried to override DialogProc() but this function also not called, similaraly other option like CMessage::PreTranslateMessage and but same result these function are not called.
how to get equalent of MFC's PreTranslateMessage() in this class.
Regards.
Tasleem Arif
|
|
|
|
|
What about overriding CDialogImpl::DialogProc()?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i override that function but did not worked either.
here was code i was using
static virtual LRESULT CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);<br />
LRESULT CMiniBubbleDialog::DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)<br />
{<br />
WriteEventLog1("Proc called");<br />
switch(uMsg)<br />
{<br />
case WM_MOVE:<br />
WriteEventLog1("Mouse is moved");<br />
break;<br />
case WM_LBUTTONDOWN:<br />
WriteEventLog1("Lbutton Down");<br />
}<br />
return 0;<br />
}<br />
but did not worked.
Regards.
Tasleem Arif
|
|
|
|
|
Maybe override CDialogImpl::GetDialogProc() and return a pointer to your dialog proc.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You can Override OnCancel();
Like this!.
void YourClassName::OnCancel()
{
// TODO: Add your specialized code here and/or call the base class
CDialog::OnCancel();
}
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
as suggested by santosh, you can override it or comment the following code
//CDialog::OnCancel();
|
|
|
|
|
Hi, is there any simple way how to change radio-button,check box and group box TEXT COLOR?
OnCtlColor evidently doesn't work
Or some class to do it for me?
Thanx
viliam
|
|
|
|
|
Try playing around with this...
ON_MESSAGE(WM_CTLCOLORSTATIC, OnCtlColorStatic)
...
LRESULT CMyDlg::OnCtlColorStatic( WPARAM wParam, LPARAM lParam)
{
LRESULT lRet = Default();
HDC hDC = (HDC)wParam;
HWND hWnd = (HWND)lParam;
::SetTextColor(hDC, RGB(0x00,0xFF,0xFF));
::SetBkMode(hDC, TRANSPARENT);
return (LRESULT)::GetStockObject(NULL_BRUSH);
}
Don't ask me why WM_CTLCOLORSTATIC is used for radio buttons,
check boxes, and group boxes Maybe because their text is static!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thank you,
it pushed me closer. I tried your code - and modified it and try it again:
- it works to set backgroung color of all controls like radio, check and so on
but only Text controls change text color. Radio-Button control, Check-box control even Group-box controls have still default color.
I am getting this messages for them but SetTextColor function seems to have no effect called from there ??
viliam
|
|
|
|
|
It works for me on XP SP2 without the common controls 6.0.0.0 manifest entry (no themes).
With the themes, radio buttons work, check boxes and group boxes do not.
There's no guarantee any of this will work, especially with buttons.
You have to experiment, and then hope it doesn't change in the future.
Owner drawn or custom controls are the only guarantee...
Good luck
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
clear now,
i try to take manifest entry away and everything works fine.
Now I wonder if is possible to skip manifest just for some part
of program - i dont want to lose messageboxes and this better looking Win XP advantages stuff.
Thank you for help and advices
viliam
|
|
|
|
|
I have multiple levels of functions that I would like to have pointing to the same data. I have things set up like so. I have an issue that when I get into func2.. str1[0].myStr does not have data; I'm screwing this up somewhere.
<br />
struct myStruct{<br />
int myInt;<br />
CString myStr;<br />
};<br />
<br />
void main()<br />
{<br />
myStruct *st1 = new myStruct[10];<br />
st1[0].myStr = "test1"; <br />
Class1 *cls1 = new Class1(st1[0]);<br />
}<br />
<br />
class Class1<br />
{<br />
myStruct *m_pSt1;<br />
}<br />
<br />
void Class1:Class1(myStruct &st2)<br />
{<br />
m_pSt1 = &st2;<br />
Class2 *cls2 = new Class2(m_pSt1->myStr);<br />
}<br />
<br />
void Class1::OnFileSave()<br />
{<br />
MessageBox(m_pSt1->myStr);
}<br />
<br />
<br />
<br />
class Class2<br />
{<br />
CString *pMyStr;<br />
};<br />
<br />
void Class2::Class2(CString &myStr2)<br />
{<br />
m_pMyStr = &myStr2<br />
}<br />
<br />
void Class2::OnEventFunc2()<br />
{<br />
*m_pMyStr = "test3";
}<br />
Thanks in advance for any help on this
-- modified at 11:33 Monday 8th October, 2007
|
|
|
|
|
aquawicket wrote: I have an issue
what knid of issue ? compilation ? linkage ? execution ?
what's the error message ?
BTW, if you use pMyStr inside func2() without declaring it previously, how can you think it can work ?
ps: please use <pre></pre> tags when posting code samples...
|
|
|
|
|
srry.. had to edit the code a little bit. I can't post the entire code so i'm trying to break it down.
the pointers in the functions are actually member pointers so the entire class has scope of the pointer. By the time Class to is created myst1[0].str no longer has data. I will edit the code one more time to be more specific.
|
|
|
|
|
i have a question. do you really want the member pMyStr to be a CString pointer ??
anyway, what does this line produce if you replace the line within func2() :
*pMyStr = CString("test3");
|
|
|
|
|
the point is, The pointer in Class2 shows that it is pointing to the write place, because when I set it in Class 2 it works. And In Class1, setting the value by pointer works also, so I know that one is pointing to the right place to. It is the value that is set in the main function that is somehow getting overwritten or NULL'ed, and i can't understand why.
|
|
|
|
|
just a guess, try to use your debugger with some breakpoints to figure out where the data is NULL'ed.
also, if you can use references instead of pointers, i advise you to ; using pointers and allocating memory on the heap is driving you into trouble if you don't handle them perfectly...
|
|
|
|
|
ok.. but how do I get the reference into the scope of the intire class. I was using member pointers to do it. is their another way?
class Class1
{
int *m_ptr;
}
Class1::Class1(int& num)
{
m_ptr = #
}
Class1::func1()
{
//I have access to the reference
m_ptr = 5;
}
|
|
|
|
|
I FIXED IT !!!!
it was not a problem with pointers, classes, member pointers or references at all. I had an event that was triggering before any data was set and it was in fact NULLifying the value. Thanks for the help
|
|
|
|
|
I ve come across a problem,
I want to Run an application as a Service using VC++
It is an MFC application with ATL Support
I ve registered the exe using /RegServer and in my service program I ve a function like
if(SUCCEEDED(hResult))
{
hResult = CoCreateInstance(__uuidof(QBFeeder), 0,
CLSCTX_SERVER, __uuidof(IQBFeeder), (void **)&m_pQBFeeder);
}
if(!SUCCEEDED(hResult))
{
return E_FAIL;
}
but the CoCreateInstance function returns a value -2147467262.It gives an error like "no such interfaces supported"
It works in one of my machines(AMD) but it fails in another machines(Intel)....
Has anyone come across a similar situation?
Can anyone give me a solution?
Regards,
Jomon Jacob
|
|
|
|