|
Thank you DavidCrow!
Is there a tool called profiler in Visual Studio 2003? I can not find it from the Tools sub-menu. Could you provide more detailed information please?
regards,
George
|
|
|
|
|
George_George wrote: Is there a tool called profiler in Visual Studio 2003?
I don't know, as I'm not familar with that product.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi DavidCrow,
What product are you talking about when you say profiler? VC6 or something else?
regards,
George
|
|
|
|
|
The profiler that comes with VS. It's on the Build menu.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi DavidCrow,
I have found that in the build menu of Visual Studio 2003, there is nothing called profier. Which IDE are you using?
regards,
George
|
|
|
|
|
George_George wrote: Which IDE are you using?
Visual Studio v6.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Any *Old* IDE,
DavidCrow, do you know whether there are related stuff for Visual Studio 2003?
regards,
George
|
|
|
|
|
I've got an application which I want to fit into the y dimension of the screen. The function:
cyMon = ::GetSystemMetrics( SM_CYSCREEN);
gives me the screen dimension, but I want the net dimension not including the task bar, if the task bar isn't being auto-hidden.
I see that if I hit the maximize button, the system is clever enough to take into consideration whether or not the task bar is displayed.
If I could somehow get the system to tell me what its maximize size it, that would give me the answer. The GetSystemMetrics gives me the same answer, with and without the task bar.
Does anyone know the appropriate call?
Thanks,
Ilan
|
|
|
|
|
|
You need to use SystemParametersInfo with the SPI_GETWORKAREA value: Retrieves the size of the work area on the primary display monitor. The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars. The pvParam parameter must point to a RECT structure that receives the coordinates of the work area, expressed in virtual screen coordinates.
|
|
|
|
|
|
i use the code to mininmize all open windows
::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0);
::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0);
but the dialog box on which button to minimize all does not minmimize.
that is all open windows minimize except the dialog box containing button
.and i do coding on this button
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
why not call ShowWindow(SW_MINIMIZE)after your ::PostMessage commands?
|
|
|
|
|
postmessage does not take one parameter
and i want to minimize all open windows not only one ,
thanks for your reply.
Ashish Dogra
MCA
Noida
|
|
|
|
|
You can accomplish this in three calls then...the PostMessage commands you have (will minimize all windows except the dialog calling it).
Then use ShowWindow(SW_MINIMIZE) to minimize the current window.
|
|
|
|
|
thanks
but it does not minimize all windows it minimize only itself and one window.
and also tell me if button is on third dialog then last two dialog are not minimized
Ashish Dogra
MCA
Noida
|
|
|
|
|
ashish dogra wrote: but the dialog box on which button to minimize all does not minmimize.
that is all open windows minimize except the dialog box containing button
Doesn't this mean that the only window not minimized is the one with the "button" on it? At this point in your program, you only have 1 window left open? If so, call the ShowWindow now and this one window will minimize.
|
|
|
|
|
Why not something as simple as:
keybd_event(VK_LWIN, 0, 0, 0);
keybd_event(77, 0, 0, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
That's a terrible technique. You need to check if applications have a systembox and, if so, if the minimize button is visible. Otherwise you are risking sending an application a message it specifically chooses not to handle, often triggering unexpected states in the code.
earl
|
|
|
|
|
ashish dogra wrote: .and i do coding on this button
call PostMessage(HWND_BROADCAST,WM_SYSCOMMAND,SC_MINIMIZE,0);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
i have the folowing function that doesn't work:
i get an error like: "MultiByteToWideChar' : cannot convert parameter 5 from 'char *' to 'unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast"
void CMina_sView::OnListenCom1()
{
CSerial serial;
LONG lLastError = ERROR_SUCCESS;
TCHAR tszMsg[200];
lLastError = serial.Open(_T("COM5"),0,0,false);
lLastError = serial.Setup(CSerial::EBaud9600,CSerial::EData8,CSerial::EParNone,CSerial::EStop1);
lLastError = serial.SetMask(CSerial::EEventBreak |
CSerial::EEventCTS |
CSerial::EEventDSR |
CSerial::EEventError |
CSerial::EEventRing |
CSerial::EEventRLSD |
CSerial::EEventRecv);
lLastError = serial.SetupReadTimeouts(CSerial::EReadTimeoutNonblocking);
// Wait for an event
lLastError = serial.WaitEvent();
// Save event
const CSerial::EEvent eEvent = serial.GetEventType();
// Handle ring event
// Handle data receive event
if (eEvent & CSerial::EEventRecv)
{
// Read data, until there is nothing left
DWORD dwBytesRead ;
char szBuffer[101];
do
{
// Read data from the COM-port
lLastError = serial.Read(szBuffer,sizeof(szBuffer)-1,&dwBytesRead);
// Finalize the data, so it is a valid string
szBuffer[dwBytesRead] = '\0';
// Convert the ANSI data to Unicode
LPTSTR lpszBuffer = LPTSTR(_alloca((dwBytesRead+1)*sizeof(TCHAR)));
MultiByteToWideChar(CP_ACP, 0, szBuffer, strlen(szBuffer), lpszBuffer, sizeof(lpszBuffer)+1);
m_pSet->AddNew();
m_pSet->m_Nume=szBuffer;
m_pSet->m_Serie="asfasdvce";
CTime time = CTime::GetCurrentTime();
m_pSet->m_Data=time;
UpdateData(TRUE);
if (m_pSet->CanUpdate())
m_pSet->Update();
m_pSet->Requery();
UpdateData(FALSE);
m_pSet->Close();
m_pSet->Open();
Invalidate();
UpdateWindow();
}
while (dwBytesRead == sizeof(szBuffer)-1);
}
// Close the port again
serial.Close();
}
|
|
|
|
|
tanarnelinistit wrote: // Convert the ANSI data to Unicode
LPTSTR lpszBuffer = LPTSTR(_alloca((dwBytesRead+1)*sizeof(TCHAR)));
MultiByteToWideChar(CP_ACP, 0, szBuffer, strlen(szBuffer), lpszBuffer, sizeof(lpszBuffer)+1);
I think you need to use WCHAR instead of LPTSTR and for sizeof(TCHAR) use sizeof(WCHAR)
hope this helps
Jetli
Constant Thing In World Is Change.
|
|
|
|
|
tanarnelinistit wrote: LPTSTR lpszBuffer = LPTSTR(_alloca((dwBytesRead+1)*sizeof(TCHAR)));
MultiByteToWideChar(CP_ACP, 0, szBuffer, strlen(szBuffer), lpszBuffer, sizeof(lpszBuffer)+1);
Shouldn't that be:
LPWSTR lpszBuffer = reinterpret_cast<LPWSTR>(_alloca(dwBytesRead+1)*sizeof(WCHAR));
Personally, I wouldn't use _alloca, I'd use something like
WCHAR wszBuffer[102]; // If you really must use magic numbers...
Steve S
Developer for hire
|
|
|
|
|
Hello,
replace your code:
<br />
LPTSTR lpszBuffer = LPTSTR(_alloca((dwBytesRead+1)*sizeof(TCHAR)));<br />
with this code:
<br />
TCHAR* unicode_string;<br />
unicode_string = (TCHAR*)calloc(dwBytesRead+1, sizeof(TCHAR));<br />
maybe helps?
or try instead LPTSTR to use LPWSTR???
regards
break;
|
|
|
|
|
maybe u haven't define _UNICODE. Hence
LPTSTR lpszBuffer is equavalent to char* lpszBuffer.
so
Either define _UNICODE
or
change LPTSTR lpszBuffer to wchar_t* lpszBuffer;
nave
|
|
|
|