|
*
**
* *
* *
* *
OOOOOOOOOOOOOOOOOOOOOOOO######
O #######
O ########
O #########
O ##########
OOOOOOOOOOOOOOOOOOO###########
* *
* *
**************
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Nice ASCII art
|
|
|
|
|
Agree with cedric
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Use GPC - General Polygon Clipper.
-Saurabh
|
|
|
|
|
thank you all of you.
i try myself to finish my homework now.
my teacher only gave some guides to do.
i am begin to solve another home work.
beside , i am a math student , not computer programming student.
|
|
|
|
|
Hi,
In my coding i initialized null to CString.Im comoaring NULL character to that string.But it returns wrong value.See my code.
CString ExeMonFile=_T("");
int NoExeMonFile=1;
if(strcmp(ExeMonFile,"")!=0)
NoExeMonFile=0;
By debugging the NoExeMonFile became 0.
Then i found that ExeMonFile is initialized to some other text.How its possible.
I declared ExeMonFile Globally.
Im using VS2008.Whats the betterway to initialize CString .
Anu
|
|
|
|
|
Anu_Bala wrote: CString ExeMonFile=_T("");
You dont need to intilalize CString , the constructor of CString will take of this. By default it will set the CString to an empty string.
Anu_Bala wrote: if(strcmp(ExeMonFile,"")!=0)
The best way to check wheather a CString is empty or not is to use the IsEmpty() function of CString .
|
|
|
|
|
But in my applcaiton in default it will assign to some "BL001" not only for this CString.
Whatever CString im using in this applcation all are initialized to this "BL001".
Just i converted VC++6.0 to VS2008.
After that only this problem arised.
Anu
|
|
|
|
|
How did you verify the content in the CString? while debugging or you tried to display the content in some message box?
If the optimisation is no disabled, there is a chance that the debugger show incorrect value while debugging( check project properties->c++->optimization )
|
|
|
|
|
My optimization setting is Disabled (/Od)
While debugging while keeping cursor on this CString variable it shows "BL001"
Actually BL001 is one term stored in char szModelName[10].
But why its get copied in all CString varialbes used in various classes.
Even in some dialog,in edit boxes it displayed to BL001 instead of empty box.
Anu
|
|
|
|
|
Thats bit strange. Some memory corruption I guess.
Let me ask. Have you called CString::GetBuffer() at some place and didnt call CString::Releasebuffer()?
|
|
|
|
|
When i searched for GetBuffer() in my coding,i get four or five GetBuffer() lines.
But unfortunately there is no ReleaseBuffer().
But where i using GetBuffer(),that CString is not related to above mentioned CString.
Im confused may it cause problem to all CString varialbles?
Anu
|
|
|
|
|
Anu_Bala wrote: Im confused may it cause problem to all CString varialbles?
Cannot predict what all can happen if memory corruption occurs.
|
|
|
|
|
You can use CString's Compare() function.
|
|
|
|
|
Anu_Bala wrote: CString ExeMonFile=_T("");
int NoExeMonFile=1;
if(strcmp(ExeMonFile,"")!=0)
NoExeMonFile=0;
Why do you mix the _T("") literal with the "" one?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
My problem is ExeMonFile is not initialized to null,
Its have someother value.
In my applciation all Uninitialized CString Value have this ex:BL001 string.
Even when initialized with _T(""),
it doesnot get initialized.
Anu
|
|
|
|
|
Anu_Bala wrote: Even when initialized with _T(""),
it doesnot get initialized.
You know that is a nonsense, doesn't you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Bytes following a null byte are not compared.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
hi,
i want to send a click message to a window button. i am able to enumerate the window and also find the handle of button as well but not able to send the click message. Actually the default focus is set on some another message if i send BM_CLICK message that call goes to other button not the one i am sending..... attached code is below
CWnd* pWnd = NULL;
CWnd* pWndBtn = NULL;
DWORD dwErr = 0;
while(true)
{
CWnd* WindowHandle = NULL;
CWnd* ButtonHandle = NULL;
WindowHandle = FindWindow(NULL, L"Microsoft Office Outlook");
if(WindowHandle)
{
ButtonHandle = FindWindowEx(WindowHandle->GetSafeHwnd(), 0, L"Button", L"Allow");
if(ButtonHandle)
{
CString strWnd ;
ButtonHandle->GetWindowText(strWnd);
WindowHandle->SetActiveWindow();
ButtonHandle->SendMessage(BM_CLICK ,0,0);
}
}
}
plz help.. i tried even setting window active also but dint work
|
|
|
|
|
Can't you associate a member variable to that button and then send the BM_Click to that particular button?
Does this[^] help you?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
no event that dint help....
|
|
|
|
|
Typically its the parent window that handles the BN_CLICKED event for a child window. As you can find the actual window you want to send the BN_CLICKED event for, all you need to do is get the control ID number using the GetDlgCtrlID() function on the button window.
You can then use PostMessage to the buttons parent window using:
parentWindow->PostMessage(WM_COMMAND, MAKELONG(buttonId, BN_CLICKED), buttonHwnd)
(I only had a quick and dirty look at the docs for this but I think it should work, you may have to sort out the parameters to make sure their correct)
If you vote me down, my score will only get lower
|
|
|
|
|
i have tried this also... but this also does not work.. You know what happend if i click anywhere on my desktop or elsewhere than message starts going. i dont quiet understand whats happening.
|
|
|
|
|
Have you tried SendMessage instead? Other than that I am not sure what to suggest.
If you vote me down, my score will only get lower
|
|
|
|
|
i have tried that also i am afraid that also does not work.. i tried SendInput() with MOUSE_EVENT just to simulate the click event than this message is going but sometimes what happens this SendMessage goes to the default button in the window. The button i want to send the message is not the default button.
|
|
|
|